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

Improve translation flexibility #876

Closed
Arkkimaagi opened this issue Apr 25, 2017 · 3 comments
Closed

Improve translation flexibility #876

Arkkimaagi opened this issue Apr 25, 2017 · 3 comments

Comments

@Arkkimaagi
Copy link
Contributor

String joining can get us only so far regarding translations. In some cases it would be easier to reorder words with the translation strings.

I'd suggest that we'd add support for something like string literals that are coming in future version of js.

For example calendar could support Finnish way of saying the RUNNING a bit better
en.js:

	"RUNNING": "Ends in {timeUntilEnd}",

fi.js:

	"RUNNING": "Päättyy {timeUntilEnd} päästä",

Notice the {timeUntilEnd} variable there? That will be replaced with the variable during translation.

This would be rendered in Finnish as:

Päättyy viiden minuutin päästä

Where moment.js returns viiden minuutin as we have five minutes left.

Here is a screenshot from my mirror (where I have dropped the capitalization with css):
image

Of course we'd want to keep the translator backwards compatible, we'd want also this to work just as it does now so that all the current implementations do not break:

	"RUNNING": "Ends in",

It should fallback to current approach resulting

Ends in five minutes

I have a working sample of this thing with an example for this calendar thing only, but support could be built for all translations in future to combat rigid string joining problems.

@Arkkimaagi
Copy link
Contributor Author

Seems that this has been merged into develop, maybe this issue can be closed? Or do you close these only when merged into master?

@roramirez
Copy link
Contributor

Hi @Arkkimaagi you should be close this issue.

@Arkkimaagi
Copy link
Contributor Author

Closing the issue as it was merged.

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

No branches or pull requests

2 participants