Repository: crsmithdev/arrow
Pull request #816 (2020-06-30 12:01:31)

Added week and weeks timeframes for Czech locale
## Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all *appropriate* boxes:

<!-- Check boxes by placing an x in the brackets: [x] -->
- [ x ] 🧪 Added **tests** for changed code.
- [ x ] 🛠️ All tests **pass** when run locally (run `tox` or `make test` to find out!).
- [ x ] 🧹 All linting checks **pass** when run locally (run `tox -e lint` or `make lint` to find out!).
- [ ] 📚 Updated **documentation** for changed code.
- [ x ] ⏩ Code is **up-to-date** with the `master` branch.

## Description of Changes

Added week and weeks timeframes to the czech locale. Documentation is not affected.

Closes: #815

codecov-commenter: # [Codecov](https://codecov.io/gh/crsmithdev/arrow/pull/816?src=pr&el=h1) Report
> Merging [#816](https://codecov.io/gh/crsmithdev/arrow/pull/816?src=pr&el=desc) into [master](https://codecov.io/gh/crsmithdev/arrow/commit/74450bbd4304b51a1291338d33b2ae2131f870e2&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/crsmithdev/arrow/pull/816/graphs/tree.svg?width=650&height=150&src=pr&token=4EkGnFsIGn)](https://codecov.io/gh/crsmithdev/arrow/pull/816?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##            master      #816   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         1757      1742   -15     
  Branches       300       300           
=========================================
- Hits          1757      1742   -15     
```


| [Impacted Files](https://codecov.io/gh/crsmithdev/arrow/pull/816?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [arrow/locales.py](https://codecov.io/gh/crsmithdev/arrow/pull/816/diff?src=pr&el=tree#diff-YXJyb3cvbG9jYWxlcy5weQ==) | `100.00% <ø> (ø)` | |
| [arrow/arrow.py](https://codecov.io/gh/crsmithdev/arrow/pull/816/diff?src=pr&el=tree#diff-YXJyb3cvYXJyb3cucHk=) | `100.00% <0.00%> (ø)` | |
| [arrow/parser.py](https://codecov.io/gh/crsmithdev/arrow/pull/816/diff?src=pr&el=tree#diff-YXJyb3cvcGFyc2VyLnB5) | `100.00% <0.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/crsmithdev/arrow/pull/816?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/crsmithdev/arrow/pull/816?src=pr&el=footer). Last update [74450bb...15370eb](https://codecov.io/gh/crsmithdev/arrow/pull/816?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

systemcatch: Hi @mesemus, thank you for the PR. I'm happy with this but will give Kris a chance to chime in.

Patch:
diff --git a/arrow/locales.py b/arrow/locales.py
index b453f82..e546a6b 100644
--- a/arrow/locales.py
+++ b/arrow/locales.py
@@ -2867,6 +2867,8 @@ class CzechLocale(Locale):
         "hours": {"past": "{0} hodinami", "future": ["{0} hodiny", "{0} hodin"]},
         "day": {"past": "dnem", "future": "den", "zero": "{0} dnů"},
         "days": {"past": "{0} dny", "future": ["{0} dny", "{0} dnů"]},
+        "week": {"past": "týdnem", "future": "týden", "zero": "{0} týdnů"},
+        "weeks": {"past": "{0} týdny", "future": ["{0} týdny", "{0} týdnů"]},
         "month": {"past": "měsícem", "future": "měsíc", "zero": "{0} měsíců"},
         "months": {"past": "{0} měsíci", "future": ["{0} měsíce", "{0} měsíců"]},
         "year": {"past": "rokem", "future": "rok", "zero": "{0} let"},


Test patch:
diff --git a/tests/test_locales.py b/tests/test_locales.py
index 189fa6a..c775f89 100644
--- a/tests/test_locales.py
+++ b/tests/test_locales.py
@@ -361,6 +361,12 @@ class TestCzechLocale:
         assert self.locale._format_timeframe("hours", -5) == "5 hodinami"
         assert self.locale._format_timeframe("now", 0) == "Teď"
 
+        assert self.locale._format_timeframe("weeks", 2) == "2 týdny"
+        assert self.locale._format_timeframe("weeks", 5) == "5 týdnů"
+        assert self.locale._format_timeframe("week", 0) == "0 týdnů"
+        assert self.locale._format_timeframe("weeks", -2) == "2 týdny"
+        assert self.locale._format_timeframe("weeks", -5) == "5 týdny"
+
     def test_format_relative_now(self):
 
         result = self.locale._format_relative("Teď", "now", 0)