Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Fallback language #126

Open
thierrydrc opened this issue Apr 9, 2020 · 0 comments
Open

Fallback language #126

thierrydrc opened this issue Apr 9, 2020 · 0 comments

Comments

@thierrydrc
Copy link

thierrydrc commented Apr 9, 2020

Hello,

First : thank you very much for this package ! Everything is working correctly, easy way to implement :)

However I have a request, I didn't see anyone else asking for that so :
=> is it possible to implement fallback language ?

I'm using vue-i18n, like you told to :

const lang = document.documentElement.lang.substr(0, 2);
// or however you determine your current app locale

const i18n = new VueInternationalization({
    locale: lang,
    messages: Locale
});

I have 2 languages :

  • FR (main & fallback)
  • EN

If I didn't provide the translation in my resources/lang/en/messages.php, only the key is displayed.
Exemple : messages.menu.home

It would be very great if the package can diplay the key of the fallback language if it's not provided for the current application locale, in my case :
messages.menu.home in file resources/lang/fr/messages.php

Maybe with a configuration like this :

const lang = document.documentElement.lang.substr(0, 2);
const fallbackLang = 'fr'; 

const i18n = new VueInternationalization({
    locale: lang,
    fallback: fallbackLang,
    messages: Locale
});

Thank you !

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

No branches or pull requests

1 participant