app-localize-behavior icon indicating copy to clipboard operation
app-localize-behavior copied to clipboard

How to use within a dom-repeat template

Open CarbonCollins opened this issue 8 years ago • 0 comments

Description

Hi all,

not sure if this is meant to work or not but when I attempt to use the localize function within a dom-repeat template where the item object contains the key for the translation, as opposed to it being hard coded, the translation is not reflected on the screen and instead returns an empty sring

Expected outcome

The text next to the iron icon should be the translated string from locales.json (see example below)

Actual outcome

empty string is displayed next to iron icon (see example below)

Steps to reproduce

        <paper-listbox attr-for-selected="data-label" selected="[[page]]" fallback-selection="dash" selected-attribute="selected">
          <template is="dom-repeat" items="[[pages]]">
            <paper-icon-item data-label="[[item.page]]" role="option" on-tap="_handleMenuTap">
              <iron-icon icon="[[item.icon]]" slot="item-icon"></iron-icon>
              [[localize(item.name)]]
            </paper-icon-item>
          </template>
        </paper-listbox>

where item.name contains a valid key name within the locals.json file

Browsers Affected

  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] Safari 7
  • [ ] Edge
  • [ ] IE 11
  • [ ] IE 10

CarbonCollins avatar Aug 23 '17 13:08 CarbonCollins