question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for fallback language

See original GitHub issue

I wasn’t able to find this is the docs or on the internet. Is there a way to have the translation fallback to the standard language if it can’t find a dialect?

I.E

I have a en.json file. When I retrieve the locale, I’d like to set it and have it fall back to the language if it can’t find the dialect.

en-US & en-GB & en-UK should fall back to en.json if the file doesn’t exist. fr-CA should fallback to fr.json and then whatever I specified as default if it doesn’t find fr.json

Is this how the library works, and if not how can I get it to function this way?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:9

github_iconTop GitHub Comments

5reactions
andys8commented, Mar 16, 2018

I’d expect the same behavior to be provided. It seems it isn’t available.

@SamFarrington This won’t fall back to the specific language. Think about en-US and de-AT.

0reactions
NuxXDevcommented, Aug 18, 2022

Thanks, that is almost exactly what I ended up doing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fallback languages – Support Help Center - Optimizely
Set fallback and replacement languages. Fallback and replacement languages are defined from the All Properties edit view, when editing a page or ...
Read more >
Fallbacks - Federal Reserve Bank of New York
The ARRC released updated recommended contractual fallback language for USD LIBOR denominated syndicated loans. The hardwired fallback language was updated to ...
Read more >
Glossary Fallback Language - Smartling Help Center
A Fallback Language is essentially the source language of an old Glossary that is not a source language of any assigned Linguistic Package...
Read more >
[Language Fallback] Support - WordPress.org
Support » Plugin: Language Fallback ... Plugin doesn't fall back to language ... get_language_attributes() returns the fallback language's locale.
Read more >
Fallback languages - LingoHub
A fallback language is a language that will be used when a text segment is empty upon export, e.g., due to a missing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found