Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TurkishLocale #982

Merged
merged 5 commits into from
May 31, 2021
Merged

Update TurkishLocale #982

merged 5 commits into from
May 31, 2021

Conversation

beucismis
Copy link
Contributor

@beucismis beucismis commented May 29, 2021

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

  • 🧪 Added tests for changed code.
  • 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • 🧹 All linting checks pass when run locally (run tox -e lint or make lint to find out!).
  • 📚 Updated documentation for changed code.
  • ⏩ Code is up-to-date with the master branch.

If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!

Description of Changes

Update TurkishLocale class. Added and_word, week, weeks and meridians.
Edit: Add TestTurkishLocale class in tests/test_test_locales.py.

@beucismis
Copy link
Contributor Author

If you give me some time I can add the TestTurkishLocale class. What other test class can I get a template from?

@krisfremen
Copy link
Member

If you give me some time I can add the TestTurkishLocale class. What other test class can I get a template from?

Sure, take your time.

Take a look at the Macedonian or Tagalog locale for a more comprehensive test suite.

Cheers

@beucismis
Copy link
Contributor Author

Cheers, thank you. I added TestTurkishLocale class.

@beucismis
Copy link
Contributor Author

Hi, Some localizations have problems. I am trying to understand.
For example, "week" is output instead of "1 week".

@anishnya
Copy link
Member

anishnya commented May 31, 2021

Hi, Some localizations have problems. I am trying to understand.
For example, "week" is output instead of "1 week".

@beucismis could you provide the list of locales where you've noticed this? Typically, we would like humanize to represent the time difference of 1 week as "a week", not "week" across locales (same applies to the units 1 second, 1 month etc ). I'm not too sure if this possible to achieve in certain locales, but the goal is to be as close as possible to a rough translation of "a week".

From experience with dehumanize, there are some locales that need work on this issue. @krisfremen @jadchaar, we might want to open this up to be a separate issue and have an open list of locales with issues.

@krisfremen
Copy link
Member

@anishnya agreed, we should open up issues and tackle them separately

@beucismis
Copy link
Contributor Author

@beucismis could you provide the list of locales where you've noticed this?

>>> past = arrow.utcnow().shift(weeks=-1)
>>> past.humanize(locale="tr")
'hafta önce'

False. It should be "1 hafta önce" or "bir hafta önce". The English translation of "hafta önce" is "week ago".

arrow/locales.py Outdated
@@ -2311,12 +2312,16 @@ class TurkishLocale(Locale):
"hours": "{0} saat",
"day": "bir gün",
"days": "{0} gün",
"week": "hafta",
Copy link
Contributor Author

@beucismis beucismis May 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I write "bir hafta" instead of "hafta"?

"hafta": "week"
"bir hafta": "a week"

Copy link
Member

@anishnya anishnya May 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bir hafta" would be what we want.

@beucismis
Copy link
Contributor Author

Test results successful.

@codecov
Copy link

codecov bot commented May 31, 2021

Codecov Report

Merging #982 (29c1e54) into master (119bb67) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #982   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2054      2056    +2     
  Branches       330       330           
=========================================
+ Hits          2054      2056    +2     
Impacted Files Coverage Δ
arrow/locales.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 119bb67...29c1e54. Read the comment docs.

@anishnya
Copy link
Member

Hey @beucismis. There are some extremely minor linting errors that need to be fixed. It is mainly just an issue with some of the longer assert statements within the test cases. See the output on the linter checks for more specifics. Other than that, everything else looks good to pull in. Let us know if you have any further questions, and we appreciate your contribution!

@anishnya anishnya self-requested a review May 31, 2021 22:50
@anishnya anishnya merged commit 3606a80 into arrow-py:master May 31, 2021
@anishnya
Copy link
Member

Thanks for the contribution @beucismis!

@beucismis
Copy link
Contributor Author

@anishnya thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants