Following the ideas of José A. and Jean-Remy, here is an example code for copy / paste:
<link rel="import" href="../bower_components/polymer/polymer.html"> <link rel="import" href="../bower_components/app-localize-behavior/app-localize-behavior.html"> <script> MyLocalizeBehaviorImpl = { properties: { language: { value: 'de' } }, attached: function() { this.loadResources(this.resolveUrl('locales.json')); } }; MyLocalizeBehavior = [MyLocalizeBehaviorImpl, Polymer.AppLocalizeBehavior]; </script>
Include a behavior file in all of your custom components and add behavior:
<link rel="import" href="./my-localize-behavior.html"> ...... behaviors: [ MyLocalizeBehavior ],
source share