How can I manage to use a behavior (Polymer.AppLocalizeBehavior) inside a nested template: the created scope hides the localize() function.
<template>
...
<div class="content">
<div class="card-container">
{{localize('greeting')}} <---- OK!
<div class="layout horizontal wrap">
<template is="dom-repeat" items="{{employees}}">
<paper-card>
<div class="card-content">
<h2>{{localize('greeting')}}</h2> <---- EMPTY....
Example appreciated.
Thanks
--nick
EDIT 2016 May, 05
A small project showing the issue is available here: https://github.com/nocquidant/polymer-intl/
Instructions are in README.md
UPDATE (6/4/16): The
<app-localize-behavior>
bug was caused by a Polymer core bug, which is now fixed in Polymer 1.5.0 (jsfiddle).UPDATE (5/20/16): This appears to be a bug in Polymer 1.4.0, as demonstrated in this jsfiddle. My demo from above had worked because I was using Polymer's latest code from master. (Note there are several commits since the
v1.4.0
tag.)As a workaround, use Bower to install a working commit of Polymer (as of 20-May-2016, the master branch is at commit
409ad83
, which works properly with<app-localize-behavior>
):Bower will prompt you to select a specific Polymer version, in which case you should enter
!1
.I didn't have any trouble using
localize('greeting')
inside a template repeater. Can you post a jsfiddle of your code?Here's a working snippet (based on
<app-localize-behavior> demo
):