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

fix: Relative times in Finnish locale #797

Merged
merged 2 commits into from
Feb 16, 2020
Merged

Conversation

ttsirkia
Copy link
Contributor

@ttsirkia ttsirkia commented Feb 15, 2020

This fixes problems in Finnish translation (#351) which are now possible to solve after merging #767. Also, the output is now the same as in Moment.js.

@codecov
Copy link

codecov bot commented Feb 15, 2020

Codecov Report

Merging #797 into dev will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #797   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          156       156           
  Lines         1111      1118    +7     
  Branches       205       207    +2     
=========================================
+ Hits          1111      1118    +7     

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 523c038...4b9ee07. Read the comment docs.

@ttsirkia ttsirkia changed the title Fix Finnish locale fix: Relative times in Finnish locale Feb 15, 2020

it('Finnish locale relative time in past and future', () => {
expect(dayjs().add(1, 'd').locale('fi').fromNow())
.toBe('päivän kuluttua')
Copy link
Owner

Choose a reason for hiding this comment

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

it will be great if you could add moment.js result in test like:

expect(dayjs().add(1, 'd').locale('fi').fromNow())
    .toBe('päivän kuluttua')
expect(dayjs().add(1, 'd').locale('fi').fromNow())
    .toBe(moment().add(1, 'd').locale('fi').fromNow())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are actually not equal because the original translation here uses word ”kuluttua” and Moment ”päästä”. They are synonyms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The word used here is actually better but should they be the same?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, please. Day.js trying to keep everything the same with moment.js at the present.

You can check other locales' test file as a reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There seems to be another difference, too. Dayjs tells "2 päivää sitten" and Moment "kaksi päivää sitten". So for some reason, Moment uses words for numbers less than ten. Should this be replicated as well? This seems to be specific for Finnish locale although using integers would be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This difference has already been present here when the original Finnish translation is merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed these.

@ttsirkia ttsirkia requested a review from iamkun February 16, 2020 11:21
Copy link
Owner

@iamkun iamkun left a comment

Choose a reason for hiding this comment

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

cool, thanks

@iamkun iamkun merged commit 4a470fb into iamkun:dev Feb 16, 2020
iamkun pushed a commit that referenced this pull request Feb 26, 2020
## [1.8.21](v1.8.20...v1.8.21) (2020-02-26)

### Bug Fixes

* Set + Get accept 'D' as the short version of 'date' ([#795](#795)) ([523c038](523c038))
* Update DayOfYear plugin type ([#799](#799)) ([5809652](5809652))
* Update fi (Finnish) locale relativeTime ([#797](#797)) ([4a470fb](4a470fb))
@iamkun
Copy link
Owner

iamkun commented Feb 26, 2020

🎉 This PR is included in version 1.8.21 🎉

The release is available on:

Your semantic-release bot 📦🚀

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.21](iamkun/dayjs@v1.8.20...v1.8.21) (2020-02-26)

### Bug Fixes

* Set + Get accept 'D' as the short version of 'date' ([#795](iamkun/dayjs#795)) ([523c038](iamkun/dayjs@523c038))
* Update DayOfYear plugin type ([#799](iamkun/dayjs#799)) ([5809652](iamkun/dayjs@5809652))
* Update fi (Finnish) locale relativeTime ([#797](iamkun/dayjs#797)) ([4a470fb](iamkun/dayjs@4a470fb))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.21](iamkun/dayjs@v1.8.20...v1.8.21) (2020-02-26)

### Bug Fixes

* Set + Get accept 'D' as the short version of 'date' ([#795](iamkun/dayjs#795)) ([523c038](iamkun/dayjs@523c038))
* Update DayOfYear plugin type ([#799](iamkun/dayjs#799)) ([5809652](iamkun/dayjs@5809652))
* Update fi (Finnish) locale relativeTime ([#797](iamkun/dayjs#797)) ([4a470fb](iamkun/dayjs@4a470fb))
splashwizard pushed a commit to splashwizard/tracking-time that referenced this pull request Oct 21, 2024
## [1.8.21](iamkun/dayjs@v1.8.20...v1.8.21) (2020-02-26)

### Bug Fixes

* Set + Get accept 'D' as the short version of 'date' ([#795](iamkun/dayjs#795)) ([523c038](iamkun/dayjs@523c038))
* Update DayOfYear plugin type ([#799](iamkun/dayjs#799)) ([5809652](iamkun/dayjs@5809652))
* Update fi (Finnish) locale relativeTime ([#797](iamkun/dayjs#797)) ([4a470fb](iamkun/dayjs@4a470fb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants