lundi 3 décembre 2018

Ember i18n Dynamic Text for a tag

I'm currently translating an application using ember's i18n library.

With the use of a placeholder, I'm able to translate text for a tag, nevertheless, I'm are only able to pass the tag to the placeholder if the text given is a string.

The tags we are using are normal i18n tags:

example_tag : 'ejemplo'

The method we have for the placeholder we have right now looks like this:

TranslationsPlaceHolder: (->{ 
    return Ember.I18n.t('example_tag');
})

and the way we call it is like this:



I'm currently looking for a way we can assign different tags with the use of one placeholder with dynamic tags, so we could pass the tag we want to translate as a parameter and only use one placeholder with different tags.

We are using reference from this question: Inserting a translation into a placeholder with Emblem.js

Thanks a lot!




Aucun commentaire:

Enregistrer un commentaire