Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Example in README is non-i18n #35

Open
yarons opened this issue Oct 18, 2020 · 2 comments
Open

Example in README is non-i18n #35

yarons opened this issue Oct 18, 2020 · 2 comments

Comments

@yarons
Copy link

yarons commented Oct 18, 2020

Line 237:

this.context.ngettext('day ago', 'days ago', numberOfDays);

This is a bad example of i18n string because in Hebrew (and in several other languages) we don't use the same word order so unless there's a placeholder in there I can't translate it so that Hebrew native speaker will understand.

A better approach would be (assuming I'm not messing up the parameters):

this.context.ngettext('{numberOfDays} day ago', '{numberOfDays} days ago', numberOfDays);

Another solution can be changing the example :)

@eugene-manuilov
Copy link
Owner

Hi @yarons

thanks for reporting this, but the purpose of that example is not to teach you how to property internationalize your project. It just demonstrates how to use this library by showcasing its features.

If you still think it should be fixed and want to help, feel free to send a PR with the required changes and I'll accept it.

@yarons
Copy link
Author

yarons commented Oct 19, 2020

Hey @eugene-manuilov,
I understand yet I believe that an i18n oriented project should set a good example to its users 😄

How about adding the parameter? Or at least explaining this is not a good practice?
BTW did I add the parameter correctly? Because I can make a PR out of that.

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

No branches or pull requests

2 participants