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

Support for defaultLocale #28

Closed
mihaerzen opened this issue Apr 25, 2017 · 7 comments
Closed

Support for defaultLocale #28

mihaerzen opened this issue Apr 25, 2017 · 7 comments

Comments

@mihaerzen
Copy link

Is there a way to set defaultLocale which would basically default to a certain language if translation is not found?

For eg. we have all translations for en but missing some for de. In this case we would set defaultLocale to en and make sure that user with locale de does not see empty text but rather en translations.

Thank you for the response.

p.s.: As seen in https://www.npmjs.com/package/i18n

@francescarpi
Copy link
Member

Hi Miha,
currently, if you have the next translation:

context.t('Hello world')

...and not exist in DE, the default output is in English version. But I understand that if you have this:

context.t('__hello_world__')

You would like that default translated output to be "Hello world" and not "hello_word".

Ok, I'm going to work for add "defaultLocale" configuration's parameter.

Best regards.

@mihaerzen
Copy link
Author

But what if I want it the other way around? Scenario would be:

Given app has 100% of German translations and 80% of English translations
And user has language set to English
And defaultLocale for i18n is set to German
When user openes the app
Then user will see 80% of English text
And 20% of German text

Meaning option to change defaultLocale. I can provide example to explain better if necessary.

@mihaerzen
Copy link
Author

Also what you wrote is correct yes.

@francescarpi
Copy link
Member

Hi Miha,
sorry for not say anything before. I've have a lot of work and I'll try to do as soon as possible.

To be patient :)

@mihaerzen
Copy link
Author

Hey no worries. Plese write if you need help, I'm happy to contribute.

@francescarpi
Copy link
Member

Hi,
done in master branch. I'll build a new tag in next days.
Best regards.

@francescarpi
Copy link
Member

Hi,
I've created a new tag ;)

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

No branches or pull requests

2 participants