t2ym / i18n-element

I18N Base Element for Lit and Polymer
Other
9 stars 1 forks source link

[lit-html] Curly brackets {{text.}} are effective in templates #65

Open t2ym opened 5 years ago

t2ym commented 5 years ago

Root Cause

Notes

Examples

return html`${bind(this)}
  <i18n-format id="compound-format-text" class="text">
    <json-data>{
      "0": "No timezones",
      "1": "Only 1 timezone for {2} is shown.",
      "one": "{1} timezone other than {2} is shown.",
      "other": "{1} timezones other than {2} are shown."
    }</json-data>
    <i18n-number offset="1">${this.timezones.length}</i18n-number>
    <span>${'GMT' + (this.timezones[0] < 0 ? '' : '+') + (this.timezones[0] / 60)}</span>
  </i18n-format>
  <div>{{text.compound-format-text.0.0}}</div>
  <div>{{text.compound-format-text.0.1}}</div>
  <div>{{text.compound-format-text.0.one}}</div>
  <div>{{text.compound-format-text.0.other}}</div>
  <data-processor-element .data={{text.compound-format-text}}></data-processor-element>
`;