martinandert / react-translate-component

A component for React that utilizes the Counterpart module to provide multi-lingual/localized text content.
MIT License
322 stars 31 forks source link

a default message when the translator is not defined #43

Open AliMohammad93 opened 4 years ago

AliMohammad93 commented 4 years ago

Hello, how can I set a default message instead of "missing translation" ?

martinandert commented 4 years ago

You can use counterpart.setMissingEntryGenerator(fn). By default, fn is set to function(key) { return 'missing translation: ' + key; }.

See also: https://github.com/martinandert/counterpart#dealing-with-missing-translations