rmariuzzo/Lang.js

Fallback is not working

Closed this issue · 2 comments

Take Your own example

var lang = new Lang({
    messages: {
        'en.greetings': {
            'hi': 'Hi',
            'hello': 'Hello'
        },
        'it.greetings': {
            'hi': 'Salve'
        }
    }
});

lang.setLocale('it');
lang.get('greetings.hello');
// > "greetings.hello"

lang.setFallback('en');
lang.get('greetings.hello');
// > "greetings.hello" instead of "Hello"

Wil check in a couple of mins...

On Nov 15, 2016 5:00 AM, "Jānis Šakars" notifications@github.com wrote:

Take Your own example https://github.com/rmariuzzo/Lang.js#setfallback

var lang = new Lang({
messages: {
'en.greetings': {
'hi': 'Hi',
'hello': 'Hello'
},
'it.greetings': {
'hi': 'Salve'
}
}
});

lang.setLocale('it');
lang.get('greetings.hello');
// > "greetings.hello"

lang.setFallback('en');
lang.get('greetings.hello');
// > "greetings.hello" instead of "Hello"


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#39, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAa2H_An5HcxUKYMj4-RvqVw-uYA66yyks5q-XTIgaJpZM4KyRxu
.

@werdlv thanks for your time on filing this issue. The fix was including in the last release: https://github.com/rmariuzzo/Lang.js/releases/tag/v1.1.5

👍