Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use within a dom-repeat template #107

Open
1 of 8 tasks
CarbonCollins opened this issue Aug 23, 2017 · 0 comments
Open
1 of 8 tasks

How to use within a dom-repeat template #107

CarbonCollins opened this issue Aug 23, 2017 · 0 comments

Comments

@CarbonCollins
Copy link

CarbonCollins commented Aug 23, 2017

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant