-
Notifications
You must be signed in to change notification settings - Fork 183
Accessing translations from missing-message util #322
Comments
Interesting. The current signature is function missingMessage(locale, key, data) We could add I18n to that: function missingMessage(locale, key, data, i18n) |
It would be great because with that change I could send a notification for the missing translation but also display the english version (english is my fallback). |
I suppose it could alternatively be called on the I18n service, so you could do function missingMessage(locale, key, data) {
return this.t('missing-translation', { key: key, locale: 'en' });
} I'm not sure that's as obvious, though. |
@jamesarosen I didn't understand your last message. Are you saying that I can already do what I need? Let me make an example of my needs. I've two language files English file contains:
Italian file contains:
When the user visit my application, I don't wan't to show him a Any suggestion on how can do that? |
I was discussing alternative implementation ideas, not suggesting it was already possible. Would you be willing and able to make a PR to add |
@jamesarosen yes, this is what I had in mind. |
btw, even with this fix, what would be the best way to implement a default locale? |
See #256 for a discussion of falling back to a default locale. |
It would be nice if we could access the I18n service from utils/i18n/missing-message.js
This way we could implement a default fallback language for example..
The text was updated successfully, but these errors were encountered: