Skip to content

How to use within a dom-repeat template #107

@CarbonCollins

Description

@CarbonCollins

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

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions