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

[locale] Relative seconds i18n #4183

Merged
merged 113 commits into from
Dec 17, 2017
Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Sep 21, 2017

Closes #3860 as is included in this PR.

It was not a small PR at first glance but every changes on i18n was limited to 1 locale per commit so it can makes review easier.

Most translation of ss is referenced from Unicode CLDR duration-second property, the other CLDR-missing locales are translated by searching 30 seconds on Google pages.

It is recommended to squash merging for better commit history readability.

fixes #3981

@jsf-clabot
Copy link

jsf-clabot commented Sep 21, 2017

CLA assistant check
All committers have signed the CLA.

@ichernev
Copy link
Contributor

@JLHwung oh wow, this is massive. We'll get this in.

@@ -32,6 +32,7 @@ export default moment.defineLocale('fr-ca', {
future : 'dans %s',
past : 'il y a %s',
s : 'quelques secondes',

Choose a reason for hiding this comment

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

To be consistent, the s should be une minute (and apply to the other strings as well)

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 duration-second in Unicode CLDR 32.0 (link) is {0} à la seconde.

@yanickrochon Would both s and ss be une minute in fr-ca?

Choose a reason for hiding this comment

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

No, because this is an acceleration unit, and the "duration-second"'s {0} parameter is a prefix, not a numeric value. Much as "100 miles per gallon" is, where the localization string "duration-second" would be "{0} per gallon", and the prefix is "100 miles".

E.g. "{0} à la second" (i.e. "{0} per second") translates to "0 mètre à la seconde" or "2 mètres à la seconde" (notice the plural for the last one vs singlar for the first.

In French, the 0 is always singular, unlike in English.(see plurals and ordinals for languages)

If you want to cover the proper internationalization for an interval of [0..1.999*] seconds, the proper string "s" would be "une seconde", and "ss" would be "%d secondes".

(Note: in French, we usually use "à l'instant", meaning "just now", when the event happened less than a few seconds ago. But this would be invariant. Just like "now", you cannot say "now ago", neither "il y a à l'instant". Thus, "s" would technically need to be invariant for certain langauges.)

Copy link

@yanickrochon yanickrochon Dec 1, 2017

Choose a reason for hiding this comment

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

I just realized that I wrote a typo in my first comment, I wrote "minute" instead of "seconde". Sorry for the confusion.

@marwahaha marwahaha changed the title Relative seconds i18n [locale] Relative seconds i18n Dec 11, 2017
@marwahaha marwahaha merged commit 4d0340c into moment:develop Dec 17, 2017
marwahaha pushed a commit that referenced this pull request Dec 17, 2017
* locales ru, uk: added relative seconds

* feat(i18n): add relativeSeconds for zh-*

* feat(i18n): add relativeSeconds for en-*

* af

* ar

* az

* be

* add relativeSeconds for th

* add relativeSeconds for vi

* ar-dz

* change style

* bg

* bm

* bn

* add relativeSeconds for fr-*

* add relativeSeconds for de-*

* add relativeSeconds for es-*

* ja

* ms

* nl

* pt

* jv

* it

* ca

* cv

* cy

* da

* el

* eo

* eu

* lo

* my

* ta

* fix lo

* si

* sv

* fy

* gl

* gu

* hr

* hu

* id

* pl

* bs

* remove executable mode on pl.js

* fi

* lb

* lt

* lv

* me

* mi

* mk

* ml

* mr

* nb

* pa-in

* uz-latn

* te tet tl-ph tlh tr tzl tzm tzm-latn ur uz x-pseudo yo

* fix tzm

* et

* fa

* fo

* gd

* sd se si sk sl sq sr sr-cyrl ss sw

* mr ms-my ne nn

* kk km kn ky

* fix ro

* fix tlh

* fix tzl

* fix tlh ro

* gom-latn

* he

* is

* fix pl

* fix sw sr-cyrl sr

* fix nn

* fix sl

* fix sk

* hy-am

* hi

* gom-latn

* et

* fix sr

* dv

* fix sk

* ar-ly

* bo

* cs

* bs

* ar-kw

* ar-ma

* ar-tn

* ar-sa

* fix ar-dz

* br

* fix ka

* fix tl-ph

* fix az from CLDR

* fix bm from CLDR

* fix bs from CLDR

* fix cs from CLDR

* fix fo from CLDR

* fix gu from CLDR

* fix hr from CLDR

* fix ka from CLDR

* fix km from CLDR

* fix my from CLDR

* fix ne from CLDR

* fix sk from CLDR

* fix sr-cyrl from CLDR

* fix sr from CLDR

* fix te from CLDR

* fix style
@JLHwung JLHwung deleted the relative-seconds-i18n branch December 17, 2017 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No localization for relative seconds
8 participants