mautilus / sdk

MAUTILUS SmartTV SDK
BSD 3-Clause "New" or "Revised" License
99 stars 43 forks source link

how to read labels from i18n folder #14

Closed vnaira closed 8 years ago

vnaira commented 8 years ago

Hi, please answer me how can I read labels from i18n, on different languages.

thanks

radimbuchtela commented 8 years ago

Hi, please see documentation: http://smarttv.mautilus.com/SDK/#!/guide/i18n

You can use these two folowing ways:

I18n.locale = 'EN';
console.log(I18n.translate('welcome')); // prints Welcome
// console.log(__('welcome')); // prints also Welcome

I18n.locale = 'DE';
console.log(I18n.translate('welcome')); // prints Willkommen
//console.log(__('welcome')); // prints also Willkommen

or this second way. This is more recomended:

I18n.changeLanguage('DE');   // it changes language and triggers event "langchange", which is captured by scenes and snippets
console.log(I18n.translate('welcome')); // prints Willkommen
// console.log(__('welcome')); // prints also Willkommen
stenlik commented 8 years ago

Hi vnaira,

Did the answer help you? If yes please close the issue.

Thanks Mautilus SmartTV SDK Team