Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Support fallback language when using tokens #13

Open
sorahn opened this issue Feb 1, 2016 · 2 comments
Open

Support fallback language when using tokens #13

sorahn opened this issue Feb 1, 2016 · 2 comments

Comments

@sorahn
Copy link

sorahn commented Feb 1, 2016

We have some fairly long strings on our site, so we were going to opt for using tokens like this __("my_string_key"), the json like this:

// en.json
{
  "my_string_key": "English String"
}

// de.json
{
  "my_string_key": "Deutsche Zeichenfolge"
}

However, I was wondering if its still possible to have the this plugin set up a default.

Currently if you use languages = {en: null, de} this works by assuming that the english strings are in the code, and it falls back to using that. We would be looking for a way to specify what language to display if the german strings are missing.

Thanks.

@102
Copy link

102 commented Sep 13, 2016

@sorahn have you managed to find the answer?

@sorahn
Copy link
Author

sorahn commented Sep 13, 2016

@102 Not in webpack. We ended up using http://i18next.com/ which gave us full control over how we get updates, and which languages are baked in and what order of fallbacks they go through

@michael-ciniawsky michael-ciniawsky changed the title Allow a fallback language if using tokens. support fallback language when using tokens Apr 14, 2017
@michael-ciniawsky michael-ciniawsky changed the title support fallback language when using tokens Support fallback language when using tokens Apr 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants