null values don't fallback [1.6.1pre] #90

Closed
Philmod opened this Issue Mar 25, 2013 · 10 comments

Comments

Projects
None yet
3 participants

Philmod commented Mar 25, 2013

Hi!

The null values of my french files don't fallback to the english version, but appear as empty strings.

Best,
Philippe

Contributor

gcko commented Mar 25, 2013

Would it be possible for you to provide a test case via http://jsfiddle.net/ ?

Contributor

gcko commented Mar 25, 2013

Please fork http://jsfiddle.net/tourque3000/FVDHS/ and try to reproduce the issue please.

Owner

jamuhl commented Mar 26, 2013

Actually this changed some time ago (think it was in 1.5.8). If a key exists, even if empty string or null value, it's taken as a valid result -> empty. Only non existent keys fallback.

If you really need the null value to fallback we need to introduce a new option?

Philmod commented Mar 26, 2013

Oh really?
We use a service of translation, and when new strings are created in English, the translations aren't instantaneous (and so the value is null), and I prefer to fall back in English rather then a empty string.
What do you think?

Owner

jamuhl commented Mar 26, 2013

i think we should add a option (eg. fallbackOnNull = true | false) for this. but will need to assure that the missing key is not send on null values.

but will need to look at this closer.

Philmod commented Mar 27, 2013

Yes, that'd be a good idea!

Do you have use cases where people don't want to fall back when null value?

On 26 March 2013 12:37, Jan Mühlemann notifications@github.com wrote:

i think we should add a option (eg. fallbackOnNull = true | false) for
this. but will need to assure that the missing key is not send on null
values.

but will need to look at this closer.


Reply to this email directly or view it on GitHubhttps://github.com/jamuhl/i18next/issues/90#issuecomment-15483439
.

Philippe Modard
415-722-1245
philippe.modard@gmail.com philippe.modard@modygo.com
twitter.com/philmod
re.vu/philippemodard
www.linkedin.com/in/philippemodard
IBAN BE70 0639 3284 8025 - BIC: GKCCBEBB

Owner

jamuhl commented Mar 27, 2013

yes...had a case. but i think the better default would be to fallback on null.

Owner

jamuhl commented Apr 18, 2013

sorry had a hard time the last weeks...will come to implement this next week.

Owner

jamuhl commented Apr 24, 2013

will be in next release - see commit 5df02c9

hope this work better for common need.

@jamuhl jamuhl closed this Apr 24, 2013

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