1

I have implemented l20n localization. l20n file:

<form {
    title: "Some text"
}>

in html i want to get SOme Text using

<p data-l10n-id="form.title"></p> 

But i've got just form.title instead real value. also I am getting right strings instead one level vars.

4

1 回答 1

1

My understanding of l20n is that you can't do it that way. You have to define an entity for your p. If you want to reuse another entity to avoid duplication*, you can do it that way:

<title "some text>
<form title:"{{title}}">
<p "{{title}}">

And your html like this:

<form data-l10n-id='form'>
  <p data-l10n-id='p'></p>
</form>

Duplication is actually okay in localization context, as explained in this anwser.

于 2015-10-28T14:30:07.297 回答