Vue-i18n: MissingHandler

Created on 20 Feb 2018  路  5Comments  路  Source: kazupon/vue-i18n

Hi,
is there a suitable reason why the returning value of MissingHandler is ignored in the _warnDefault-function and not returned?

For example we have a array with system data merged with user data. The system data is defined in the code/DB and the user data were created by the user. The translation of the system data is stored in a subarray of all translations. So we have to use a key path to translate the messages. e.q.:

types = [system messages + user messages]
for type in types
   <p>$t('event.types.' + type)</p>

The translation of the user data (no translations available) are causing the expected warning and the translator is printing the key path like event.types.testType out. Now it were be nice to transform the key or do other cool stuff... which can handle the MissingHandler.

Most helpful comment

implemented with https://github.com/kazupon/vue-i18n/pull/256
please wait next version releasing.

All 5 comments

+1

IMO, the MissingHandler should be able to return the value that should be used as a translation. Currently the missing config option cannot be used to solve the situation when the translation is missing for whatever reason.

+1
i need in default fixed key in object

I too want that MissingHandler can be used to return the missing translation.

implemented with https://github.com/kazupon/vue-i18n/pull/256
please wait next version releasing.

thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abou7mied picture abou7mied  路  3Comments

tvld picture tvld  路  4Comments

shaunnetherby picture shaunnetherby  路  5Comments

sergot picture sergot  路  5Comments

dunz picture dunz  路  5Comments