{"_id":"i18n-behavior","_rev":"107-eea74c7de4a6488e2cc90878dc5a8600","name":"i18n-behavior","description":"Instant and Modular I18N engine for lit-html and Polymer","dist-tags":{"latest":"5.0.0","next":"4.0.0"},"versions":{"0.0.28":{"name":"i18n-behavior","version":"0.0.28","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.13","gulp-i18n-preprocess":"^0.0.19","gulp-if":"^2.0.0","gulp-size":"^2.0.0","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"9bec9f36bbe2a8f49835a16ebaf47c249e08067d","_id":"i18n-behavior@0.0.28","_shasum":"ee2201ef0672c4bc80bc19abd4ad38d0b912296d","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"ee2201ef0672c4bc80bc19abd4ad38d0b912296d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.28.tgz","integrity":"sha512-NWsXGHWP/m0XJ1dWkBjEDHTbYnCNdUaTfoLnmPc+7nQzt7iQ5+oomD7MMgHiyVh7z8/x7qUByp9CC4gPQd3QXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz9TNUAM2NhaLSMUJuU0jLYcFyE9qPZEg1G2zsqWnGJQIhAIAppjcUA/2uoFLBw0pFGDhOzMY9X4qmsyNXWoy4052R"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.28.tgz_1456067277434_0.542953121708706"}},"0.0.29":{"name":"i18n-behavior","version":"0.0.29","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.13","gulp-i18n-preprocess":"^0.0.19","gulp-if":"^2.0.0","gulp-size":"^2.0.0","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"568dce48868f4858c299f785c2f935d32efae50b","_id":"i18n-behavior@0.0.29","_shasum":"e592b0df8f73d59aa2d2f12e8c8f102acb23b873","_from":".","_npmVersion":"3.5.0","_nodeVersion":"0.12.5","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"e592b0df8f73d59aa2d2f12e8c8f102acb23b873","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.29.tgz","integrity":"sha512-chCju9YRWWfjtyJBZ4aFeeaqnVXywn1GBSAc222jgYUNvTPZjwe7ZXBfo6yzCAnbF8zMvMmxvft9/IA5q8fxTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCV9ClS9pEGMTacdxU6cPtS+Hg0Df4KO6nFtpmtsGKMVwIhANQO8b1VbvRyjXTvi9m2V9YDDbHsKfuPASyd1/WjYxme"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.29.tgz_1456112318958_0.28642626013606787"}},"0.0.30":{"name":"i18n-behavior","version":"0.0.30","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.13","gulp-i18n-preprocess":"^0.0.19","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"9af9f27135805d6acf02a866ee2de0dffe17315c","_id":"i18n-behavior@0.0.30","_shasum":"06c9fd27e77eec548fd3d7ad44f50461dcb72c64","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"06c9fd27e77eec548fd3d7ad44f50461dcb72c64","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.30.tgz","integrity":"sha512-uLC9uhZ735Cn0nbGVis+h5WSVu4g+KHp0SEYsejBxmMpFKBAgnX2KurUa/GFpGMxTadB0oNW5JGOZWsb3Yvkxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfrKglCePvAgV6dQtBbVjzwe9RXFoKdhh0LPbfExSdZAiBDDWU+C6F0KpdQPlv691glFznX/LaOs0ToNzMO6sjZYg=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.30.tgz_1456193154801_0.6408616958651692"}},"0.0.31":{"name":"i18n-behavior","version":"0.0.31","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.13","gulp-i18n-preprocess":"^0.0.19","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"295fc23a90430154f5b9dbfb58b2fc86ae862c41","_id":"i18n-behavior@0.0.31","_shasum":"59d8c1fbd7a08da5e054280ecabb926cc162118c","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"59d8c1fbd7a08da5e054280ecabb926cc162118c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.31.tgz","integrity":"sha512-41p2CeZo+YS1nK8niknIhKPk3AtbUL6Q9mzc+4PtldM8YfWmv9nGWMTEvsPla4xZwYU+/DSAFx7hb7uzioxGqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/YhoM152m+n8pzcbuS/tqHT1rCJJUxSJwaqOp6075uAiEA0ThZw+t4zv/6Ug4kEZbuCiheLuTmbDwvHNfu7L910JY="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.31.tgz_1456193491497_0.49255747138522565"}},"0.0.34":{"name":"i18n-behavior","version":"0.0.34","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.13","gulp-i18n-preprocess":"^0.0.19","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"b056ed15e16a2654e8a32d701ac6f6b50c915a9e","_id":"i18n-behavior@0.0.34","_shasum":"0a16414eea27430b209f1f8c030c9de42a4e440d","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"0a16414eea27430b209f1f8c030c9de42a4e440d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.34.tgz","integrity":"sha512-OwWHxMofDVZBjCsQ/+j8hLTD/qkDzNqWcWoJDXcQi7r1mRrh1qJB6veTFBxg/pS5BiOcU59ptKXe/Pan4w8+oQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvJhRQnBjAS2H93LOtUbQfND8DTLnYxuO5BmvPH52AAAIgcY5Py3i/h1JunnBaTnv+7g/AIR658FSjhNuGhUQSXWQ="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.34.tgz_1456238065973_0.3761309892870486"}},"0.0.36":{"name":"i18n-behavior","version":"0.0.36","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.13","gulp-i18n-preprocess":"^0.0.19","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"3f0f46a7200a9feb5c1aa8538422c3644209dd50","_id":"i18n-behavior@0.0.36","_shasum":"e7ab97e02b1ad802bc214acafeb8a177a90b575f","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"e7ab97e02b1ad802bc214acafeb8a177a90b575f","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.36.tgz","integrity":"sha512-1sgJb6+qWkK/K0xMC7SxzYvs2pPAw8B8y6e9F34TAAxJfvoSHiyxIwcP3Ql6W9se8Pc2TQQkmtV26UuNNSOz2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQ6d+fnv8jOD21p1SHgATWJQYNjutaAp+MiuAETWO0SAiEAsC3ucfpSpsFgbE08Urua4Gx8NhfGJKu1wq5p8TpAIZM="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.36.tgz_1456736747754_0.8144162253011018"}},"0.0.37":{"name":"i18n-behavior","version":"0.0.37","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.16","gulp-i18n-preprocess":"^0.0.22","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"f3c95d4b5032076ea3d8402f927a48518b3ffe82","_id":"i18n-behavior@0.0.37","_shasum":"9a2b4019e4b8c7728f76866554cff62eaaa2a879","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"9a2b4019e4b8c7728f76866554cff62eaaa2a879","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.37.tgz","integrity":"sha512-FCCj8dOPesSBDNoaxk/YAa8nDuM29nWUaARnpJ+vwH1jwpCMmyk1GmA3zyhOhj/ok53EVypIdKW7jC/0ww/OvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfcKHnkcMhyu4ionv85HSlUCKlZeu8TeIVC6c7lr/XeAiBricoeyvm+lj2ZT4mNfOV4z5cLhkkREKR6FRDb/A376w=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.37.tgz_1456799940148_0.7564878917764872"}},"0.0.41":{"name":"i18n-behavior","version":"0.0.41","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.16","gulp-i18n-preprocess":"^0.0.22","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"90e524ffb61c9c887be3c97cf5edea89a185fd70","_id":"i18n-behavior@0.0.41","_shasum":"08eaef8abe44f7327dc532bc14cd0a262b6372c3","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"08eaef8abe44f7327dc532bc14cd0a262b6372c3","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.41.tgz","integrity":"sha512-Y8p4d+6u7uYrw2mugWySfT8/1iDjh22M82OBgSP7KknPeSztdt5lGVlEiyumbI3XzCQfDQ6frGu+o73EXYEONg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaSYa3FTVUcULRYYT2OaZPWkWsVdhgTOWHrzayHSSQcwIhAInJRKQ3BBwRNw0+Pb83T/Oyk2LsqBClH+/AVDa/F4aG"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.41.tgz_1457079303779_0.9067303554620594"}},"0.0.43":{"name":"i18n-behavior","version":"0.0.43","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.18","gulp-i18n-preprocess":"^0.0.24","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"48c0a6413e8f5eae1e1bd1e7a17e40cf320661ec","_id":"i18n-behavior@0.0.43","_shasum":"ac6380bd757247aa1fea2aead9e09c735643a28a","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"ac6380bd757247aa1fea2aead9e09c735643a28a","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.43.tgz","integrity":"sha512-soF/uRRWqmgBv+x25vaHcsI4VwtrCBsKDvyeE7iM0kVSBT5JeGTiKq55AEO3teeTI+jK6hzXisGimIvkcxJWGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDDlbxmzbtrGaeENXnw5jfGdJg/CHvZk+L0mKZeTMMAGAiAjtGLhK5040Klf12J2wSiZ26qoTj+fPyzObvCn13Gh5A=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.43.tgz_1457180564657_0.3397823416162282"}},"0.0.44":{"name":"i18n-behavior","version":"0.0.44","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.18","gulp-i18n-preprocess":"^0.0.24","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"71ef4c861330be28618fb6b96ac50b4233ec724a","_id":"i18n-behavior@0.0.44","_shasum":"9586e0f3a276c9c7c98c42b5a21925990943f74d","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"9586e0f3a276c9c7c98c42b5a21925990943f74d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.44.tgz","integrity":"sha512-dsI3lUArfTY9Kj3dCxrQ8bn4VT4N8XqA9R59W5CLzLaoDsmaQNsn/nDxVlRpQKU4CJ4YaiVd6Xfi4ZdeQQ+F8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPZd3EDmY8d1xcRUtfnmcM6ZJmLonWlv7BDzuvIHpqXwIhAM+lc2LlcL9PZzLUvg1QE4bjp2Tk2aOpLvdoGkEfRE/z"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.44.tgz_1457266435414_0.8595329306554049"}},"0.0.45":{"name":"i18n-behavior","version":"0.0.45","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.18","gulp-i18n-preprocess":"^0.0.24","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"574c6daa08bfdb34d2a04817bbfd4bcc0176662c","_id":"i18n-behavior@0.0.45","_shasum":"9b03851120226098ce600d43ad4554d248e71130","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"9b03851120226098ce600d43ad4554d248e71130","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.45.tgz","integrity":"sha512-W/j9yEMN2peDSv/Agt7mGZlPeX4t1K9BUwNxEJowxwJuVFn9DX1QJYZ57GQSXy73unzQlUIOskCA6ma5J0NeHw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkfG4GKCfEoIe+P6987AQEeSJz+zMQJ/syINnhYqRhlAiEAxgTfuSCDy4ZC6kaneXf7JOfFjbvyfTlLk3aK2zucVag="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.45.tgz_1457319428155_0.7987199320923537"}},"0.0.46":{"name":"i18n-behavior","version":"0.0.46","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.18","gulp-i18n-preprocess":"^0.0.24","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"14fe66a659316d4348849365b8bee585611920ef","_id":"i18n-behavior@0.0.46","_shasum":"b8345038de98dd9da6dae20c9e21fdc3ace06c06","_from":".","_npmVersion":"3.5.0","_nodeVersion":"0.12.5","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"b8345038de98dd9da6dae20c9e21fdc3ace06c06","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.46.tgz","integrity":"sha512-zNLVhyyxv39o7JYRPYpu+wXxmeWFVS7KaeH/O3icq4XsK267qyAGJhUF9AFPsnd+c5KdBaOevMSkV29IN0jMJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjuYunOwwGWJVka/BNemdgrcIyy+eelO8rFQLUx8WMygIgJSnqufX5lhi0kovk6TRDyeCzifB4LWsaVwoIMbosSsI="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.46.tgz_1457338542369_0.29381793132051826"}},"0.0.47":{"name":"i18n-behavior","version":"0.0.47","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.18","gulp-i18n-preprocess":"^0.0.24","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"d9f7071c873a3f4d52930341a4e1f0245e6788ab","_id":"i18n-behavior@0.0.47","_shasum":"0d686a875d49d11945a9081d4aea83d596e5b67e","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"0d686a875d49d11945a9081d4aea83d596e5b67e","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.47.tgz","integrity":"sha512-/RLChz1b+xWCF6fPdWKM6lpt+dsMhypP+oEz02+UpKvcFntkVmO5FDGPMEnUTN4UWd+r07eAm+QIyLBWCZHJdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV38DtccV7XQ5VxncLP4Z0kj1q5STuyJoUiwQHuEQ3yQIgei57TcgFYPB1dMAxmVfPTlsJV7/JMYJjHx1T5SNeYkw="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.47.tgz_1457448873114_0.07758945296518505"}},"0.0.48":{"name":"i18n-behavior","version":"0.0.48","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.19","gulp-i18n-preprocess":"^0.0.27","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1"},"gitHead":"54e43d4bc3c3d03c3bfbb59e6daccf3f3f577866","_id":"i18n-behavior@0.0.48","_shasum":"0d6e2e148ef2726524f075c45bcfd30608cfac10","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"0d6e2e148ef2726524f075c45bcfd30608cfac10","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.48.tgz","integrity":"sha512-fSupXxjizMSxOnmVgupILZU3kpXHDZJLE/tRTvtJKen8GlVsK72YwnJ27Ct9WPJY7wcDeGMVVcGdTLxvF0rkiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3k2tPJMZmtJ6PYsj/Da8riYnl+MEoewkGsUrgQI26dgIgCJMksreaH+YzZYCLmI/4BpZxNAzvfA5ACrRIfM8W1/M="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.48.tgz_1457580318669_0.03001293120905757"}},"0.0.49":{"name":"i18n-behavior","version":"0.0.49","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.19","gulp-i18n-preprocess":"^0.0.27","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1","web-component-tester-istanbul":"^0.10.0"},"gitHead":"3ed6104b55ac998a563c83999bbf94a6515069d4","_id":"i18n-behavior@0.0.49","_shasum":"b45004f8b1b8e1cdc277b78709e21e8a8d43c215","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"b45004f8b1b8e1cdc277b78709e21e8a8d43c215","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.49.tgz","integrity":"sha512-VgNRp4JmaBtM6RS0HXLV+eRrAnguA1wVF/TY/jTdhXY9usY+xVejPZA9M1yvtbbBpreG12+IkGUrRPIgrh6CNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvpiA/MwUOVuMkvJ9LwlBn7FfoXQcwO2/+fULXxPq7zwIhAP7JN0NG5+9lBVh/a4q6LVn8buBP1GCvYiUtYDlnpI/r"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.49.tgz_1457620754783_0.274888422107324"}},"0.0.50":{"name":"i18n-behavior","version":"0.0.50","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.19","gulp-i18n-preprocess":"^0.0.27","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1","web-component-tester-istanbul":"^0.10.0"},"gitHead":"7c768b03dbc2479be4b32c2358ed09586b17456e","_id":"i18n-behavior@0.0.50","_shasum":"0b9244267041fb108d766b977a109e71c07cf945","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"0b9244267041fb108d766b977a109e71c07cf945","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.50.tgz","integrity":"sha512-A3XsnIaNqpdXw4tlSQiT3j/CdF9gSX+oAJUmiYRTQbF+a1bPwkR4pliUhArIVS23Qa9/3KB211tSgg/L15rBhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFQ8Wm6qXO3wkvs3aRLCRe5Ns+CFGtj+qIKSfXlh2Em6AiBdNI8bsvnvK37e/Pbg6AUN5idCVOcZnVN7XNdNBf3jMA=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.50.tgz_1457766470386_0.002519940724596381"}},"0.0.51":{"name":"i18n-behavior","version":"0.0.51","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.20","gulp-i18n-preprocess":"^0.0.34","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1","web-component-tester-istanbul":"^0.10.0"},"gitHead":"84693b57f4e232415d5fb73e54c35d3571e1fcc3","_id":"i18n-behavior@0.0.51","_shasum":"acbcc70b93d273164f4abfe91aa4d8c9883c0f76","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"acbcc70b93d273164f4abfe91aa4d8c9883c0f76","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.51.tgz","integrity":"sha512-0HSMGqRqEpkajXQo5qPcXF2QsTQvwVF8AAeQMZbEGOL/IXLMbGJkdsUKNYFdpbfbOq15wZ3ZBTAdTaXx0/3s+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWU53Si+itmUFZJnbbsJFpRgqnGhhwcmcDSxdYruT6YAiAWuEDHKOY7tqfDs8gOlDhIwFX2S7cYDDgcX7tHJK5rcw=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.51.tgz_1457879401470_0.6317005925811827"}},"0.0.52":{"name":"i18n-behavior","version":"0.0.52","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.1","web-component-tester-istanbul":"^0.10.0"},"gitHead":"8d167abad0e1394cd0f78e4cc8fa493357c90937","_id":"i18n-behavior@0.0.52","_shasum":"c88efbdd51be84e583596bd6ac8da2a318161081","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"c88efbdd51be84e583596bd6ac8da2a318161081","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.52.tgz","integrity":"sha512-Pi2PwlCCVz31XbC8k9Lae+2uiGl0M5AzZXxgRMTRO7Yxi8ajfb4jzr0hsxIsy0evuh+iM8IVRftE7EOlk3uWOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbXrGo5Uq+DuTu50GU/OPazaouS3WfISwR0wGhofyZ1gIhAJxeZBINvsb6e3BBFhS5QLf8JyVVn4u5MIrKMxxHBW/T"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.52.tgz_1457930608400_0.13167848787270486"}},"0.0.53":{"name":"i18n-behavior","version":"0.0.53","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"^0.10.0"},"gitHead":"5cbec8eb2e93aae6af4fdb7c25c9d0f3a1af07bf","_id":"i18n-behavior@0.0.53","_shasum":"b21fc80794029a7f4e54dd08d9e7d825ca1f2ae1","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"b21fc80794029a7f4e54dd08d9e7d825ca1f2ae1","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.53.tgz","integrity":"sha512-N8lUc7g8H5I9bB8H2fHe91sf0IUv1B+oTsPaHAMfWLJWXdOuatuCnFRm40qAPAmTEgsUqdbVfKVlkWxBgzX9/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENtiByVITBq4UlT9Dwd6DAm17WvU9x9VY+QtpeMbt9rAiAPBhzbQ9pL8IKESPJ3EU9GxCjTUV5WfJU/XGdvua8muQ=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.53.tgz_1458137049607_0.8440145852509886"}},"0.0.54":{"name":"i18n-behavior","version":"0.0.54","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"0.10.0"},"gitHead":"e77c628c275bae3010d6ed9cac94f7047e5af83f","_id":"i18n-behavior@0.0.54","_shasum":"1f2a00a709017602ada7da232c1208c5527fe24c","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"1f2a00a709017602ada7da232c1208c5527fe24c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.54.tgz","integrity":"sha512-MtJcfya8N4DVdIGISaEv4jTBlt0IGhrhxSiTHZxYRwdl5zeC/csP1WUqYKemfxUPbd3LCGhaGisxxYHKtJICEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsCmiRTFIu0KSp4wyF5dGptlGKBT3i1Ma+4pQJBa8o6AiEAz2mNPFRaThzLlpv1npxiGHnV2Hubd304lBVK+OOH8Us="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.54.tgz_1458274031665_0.9849310198333114"}},"0.0.55":{"name":"i18n-behavior","version":"0.0.55","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"0.10.0"},"gitHead":"cf185d03a9198e502f0bacdda4327a0c414ce41f","_id":"i18n-behavior@0.0.55","_shasum":"4b7aa65dcac24be0910b6a92fdc3bb60153a9986","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"4b7aa65dcac24be0910b6a92fdc3bb60153a9986","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.55.tgz","integrity":"sha512-kN8kynX/1tyFfNlJPanPw91T85HIMMH3OpsDOrt2JuuVoifWAT1jRHnIVT7XQdhildXiIwkforZ7BmSZUn4xtg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmQ5HkkWbJ0suHVQ4SowxC0qgc/sNa9wi8hxvmCB0LEAiEAveG3wcoDnVz688Cq2H08RegKLtBMomEYdhn6GUcOkBg="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.55.tgz_1458484781364_0.5278257159516215"}},"0.0.56":{"name":"i18n-behavior","version":"0.0.56","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"0.10.0"},"gitHead":"4d4cc05c38dd5cbdccf37a95b8a2725c83600851","_id":"i18n-behavior@0.0.56","_shasum":"eb14cc92c2700cbf2966a1a0422d5814605792da","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"eb14cc92c2700cbf2966a1a0422d5814605792da","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.56.tgz","integrity":"sha512-bjsiIU5D/dG5meMUn085N/z2hpyBCe+CdM696uUTL4lMmKJ6kc7qPhlPoEz2QjbX3Gp4AcSs7tcJyGBgZSpzEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNOlC8tJcRWncT5r56CnmWNLwO1Hhh8cXvQV1SHkIjPQIhAP2pBgtWiKIko4FMZDrXDXg92G6chcD/EzRPvY59u38n"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.56.tgz_1458542267635_0.2077308192383498"}},"0.0.57":{"name":"i18n-behavior","version":"0.0.57","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"0.10.0"},"gitHead":"ed39a9a3ffa736d664165e08a76b36369e1df4c7","_id":"i18n-behavior@0.0.57","_shasum":"9215ba712f80c0cf17f7f367c3b2be04ffe22bb6","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"9215ba712f80c0cf17f7f367c3b2be04ffe22bb6","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.57.tgz","integrity":"sha512-fG+94CdE7i2b6486LkwyM3wggr5gR2YnV+A0kKC2iBO1W/ILvgguG75nuqDhQh7qt4njTj+xYjhVrxvI4ZkeJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrmk48q4BQdDOWDT7mVL8P3TLWZ4DLXgIx6g7mNA6pugIhAMG8aMYARlHU70t0V0e1yNv+t1Y9QwvS3xKtqsv1hr7b"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.57.tgz_1458547664751_0.019911388866603374"}},"0.0.58":{"name":"i18n-behavior","version":"0.0.58","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"0.10.0"},"gitHead":"ffe8dfadc9c7b6068140e6665016cf7aef0d6d58","_id":"i18n-behavior@0.0.58","_shasum":"46113cb531a68557e53f95bcb572c73e1cd8c67f","_from":".","_npmVersion":"3.8.1","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"46113cb531a68557e53f95bcb572c73e1cd8c67f","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.58.tgz","integrity":"sha512-QjkhFGNRTtLuWtVW5WDj2n9q46a+HNbNPWMP4kNTnp6cWgZCV9eT8dFINQt2Y7DA0vDEh8Igqs1W2gajosqduQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9ovCwGdK3Fbhp/tgxO1nkGM9BZCpmD0T+Y0mEd71pXAiEAu8oOAT3d1ZmNSruJpEv2NuNL5T0YwKLY7MCs7pTnYms="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.58.tgz_1458658196093_0.336211996152997"}},"0.0.59":{"name":"i18n-behavior","version":"0.0.59","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"85029b2d969bcdb34f391ef66487cda056357fa0","_id":"i18n-behavior@0.0.59","_shasum":"ec28e7830e8f449fc32d5564e8b49602179e91a3","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"ec28e7830e8f449fc32d5564e8b49602179e91a3","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.59.tgz","integrity":"sha512-99LzYMAFwK84CKPOUZ9Ekg2bOyDvAM1QME8KahFh7EZlkYjLjRLdDLr86ZP2xzjdyP+n3onu+EwjNyh7xS5BOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDAgdmmXC7nR7UdkfkYHA8Bd/mJdrGJX9OJWIZvvh9NsAiEAsNYv0rGaA6RiYftKfEf8G8ZtXp6DWsaao27gBT176gQ="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.59.tgz_1458880661550_0.8092451121192425"}},"0.0.60":{"name":"i18n-behavior","version":"0.0.60","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^0.0.21","gulp-i18n-preprocess":"^0.0.35","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"775d88ec2178d027e7f6cf878e201e2126978563","_id":"i18n-behavior@0.0.60","_shasum":"c0354fe67db08017354623abd7ba5ee7de7a7717","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"c0354fe67db08017354623abd7ba5ee7de7a7717","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-0.0.60.tgz","integrity":"sha512-qF27zEmQBWvo2slzjiFpAJa8aGRnLZvUGho5ynNjqFvfL7Yumzs7ExzbXNBKz1hn8ZTpl9YNBcbZuxNdHNwzqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxFmYs5Z6hkxy1/tZ8PWIVYdhEdQgKAL8n5SXonhBULAiACbDLIrLSEt7G1o3QTIJEIw441sz2NDgwKGerQ32fqpw=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-0.0.60.tgz_1459160122408_0.7129699310753495"}},"1.0.0":{"name":"i18n-behavior","version":"1.0.0","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"ca30f22fd0ef625a04c1e3f7687b5a74b579b5c5","_id":"i18n-behavior@1.0.0","_shasum":"ef78d7a7ffabd890c0c76f3df67fcef8735bac32","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"ef78d7a7ffabd890c0c76f3df67fcef8735bac32","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.0.tgz","integrity":"sha512-tPxSsQX1FrtD2mSNydkNDUIf/3ojom8aS5Lr9vGu/s7APVIHWd6AsYXIw6CDyYN9IEFdpRNs1HcmvjDsQSDOQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhXkGUyXPwYCpXVPyspY6TCQwApV0bmCS448HilIXZawIhAO3sVyZD2ZkR9gJOOR5zUsf6EO1kgBI3MpDz3rMg88VD"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.0.tgz_1459254727234_0.250985044054687"}},"1.0.1":{"name":"i18n-behavior","version":"1.0.1","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"1829a4fa71da7b619cf96dc87e89701e6ee30065","_id":"i18n-behavior@1.0.1","_shasum":"844c1cc7246628e20ae0199639601f567b4b65f8","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"844c1cc7246628e20ae0199639601f567b4b65f8","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.1.tgz","integrity":"sha512-GRH7F5hC3ZlfDxJ2xZfOUwPFxwmZP1EOU4vJpHcJrU8x/+cELe6Za+1HGAsAeE34MxK1pgu+2vzPPiqHDBhyDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICRcm2ZogwSy4B0/uI5EfgpG//GtAnJ3El681JeAu4FyAiEAkMhYg1G2zt+emfnJzQw2IpC8ZyAwNUa9W7c54BZSsfM="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.1.tgz_1464700844626_0.9329535267315805"}},"1.0.2":{"name":"i18n-behavior","version":"1.0.2","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"49307b59289ea5e2fdc7f996c041f0343d1626cd","_id":"i18n-behavior@1.0.2","_shasum":"9ef194d1375e1a57749795b48c392f7c49bf4b1c","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"9ef194d1375e1a57749795b48c392f7c49bf4b1c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.2.tgz","integrity":"sha512-MxA18livTU/sNoAz13Oc08rYX0UiVoAseOCM6U0uw4dSshQ7K4e83X0BU/F9USbh94GwHKXOl3pIAXNgm9bq2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFidBclvwyiB/NrtRGcHAtzJAtH0u37q69aA6Hd3W6GAIgXass5lXDYer7w3V2wdeHqa4NF9rw8MlcaqlBioH3ZsQ="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.2.tgz_1466429331547_0.3161685881204903"}},"1.0.3":{"name":"i18n-behavior","version":"1.0.3","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"1d09a5b30e9e8e6c00865833f9fb6b0c5f5720c1","_id":"i18n-behavior@1.0.3","_shasum":"022bb7bcb08bd5d411e5181ba14ff4d6ee40b95d","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"022bb7bcb08bd5d411e5181ba14ff4d6ee40b95d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.3.tgz","integrity":"sha512-YPh8E5Wo422Z/xjq+MLAvaTjnYPIkiEBgtJmGbm+KQ8Ht59GVkBOxOUdnbuCUuEtoZzkp7DZ7nhp+ubXryG68A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGFQflaoWObbwVZPxXv1FqQS+ipFwt1RFVsy4yWo3YwGAiB1FRJmlOg2+K3MSrgNN+y1LmCX6HtBOK81PErURhs7jw=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.3.tgz_1466765357362_0.9116377588361502"}},"1.0.4":{"name":"i18n-behavior","version":"1.0.4","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"7cd758d91dda9bb01f7001b732a9cacedd9044b9","_id":"i18n-behavior@1.0.4","_shasum":"50a76a716cba3cda1e65bab96e5d3db85345a1ed","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"50a76a716cba3cda1e65bab96e5d3db85345a1ed","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.4.tgz","integrity":"sha512-tvbZLlXOqoE40JATYI8HK+na/K/B4e09UdkYpOH6l6FZ41WQDH5by3jYTpijduKK/6MXhKDHoY5qvg5qcPvZbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTN4olINiy63gGiP/hd8acqZVXUBacZLTbxG4/IUMKLwIgWYVhdZuwlkvuUgHf+nIyUNmJqoih5fUZrtvS1v0v+Gk="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.4.tgz_1466772247528_0.04138093860819936"}},"1.0.5":{"name":"i18n-behavior","version":"1.0.5","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"c4f1ecf85e1d8f01f928da266846e7b39d7d5fc7","_id":"i18n-behavior@1.0.5","_shasum":"8c79174abe43cbead77f66cf41553c4cc64f0418","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"8c79174abe43cbead77f66cf41553c4cc64f0418","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.5.tgz","integrity":"sha512-ohL8r1QUsfK6NkU46x2umS8pym18WpPoE+CvCmZ0TK6TmJVIPOuj6YP6Hs/Hvh0PAW/J4bFUYTzAGnhY5i43ig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8i0dOKeGgHEkSaEsjK9z5KghBqluylmltb0PcRg5LjAiEA8Vf0/V/DTgKrvFWWBzFDvRA26389zgbFL3/rxXiS4O4="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.5.tgz_1466856111304_0.20288631599396467"}},"1.0.6":{"name":"i18n-behavior","version":"1.0.6","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"9c53f62ea5e5964759cd3ebebb91f3bcefc5e489","_id":"i18n-behavior@1.0.6","_shasum":"094d62afd6cc45a4b9a49691570d7ddce829f139","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"094d62afd6cc45a4b9a49691570d7ddce829f139","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.6.tgz","integrity":"sha512-rIYLtLwMsO8YaSQaBrq3SnJeyzPBdc+nyJw7jli9VWpkyg6NzOeSk6zeVOes/sFwhFPwRZHybqnMBfkp1RqEAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc+h84aX54rSNG6CjCagsbABD+4F/Vg/6RW85D0RHdugIhAP6j3+1vsnhc2pWkFFy4V+YbghD2ui2kWuPNW1Vj4Fkz"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.6.tgz_1466858445560_0.33137209294363856"}},"1.0.7":{"name":"i18n-behavior","version":"1.0.7","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"1f1232eb901f45dc91d37836e9dda926c5fb973d","_id":"i18n-behavior@1.0.7","_shasum":"a7ddbf39c9df4786b4e1143a5bf1a146f30a81af","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"a7ddbf39c9df4786b4e1143a5bf1a146f30a81af","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.7.tgz","integrity":"sha512-tOtUO6qjtiEDTZxfAQUgDipzGKom23+v1X9yszI07HpxaUgiCYgki+EsfDSqznjxVS6QbjoKTH53lNAAggraUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzzHWII71XU2+8Q5HW1u3FJR560b2PsqNYS/GLJEsr3AiAwRvB2V/BCtUxGPinbNXTFiR6hgN50MWjD3zR0dxYLkg=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.7.tgz_1466861026555_0.9646384513471276"}},"1.0.8":{"name":"i18n-behavior","version":"1.0.8","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"a22a8bd3693d9d16b7664dd3117e3c38727e5163","_id":"i18n-behavior@1.0.8","_shasum":"3f8e1fb366b30565105d4e6385505e369cebc78c","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"3f8e1fb366b30565105d4e6385505e369cebc78c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.8.tgz","integrity":"sha512-smY5u+PNmhER4lV0ydmQQnSqw6BO5kSsHxjRnRqVHJjXy431ZogucriycEmeT+WqaZ3HtmEEiu1JEnwPULNbRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDB35RHsDE+9afS6Bzn3X/nya+VOCH2hlyFn068+LfD3wIgWjupvsnZAzuSmtu68p7bblMdbmO6mhLI1FBiayDM99s="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.8.tgz_1466862054768_0.40088857407681644"}},"1.0.9":{"name":"i18n-behavior","version":"1.0.9","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.14","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"5df811079f813a243b6d71dd288c4d3049823560","_id":"i18n-behavior@1.0.9","_shasum":"11be80622e6c8ae5432e62c7697029fb9936509f","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"11be80622e6c8ae5432e62c7697029fb9936509f","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.9.tgz","integrity":"sha512-w0vOuwG9suPVHXNg9xnWEAs66Ftp3ozv6kbDbic5V/ScaS3w1D1LEBvUw0Vh3dowPrAL1m+Lns+0ITAWX8ZSgg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqRXobPCC/EMVHbKx6maYP1CSLYzP4IQz4krJWvlY7zAIhAJGZil2BCRCp+VN1naKPK+zZHNMz0qAX8p98kFBWxRvP"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.9.tgz_1466867061419_0.7202839415986091"}},"1.0.10":{"name":"i18n-behavior","version":"1.0.10","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.0.15","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"3aba8d67c6f36e9ace8cc8748fef4ccdaff26d9e","_id":"i18n-behavior@1.0.10","_shasum":"0b0b2e444508c864e947e2b9348a32f55045d703","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"0b0b2e444508c864e947e2b9348a32f55045d703","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.0.10.tgz","integrity":"sha512-0q1kEjCzJxDN92g3scRC/In4ozcnrsrhfUAhZ0ZtD3uMoJT1DA5zUEBTho73ayIiz8jeMFFIU7goCUKZKc2BNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCObw/2u++ShJuRd2Rb0njIfgjVAGY/lhXU2kWsaOaX1QIhAP0DodqXcUcJaNDVt+MPbwgwvN7n9lTXr+rDOmhdMaOa"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.0.10.tgz_1466930783958_0.8012588433921337"}},"1.1.0":{"name":"i18n-behavior","version":"1.1.0","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.1.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"7bedb485a23bd84b4aa28503c4c06e902cf485a5","_id":"i18n-behavior@1.1.0","_shasum":"6adf4e476606c7f1e8f2288cb39852f6b9f140cb","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"6adf4e476606c7f1e8f2288cb39852f6b9f140cb","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.0.tgz","integrity":"sha512-h32PSZdIZaKqMAI1dhprjDiA1DyXrPl9XGyU+KtAo9BBq3f4ppPCgmPtVDsAlr2LTqIpzBiaI/napRi1+FcP9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtZ1EM831k2SJ+aiQsv/CDuMS2J7feoLFRZjLjM32ogQIgBgom+PFZwhHJvw+4Cjac4DHzJp7Gfy4JvVYe5CajFns="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.0.tgz_1467019704958_0.4343434404581785"}},"1.1.1":{"name":"i18n-behavior","version":"1.1.1","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.1.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"38e815423c4b6b3c35dfdc2c47e0bc5186cef7ac","_id":"i18n-behavior@1.1.1","_shasum":"e346fa2347cdee5a5ca768e537b6b070819f1162","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"e346fa2347cdee5a5ca768e537b6b070819f1162","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.1.tgz","integrity":"sha512-+R+1x7rsyyEPMgxGgXTAReAAMJp6RYFx3Qytp07JSXzscIs9KQKEH+1z+/ZrNvHRQaXcFwNRFJJ9l6qs0z8bVg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGCbUANvaMcbl9LyVPaPwtWzGNtvY14xcVogRrYwhRngIhAJ9SEKmrRZcXOxP7Jo7b/PQouEx70cPsbqva/SHePuYK"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.1.tgz_1467896931175_0.49287212640047073"}},"1.1.2":{"name":"i18n-behavior","version":"1.1.2","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.1.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"3547e921b1350de05cbf6394035f3c81cd08b05d","_id":"i18n-behavior@1.1.2","_shasum":"e7c263c989366035ccea351c938bfd045694af1b","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"e7c263c989366035ccea351c938bfd045694af1b","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.2.tgz","integrity":"sha512-0WG2isXKT48acUJWaexGrQ+as0+f5AURdY02yhqefOr2VsoAlTR+MlpR+bJ4itEdw5WMML4qvGMtkG5i/ymgGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFINKIM9HP+Kk63zHg8nKC+v3o4T17vV4WMriquY7FEBAiAJLSeSgRs7uJ1hhEqtMCnNQ80xfvpC8UaWYXI/3/QBTg=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.2.tgz_1467945721227_0.6303348992951214"}},"1.1.3":{"name":"i18n-behavior","version":"1.1.3","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.1.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"3a370a1ee7940f936a48cf381c125cada026abc4","_id":"i18n-behavior@1.1.3","_shasum":"b3f038c23af2587b688cc9a04c151ec10116ef0b","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"b3f038c23af2587b688cc9a04c151ec10116ef0b","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.3.tgz","integrity":"sha512-PjAyHZIm/V5ZaYwwSe5bLaLgMnuCwbbTLAjvqCFOcQH8p+10dnmg3bj3yBG3QXVXwk9uBZxeaUXMDZmWR+1n0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7wmzLecVIymqiM4WP1MIgQvytFIN/tJHXVXhitEWBYAIhAPNiI4HnFRuryvpauGDWRJM1CDxvFBK8kRssDJVZ9uhH"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.3.tgz_1468074218347_0.1588811450637877"}},"1.1.4":{"name":"i18n-behavior","version":"1.1.4","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.0.0","gulp-i18n-preprocess":"^1.1.0","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"055ba127042a69d614a65ee09cd3645ce682c7bd","_id":"i18n-behavior@1.1.4","_shasum":"6428224e379a81670f174fba3275572b700066ad","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"6428224e379a81670f174fba3275572b700066ad","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.4.tgz","integrity":"sha512-crzlqRtTrU5omHFT2SkIrJjbz5uWy+oA11AnAHrVC+GpWBHUztimDSavu+j6BXVZIBviqBRs9Z7GRUi4wrIQDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCk9R/SqdZyUBDW4jSQFl49gjacaXFNHAtitZOSS6aTwIgHl/ACEoRPn2V58vOZsygiiHUOmvfie3WMRLQmeOrIm8="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.4.tgz_1468221799904_0.6743253089953214"}},"1.1.5":{"name":"i18n-behavior","version":"1.1.5","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.1.1","gulp-i18n-preprocess":"^1.1.1","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"1deb49d1c5c310f48f50ae591bab117a2bd48696","_id":"i18n-behavior@1.1.5","_shasum":"aaf3dca8ef10d5dbb800a396921c5fed87273ae4","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"aaf3dca8ef10d5dbb800a396921c5fed87273ae4","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.5.tgz","integrity":"sha512-PNTgeaKdTqVmfrsqNzzrtHm6qrIuBlKdencnH2Gs8oNofOEjNKQb3gN2XKepzRKoTCYITWAZureAcZk/CMG9aA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdyZgc6gEDZ1C0g3JZKQ5Rt8A7xG0d7OyPdFX6hhGymwIgBaAQqQeRF1YsZevwEMyu3Tj5BAT/85caQud2Xa3hhH4="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.5.tgz_1468481357653_0.39043364115059376"}},"1.1.6":{"name":"i18n-behavior","version":"1.1.6","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.1.1","gulp-i18n-preprocess":"^1.1.1","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"e625c2d1757542e51971c347d1453eb9aa885cbe","_id":"i18n-behavior@1.1.6","_shasum":"702d50371cc2037a515d6e6db3a4e939d7712d99","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"702d50371cc2037a515d6e6db3a4e939d7712d99","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.6.tgz","integrity":"sha512-KTl6xT6GkdQqrroMGuYuz1j9igQHOMrpspvau4PjVzGKltbJ2gxUJmwy9BS3PelnNRi5MFlMRLhEY1iB/cZzQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF2uwTJQTSOFvhNXxG56ZyLlcFqE37gV6o9sVsg2VJNAIhALegopJgu8/tmjxKg+WVXlKS6sTjd6nW4SNltkKob4Z0"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.6.tgz_1470748580418_0.47658262797631323"}},"1.1.7":{"name":"i18n-behavior","version":"1.1.7","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.1.1","gulp-i18n-preprocess":"^1.1.1","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"ac3ce2261d2c1948bb4e6abfd801fab8976af026","_id":"i18n-behavior@1.1.7","_shasum":"cc9d4ecb4217db922f8875cf8f3a6abd2d481027","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"cc9d4ecb4217db922f8875cf8f3a6abd2d481027","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.7.tgz","integrity":"sha512-lOxafnY2OrkCEnLnjelnXQndu9F71r55wtjG/qwndFpL45E1BhsiqeiZA5Jlocz1t4x7mVmwYb458aQ8L29xUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnEfkPdjeqmuXfZ/rh3G5MYyJqekAc0b/Yxx4d53CyxQIhAMgZniWCQjpzLC3pQPIJUvKDHZhgUU3UV8P8GUGlH7i2"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.7.tgz_1472028264494_0.3492303150705993"}},"1.1.8":{"name":"i18n-behavior","version":"1.1.8","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.1.1","gulp-i18n-preprocess":"^1.1.1","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"a24f71b4e04d045118bf8e6145d2a204a721d82f","_id":"i18n-behavior@1.1.8","_shasum":"ccf789d2ccae06526282016ce3cf977b586952d0","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"ccf789d2ccae06526282016ce3cf977b586952d0","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.8.tgz","integrity":"sha512-zeSgSFl/6sApjVw+jPyZLLHM3zBUiH9XVvZu5/ODJc8HKEZfnRUPqPhzHHa3Nnah7Ht0AaccCs3qk08/E2u+QQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcfHYnePKPIlOR/c5DzjrLhNHOxglZlVEhy0KmPME+ogIgZZ5fdmZaxugYWfuH5fam0xuu743dijHZrsPwMnaEgAk="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.8.tgz_1472105502152_0.2251091068610549"}},"1.1.9":{"name":"i18n-behavior","version":"1.1.9","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","web-components","web-component","i18n","internationalization","l10n","localization","format"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-i18n-leverage":"^1.1.1","gulp-i18n-preprocess":"^1.1.1","gulp-if":"^2.0.0","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.0.0","gulp-sort":"^2.0.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","through2":"^2.0.1","web-component-tester":"^4.2.2","web-component-tester-istanbul":"https://github.com/t2ym/web-component-tester-istanbul/tarball/0.10.1"},"gitHead":"8e9e01936dff731b4608f7fc25b6eda178ff2508","_id":"i18n-behavior@1.1.9","_shasum":"6a9e853db560dceb072244a6579688621bb64d8c","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.2.1","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"6a9e853db560dceb072244a6579688621bb64d8c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-1.1.9.tgz","integrity":"sha512-sCL+aOSSikLWdvlTDLDR8EeqPqjphO8xHLjjLRtUMxNJNJNwsB6Fc2UyryIpc/Z6aNWTjs/2vnssyHN6oUtyFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAAbzsrlPK/oFTsnuD20I6kvNVFuax6MrmxtpiLY8AnAIgDLkGaFhMSau64XuxzE7jAyHvXkzSr+leD469m4LEUZs="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-1.1.9.tgz_1476292880674_0.4553081728518009"}},"2.0.0":{"name":"i18n-behavior","version":"2.0.0","description":"Instant and Modular I18N for Polymer","main":"i18n-behavior.html","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"keywords":["polymer","polymer2","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","devDependencies":{"babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","web-component-tester":"git+https://github.com/t2ym/web-component-tester.git#wct6-plugin","web-component-tester-istanbul":"git+https://github.com/t2ym/web-component-tester-istanbul.git#0.10.1-wct6.11","xliff-conv":"^1.0.10"},"gitHead":"3ce1d3bbe1775cfb146ba259bc0b5ecba24ede8e","_id":"i18n-behavior@2.0.0","_shasum":"3da525f12383be4a8a5ffdf3e677ea3bb2f272b6","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"shasum":"3da525f12383be4a8a5ffdf3e677ea3bb2f272b6","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-2.0.0.tgz","integrity":"sha512-hmqaQ2FWL8CO9iM/w5x2ZMy5hiALLBjbBXYLhQD2OzVExpabaDHAiw0Hsez8vZZasG31TsdXmzprUz6/71HqbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3MOGexqwVq7mdccH0VBcsPfrjRSSWX1j9UBvwEYuxKwIhAOYXHRDgFT4XVPNdrVymjjHyD1jYp3FdS15dsDJGQTlQ"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/i18n-behavior-2.0.0.tgz_1494934727661_0.14107885980047286"}},"3.0.0-pre.1":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.1","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","web-component-tester":"^6.9.0","wct-istanbul":"^0.14.3","xliff-conv":"^1.0.10","wct-browser-legacy":"^1.0.1","@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/paper-item":"^3.0.0"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"^1.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"845978180eb6d85b9ba6a599542f0ebdd5e22fc8","_id":"i18n-behavior@3.0.0-pre.1","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-yjxO4XCtuqjs5zzGUe5sjrLvUY0D37L76vykhnwqZYu+8X4bX6D4KReFiJaJlyTudZ8IMQqwp3wPt7ZjmhiBlQ==","shasum":"083076713be54fc0a39c49daa03aa861c43b42dd","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.1.tgz","fileCount":835,"unpackedSize":15545050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFQ8WCRA9TVsSAnZWagAAw00P/16sFCkZL3cZs49S/9a4\n+hAw55NzXI/LQdFhkRDGfh03M95J0NuQxroCQp61wS2Z3c6/jYSYjat4aiKY\njeyiSFuku3cu36aQ8iY/synZKAYRq8n1cJKySyx0tF19Z4fSZDAB65SIoiTh\nprI7PxAhuu4V4/kdiR0LYG+A5auUxIjh8eCidJPCEe6m6j0hUS/e1R0C4Kbo\nqIne8y1sxYuhM6+joTmKhkULEC9ddJ5T+gUjHMWas0qHL8rh9b+Fo6xcjVJS\nsyHrJjTjs6jD2FtuPD0eYeXU2/SlVaatFmgYrmY3maDr0jPMXn35vTmSuzE7\nYV4Yq2EwhwsBSKzpf5WDs/opsQ8kL3kxrUlJHJ3hIgk+sTHFVOHK5HGiMBtl\nWRNTZwVTGWelPOXZdbEsMNO1YB0hNWBup3JOadAvqcKhSVj/cgEN0AoW8v/V\nMbiXdK8Sm39NzamTTZ6Kjo2GQDZiYgQm6dyelW/S/X/Nl9cx5i4LfmMYME1b\nPsKVBOLAHJ4rlXo+I84eS9Axdw87kgdGHs7kit1TltagBCCXuoJyO08EgUGo\n0uaUoxV3xuqCGh87A4wyRYCNTVE3Z/qxAQhfatjnDAmnhX5h41DiDpNdPzG3\nT5IhRoECCh5UpBYITpRhV+PX9J/BY75b5aAX+lDaqjYWaOh0w7rDX2Wl3yie\nPOdd\r\n=sGUp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaKYfQVXbrS0f8sgtn7iuaBj7qYlYHsTeR1gseT/YO+AIhAOEI0GPgq7DMf9KaS+2orG+ggIitYzuWCQPMvYPrjHMo"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.1_1544883989752_0.38686701761520514"},"_hasShrinkwrap":false},"3.0.0-pre.2":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.2","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","web-component-tester":"^6.9.0","wct-istanbul":"^0.14.3","xliff-conv":"^1.0.10","wct-browser-legacy":"^1.0.1","@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/paper-item":"^3.0.0"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"^1.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"b7595d12f6d1af868fc248ac05826911116cacd2","_id":"i18n-behavior@3.0.0-pre.2","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-HoFYT0X+dxlcfhhoHmht/SgcFaZruLHWEBJsk9bB0i63dSmZU41MnchXsiCZltwcLSh+RTYNhqrbdpEj78nxdg==","shasum":"773788c21a2209c0e2987041d69be0180121a49e","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.2.tgz","fileCount":835,"unpackedSize":15545512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFgvWCRA9TVsSAnZWagAAdNEP/ROS5vTVKj3rR0eY8fNU\neuZvMb+yL8UottISVVNm134+kU+GNckV1FdYkt1+1n0Qm6eP5tRwtiAfNIqv\nqG+VhIKvTv+/HnUiViUZ5+oFOMkJXFrHCFNlvJNriPhhvDisKitD3aDvsS73\nrcuVhs+QWCwUfkkdtvB3A4IpZYiNXp1e5Lldb0glMJGC125IPUZTOEoKTYin\n//TNUQdIv5/pV/P079rQrHGAGp3iDN/0WGjFFtZbAjZ5jB7DLNUZhudeWY4n\npn5qYuPoMs97JRXeUZCW4Fbx37pGTUmZtwpP60KWVFXrzt8rxWXvf7u6zWE9\n+01EyiW9ks2p55rofdtkE4z3qFFPcv3HXHq3CGPqorCj80WWQ3TAe1DnAAp4\nzkHfE1xQJH5ShunQPM0CngCjtLl1gJv1tmfJMRmZowtv3+H3SJ3tHUqedE/N\ni1Fos6QB2nGGRuTVNL6GIxwUK7SSx0qSjneTgG995ltJ8NuxgQCeQbv/JCrP\nrZh77NoEszNC59lD3zy9tORRwq1XdTlzF1lHWwXSkmbwc42zzm48cXdrF5xc\nVkdyJPbebV+SH5ghV81CCMshG9MGcYFbC63FeiL5pqQHKMJaVXFas1MICAbc\nn2Qy2ZJ/GEVA79nsKS67Jw+vDJ7H6iNY9QDGEo4ruOsB//jlidJD5XwI35cP\nlOny\r\n=B/u3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGONapQwj/1wNl3ldjGN0vGTnhk9vX8lzN1z1A3WFaqpAiEAkc7sJiDAQaOsoeQbKZaqFRJj3HXZDsgilLeTCulh/OI="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.2_1544948693478_0.5956994206481758"},"_hasShrinkwrap":false},"3.0.0-pre.3":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.3","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","web-component-tester":"^6.9.0","wct-istanbul":"^0.14.3","xliff-conv":"^1.0.10","wct-browser-legacy":"^1.0.1","@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/paper-item":"^3.0.0"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"5834f2393ca3203a413be0b746333131c7b2d108","_id":"i18n-behavior@3.0.0-pre.3","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-Sb2h0od+6Kv+GKBTAO4peefL/OEWA4+MY/yPSHwP9TpydpdgOlwhxiHMkNK0aKsPn9UViY3h/Y2sjAias48XFw==","shasum":"4195aac75955bd080222ce692a514c39ae12ea8b","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.3.tgz","fileCount":835,"unpackedSize":15545817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFw8tCRA9TVsSAnZWagAAFy0P/2pLeNal/+2f5Z1bjRmu\n+oVWNWoorcE4MzJWfngFthT1DmTR7YuYZ8SL0/xCYBRQkBTRY2vP37Wo4EDg\nYmKYdqhupB2QrTLpAf3WLhew2j9NsnxjEG/3VdedxBs/op30w8C1jqyIadLH\nlNB0BqMdzcOT4v4VW2jwzj5r4U0qKcBm8w8KOQvBUZlOD/titOOSUpmZm8cy\nQRPLNKoWlWzqTLKpMGXvm8+iiNW6rAA589++SAVgnDlhCEP5JATDdnuBpQ3M\nDJFHJ50oC/P5LzZW/eBFeqZLzwXX3PMal737gSHlGG2qdXX3f4XE/0AiWol8\nA2Fbf+V7Bdh2yfjKbrNVn7zBKVGl9dEC0b8RGnbZtVsjIUt8qKCG9y3HtFsE\nhEsgFElld3Krs1+Q5Zjv18B3MFWXJHlXOJ3pXuZjw3XPMe6u8LDFHtffD/tK\n0/slClXd8adB0LlbGPEy0bVLSCQdMcrFg2ymrXzShgVtNErBEPK732OmR/gJ\nbvB92gnvAMZe81m1ZWGcXCKRqLzJCX9kPAErrDOfVpj8mwEd1SjlSAK5YsgW\njJmC42rKcpc28f0uWUN1ufKyrRks0EtUsH7AQbumnbxrT1zuTc1JFf04y8W7\nWa2pbvcxImY8OrPeTmN/6r/i4zAQaku68+EPIpNvKCfIolPN99zWHJ877u5c\nxuhw\r\n=fOvG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdI0vJOpdQf+yqm01HwLOb7KSEHYiOyvCAiNCbXcKuRwIhAKn0QPRQYvQC/36taPKBRgLiWPllpjeiSjlibrnY0NGu"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.3_1545015085053_0.4231361697593692"},"_hasShrinkwrap":false},"3.0.0-pre.4":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.4","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","web-component-tester":"^6.9.0","wct-istanbul":"^0.14.3","xliff-conv":"^1.0.10","wct-browser-legacy":"^1.0.1","@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/paper-item":"^3.0.0"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"1eb2bcdfcd695e07c9503a3f058575ca294e3766","_id":"i18n-behavior@3.0.0-pre.4","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-ykhqHhoVHDcgffvJ8wVPGz+YuOjhw8aYBL4JKdJBQoP0wuf6/oN3WtSj7Q59slPc1Y1GMwoACx2oqRox810bkg==","shasum":"50d6a2e562efa5d7bfd9fb4422af30bf7cd70a38","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.4.tgz","fileCount":835,"unpackedSize":15547107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFxtBCRA9TVsSAnZWagAArQ4P/jUPtqvt9jLYnLY+INBD\n2FWSz6yUkJ3rsO9HGKIfqHP3QrW3M1S93GwN8cEb0j1UMMAR6wxYvcn5yuhG\nJ1ktjLjENLqR/Zsii5Uwj1r0NHFc+U4Rc7CrAJAUBLafxAjP+Th1VBOoyk5P\nScn+GSvlBDfavO1m2ti5PdrCNYTw0xiw088+gEaGGCyyG7QP3+ydU9XzmYDh\nEK/pL7v/jk3cMYI5WvV+p2MrZxxrWlDt7VXE5DtDqy3XxSVdD9tqWts++Klk\nzdeK0GikR2AAYwS718rZPthsIvq0OWXnyToVoia4cDlDzjJarTGeNxmhkS5J\njN4GV+Eat/Rylw/I/gO4IJVmBjPViBZkv49TjON4Yc9CMpGOxtheuurZVTvw\nIkstptwJRlXNXeuDN0MKlMxz40Nqd0BmUqyGLoyjnx8MHuw4pJMBCAU7K+OD\nxUrzelvAVKx6qBkW4jSwXsoVtbeafaTD/dpMf8pxZSXpfsY2GBxCafJ3Jhnp\noUrmMSFFJQ34Nq3rlil7Zd7emsjn6EaQ55DgHX4xfvesEsjDTxE3KFMRoOL/\nFxeMdaDX6cFwOLJAu1DsZmnIxRDGvRPNqmA+Lki6nb8j1CDQxKZ31kSD3ojx\n03GMGx6OawfagmbMYb2KJtvOE+UmhJeFGQCwvJ1ykUTYpcyfPFP/24jn3roC\nbUMh\r\n=1Pz5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmJ/iwnHKrIVuhkk4LosM+Wu/Y+fY7g1ceTJLkLAROoAIhAK13M7n8yfV6+O3IP0GC61f7JE0zvGbFQP+p2VqhiL7f"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.4_1545018177166_0.9728520256036484"},"_hasShrinkwrap":false},"3.0.0-pre.5":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.5","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"e85789d8d7feacef8e5bf801ca01f2fd57b9a77d","_id":"i18n-behavior@3.0.0-pre.5","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-us52IjcWd5D62R0gAN4G282RgKia3eJJd5Vf1CDFwImmGemgf9368C5hhSnd+pMTbjNQHKqQDk3f8mAli+hpNA==","shasum":"a86aeb76633a38f1ba0dff24b96485904964b97e","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.5.tgz","fileCount":858,"unpackedSize":15663090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcF09OCRA9TVsSAnZWagAAgJgP/js8In18/4eEgdCngcVn\nSl4ApwkRCEkMDl80ckVKtiddhfXEvFpeI4nCJLKbgiqcSwmSK8rHK2l9aLFQ\nVqzccQNL7p9EiZr3Se+cgD7JG3ZoO05+sGf6Hwi4DLrKR8+msVVRy9LTGD0X\nnuANq1E1tPt4inLkDlfJYVTU5Fj6QaP9V77i8Q7CeZAen9NcVnItj5cexSP3\nPVRuIUfDJ4EnNcvBG61qNSoyRzO9L/g/gIH/C0HRJkcaJBlTNy+rku+yRg8P\nWNLCv+iut+3gxGnNSf6xhX5BOO/8HHeIt14e/GFhtPgiWKBnAucjZmzLgfDN\n4fKfQOviy40LfzC6FWc9UlRVJv9j7T4aS+vMaT9ePM+IXbW5b5QDdVX4hMhY\n4kJ+RAQEL0rb4LIdqPxKK9i4niV2SZYHtwxHKxLpd9ERjHGtwNuzmZIdrQn1\nXA8csf9kyJQfpURQoAvLns8F7fmsCLssrSZfKUUrcYbtFhvQkQj/VCvQcQp0\n0Ezl//lfEGjWc9gKBN6bpi23kWmNfvhOus7hYpx4juKH6w4eSmUSVDLDbzj3\nzIfeDvCt2ZFpbzPwQw2pXIp2ocaEPVxsbxeACdYYJXneQlzxF040IOnizM4F\nonelV8wBb5xGkFIb2RmABH9T/0sQdqErKtfyGqmgd5ccGidWO8+Rr/WaUUza\nmS3m\r\n=hEQH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHg1NiuUyCQD/jeyn77B2heL+m9bUhhm0/emjplsF27oAiB/66SoeYs/qiOJpne8muan1c3swVjxw8KQRaCjJAAxfw=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.5_1545031501343_0.11315224210134467"},"_hasShrinkwrap":false},"3.0.0-pre.6":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.6","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"14504e4620e8357251409174cb0af426995bb2fd","_id":"i18n-behavior@3.0.0-pre.6","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-4q7YktEnN6k/CpB/olVxCZjWbx2h+XYY6c5WNmSVKlDj1tqiNsuXuoJ79JhFJ7KgoOGgrN8YM/xRLAlHOlQcVw==","shasum":"4080716276e5a2edf982a94f2d884a707a089b9d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.6.tgz","fileCount":856,"unpackedSize":15650949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGauCCRA9TVsSAnZWagAAGNsQAIUZ/6tHLkfgsWpe8c58\nygbZXNDIyu5zidoiCNhnotTI+nb8cp6Hyj7BVncxldpUz5wL61/L9iWHWUqE\nafONnzoV+i+7VQSzGP7vnhtNah0XWwZFYvo2mCCfJOD7Y3TAB+7ELrNBVHYl\naLhTSEGvdZjODRoBSHFWCF7IOZlKiLrvd7GCLz16quIyoYO8km9JwaAI8nQm\ng2DdGFLowQyB91WCLDECYP9Y1mT1yQkMRTc+uKS8uthAiOwcjdK0AojPM4KO\nqA4Vt4fVm4KYFS832vwjyX+HIPJIk2OIrAfuJfVd2no7/0EfTtBB+YiHd6Fe\ndhzMRoKfIGbHj96oHbxPOArVXFNYyCpnd9BRByPO/mz650gQ+w19evuOgeOU\nCZARKVQd3IjnaaihTl9nbl52IoQKpfWcuXDnEVnH4wSwoWbmbxoKhbPaNO/G\ncIJMkrNrz0WCaKicBZoKjXhAMkWnYC2SRsUvT1aTbasXHiD6mCVQKT0W9P4Y\nfUH3gF6iLil3KzT8dxHId4f/A4hJtn3IKmLN53ecAjlsRxWWTo1QPJCn63Ia\nYyZ1D/EjgOpTdrqDxGVPpzkikUrjwkF58KxD376bXxo/epNfI9txigukT80x\nmLC2sMc6PRHMu7pYalAjZt64jQogJ1EPQQhBoar0Jj7wHnyS5RXIuwuwsE9v\njHK4\r\n=fDkC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5SgxAQJ68xnJbKxoo1K6ljAZBJTyRdh3O1VyzCTWGDgIgMzU8zVBtqBFChiR/dJp6YFGMaaDuk0u/m+RCfraGSE8="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.6_1545186177346_0.3078083818477322"},"_hasShrinkwrap":false},"3.0.0-pre.7":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.7","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"1d7d354555c6481073afe69ee62734886e6d5b80","_id":"i18n-behavior@3.0.0-pre.7","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-y3SCkWxw0/n9DIkIp1kG1iRpgMbuvbvHt+9aizf+ytEe+T0dpsGOIX2f3++ytW9oUI7fNnO1LacD7EW7qXW/9w==","shasum":"5443cc474901997399bdecbaa9ffb2c915d12a6e","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.7.tgz","fileCount":856,"unpackedSize":15653402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHfaaCRA9TVsSAnZWagAAEfoP/07qWET2InDMjqvSwUAD\nkeUxc+0vedzNFDYJQ+yjf6fX6hRDAbYy7Bhx23+uGY3xwbQw0LIstetgnQVT\nCSq9gS1bCvqcrygwrOjwA18H6K2PytxIDyYCUWTabayuMGEU3qs4K0BL2c+6\nsPccLbtBdEumW4iNF2raWF9lwPe9k8MUhaKDyJ5cRpyXnNIPOzitK96p9EBh\n0DCuXueBJjXm76KSlrI7z/JhfnO9vvCzecKe28yn2G8mDKaKqO7iJiTTn83v\nU6dfZOvLgD2gLJSzLo3LzYqJ6XeQSqgwpEwc6DtFSS/qRk7uWtjt9M40yq9v\nNr1BXyClmI8kokvNJVNv3qJGxk9eSrdOCZXvXLv7cZWp7qInU+FijjAA/Kfl\nInpXB0E71/HtukydnL6P3gcq/a2N1gTXdA8kyKrnri0itbHxKtZLkUmolrJ+\n6t9luedp9jtlJyWSMefvV/BhPruA0Qvolk4bFPNbTjwNRTEewvck78pccm8d\nm8Qow5dommxj0rweAaKvnGzRTg1r7tvfzsVVV6nL81wrH9Rx5ebFaunb6i3n\nkr9FsiVOyki1uaK2Y2JX8xDlGp+l9pioblT7YZnfKUvM4vtiscC+UK+BFm3v\nEWK7/9Ka+9PIFZt4gnRttOlkuLSj1K6cU8bx7mhpNM6Yn3zo8sWxdqEGoBL7\nAWDw\r\n=Bbwl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHKV2xLZngitqAHydrgT+sHI57OK+NDy0B0HLIPo0x9wIgSjnZEes6oWNARQ7Ks45iZjpI4suLGFXsdzGfN2W55po="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.7_1545467545723_0.7570606033591942"},"_hasShrinkwrap":false},"3.0.0-pre.8":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.8","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"e62f159102e75414181ceff54f135cb1bb8de5ae","_id":"i18n-behavior@3.0.0-pre.8","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-WBiyrz+dY2zSDV06NTcJJ65sX7uFaJfc0QG7PZ3zX48d+7KM9F4feJ967dhKRB+Faa3sr9V4im829tIoFd+CBQ==","shasum":"22facc8b4c9a34e6b042b6461201781998763016","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.8.tgz","fileCount":934,"unpackedSize":16098498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHjwtCRA9TVsSAnZWagAAMFQP/3wgsE4aSFxXowptutjS\nN1oFPXtm+u5ehgfrpbzVZK6Pr8G3+YK5scdl9y9hYE63VWDd7xSH6EmTzFSk\nekIKdP6WiTk2glw1clzl/iG34XptTx51MxEUA/7PhADoewN3tSgr7u2TRrHB\nK5zUUnkxFlhIUKCrpCo5O/xozxyYTelBfB+drwQQWDl/YS9L1onwRz1WvC9Y\nekii8Mq/gWoNPEXVOSxHAtngwk9wj5Nu8nZtX2HwrcZFjjuTRxi5mEgoLqoa\n4aCADhawiztEaeZ4/YZXPAKtuUdwWs50WPaeqfkZEp/9FAcgL02UDbvoGQvk\nSaxgPHFOtiOpR7MGNP3nr1xJMI8jiNzSmDtlEk894teQfx72fEPPRIxY91ke\nIWxaxlflzHM+8grw6z2ZOxUr8AzQDddexyAjUFmYCyn2dg7b6TPeieN5ChO3\nD8f7DJ6MQPuJNTfrqd3i/g5AxXPy83nr80thywATnFXgIPoLj6twgqQBmzxX\nvDGBnaKwiimc3H44qVRnhgyDhECrd+GelN3m/g96hAUHygIJYyae8DhvprW2\nVagxMPQ3HoJ/X7gcvJqq50H4NeH5LlAajVNw4kdryG5EoOi7XsEJ/VdnJjmo\nQb1bE4OReeq+i9at8Nl4eAJwZNKAZrfWyV7FrVqFAmeEkAX8d1rD2OFKBd0s\nXVKf\r\n=PMp2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB80HUSikL9nTVtHgM+my6gSArPdiW5jp3uVwwFN1abFAiEA9Tpn6hohRM/cp+usKFMNly1G2LyoPMgLjnTo/zm26kY="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.8_1545485356401_0.7742568845792164"},"_hasShrinkwrap":false},"3.0.0-pre.9":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.9","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"ed39e553aeb944647160ba3310a2b262c8d707e3","_id":"i18n-behavior@3.0.0-pre.9","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-RhEqkVaq9O8h20nNbykAintUd6Z9K33v4ZUsJd/ZBdqswn6Oxrf7sSqB8aZpC7Qi4C3f9l/fQdRXy5hTrzc31w==","shasum":"37f1ae5b1d9207f3937278f464344660375f756e","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.9.tgz","fileCount":1040,"unpackedSize":16637616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHlzLCRA9TVsSAnZWagAA7p4QAJdLsVGXaOOfRnS8aHnb\n3lcSeuYghgh0EtGcADTQZCb0Nr7skKp5htppirsbBiyn5y5vDS8V4gkIcaSp\nN8SISzMddMvrDXZ7+orE4GQaaJKckaNR1V9eCldDymJ36cvUAMzI877bUZw7\nLBwmCOe/miS+IoacDtXgHHwz12JTvDes/kOOdQDuByCxfnnstKmamFAJj4Y5\nwIHIhvUozZsIeyANyBEjv6fyekIwf6To+A3xp2HMu7unPevw0syoxzzoSZKu\n8o4A33IK9MCvRXiqo1eu82u5wLT9znS79BKOF3lacguWjHr8A7UZ0Y5JdwiZ\nk4BHWMacBLJbOQEEMy+S987RXrt7hHkCEuSK1o9+rz7vQw5+ucCzMBkO6+27\nYUWLfzCnA5/Kztau5JRNzjEVSJgHJBpHAwn4wgndmgp/O8Vd1grPBQl+2Esp\nf+jVqJ1G2Lpgin54usyMS+NW7r9Pg3smapBpx1z5JzCjWsRGq3MZRM6sE0w+\nOONVn6ivtiTJTKoypsaafC2pfZWMU5ZoG7XbRpJ1a/iu1fh5+SYzerkDvfmV\n/gCbrw5niflMsfJ/08Unryj2nSRCZtXo1CUacM/ccPRZe7IqF+H+T4g0r67S\nYBFbN2ErN7YUsvQy6T7b17lH+UMrtspkNfd+tb4J45sR5gEn5ush9Mz/J4PC\nZaU7\r\n=2q7p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDi7Ksf3j1bBtzvP4USK4LxisqI8b4q/4UFnf+q38UjNwIhANJCigEqhpxnZnt0m4+EV3RnvPe4nCtP5ja41vYx5D+0"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.9_1545493706289_0.4222020999470557"},"_hasShrinkwrap":false},"3.0.0-pre.10":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.10","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"gitHead":"8adc3647ef55ce5ca25555ccee5bc10a5b291f82","readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","_id":"i18n-behavior@3.0.0-pre.10","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-3IYvJIFHczpd7q8ENxmkPzYpI3mQUGGd2y6/2fJaNiRZkwMsN8n3B7yAGgRIi2L3adzfslTrjwZ5vOFnduJDGA==","shasum":"c937292f133f10f68704d96b742467ae72cedb68","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.10.tgz","fileCount":1040,"unpackedSize":16637602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHmGeCRA9TVsSAnZWagAAHsAQAJhNonfNvmw2qWQxbYcf\nELKEnTNbuDfmdy83xXxzjq9J6g+CttXc8wcsQgHAqEkCdvMH5KI+0VmtY/NB\nAU/5ZTbA5I1L4y/M+FUif0ezmxm/lrhtY2mrhGI4v8hlO500/wAbcBmqHvH7\n68XVpK3rfww0LhdqesVpZbzkkGpqjHwQl/4USvNv9tLUAcHQzop1YN+mayzr\nlaqm2JmdavAdeUTQZeDxO8QQlCrYRpQlY0lgbN7G60W5IBiPmLh5MQ9YIu3Q\ngilfaDF/N3OS/N7HwBOUKnZ3s+Lu71CUYrH5CaEQM9luRv65Id4Jlb/aYRZW\n4YQmjNYlZpJDPoPWirbnB5APGWnf5PSJAIF3e+bONTo3UoyvHBVy1x9OS2IK\nMHJx3iplYBZOk3p5MfuHGGE87Xx3qUCU1fp4HHrccH5w+NuApmutFmAGL2SD\nVRS6eOtJNWlpzW/SOFDoQqKFtZP6qiE2k0ccRTlz//zPHdQpAXf0YCImRNDz\nxlkoAx4IcH0QAq1P1q+isfcaulb0ewwZaijT7Uus1x08oCC2b6zvc/YEYXtA\nnbu3/vJ194Gwu/6h/ZWneh8jbIA31/hmUOrVoo7+tjSE57iFLRID+v6An8Cs\nswCTZGFrt5zUOzGWDhTDtN3tCj99wo/+IxbLBx9nVxt0pspH7gHzBRt6SR5E\noog4\r\n=k+3W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfiMj+ZTMl+tIsYulf20pvproTzZmlhIiPvkJVmOmqMAIgRDWkHwKiCoZwb0ixnwZngl8zYb94pssctmcFkcpRShY="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.10_1545494941598_0.43216733558563925"},"_hasShrinkwrap":false},"3.0.0-pre.11":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.11","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"687ca71d676ada2199c6a43a8ef176dfbd107741","_id":"i18n-behavior@3.0.0-pre.11","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-by+9FqBazGBr+6AmlCHd5gwh1kRZLbgOePfIDSL78mFUB864tLn7yIgVhO5q3TSY6KJU4Xcu5YJBR4vU/xfLVQ==","shasum":"b7ac5fa5480f47a7cd8c73a76dac9fe7c322c333","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.11.tgz","fileCount":1056,"unpackedSize":16860579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHwaSCRA9TVsSAnZWagAA2HoP+gOaHApb8Yn4MzFqczLo\n8SjQubBvvLUlXJZhRhYhpnXfQP30DIhqiKjDtqIQwi9Nqw4w2S1ITjU9A/sM\nEkbmqz/TSGwfcIC7p+g41RpOfFJCbIrNzLrBAlhEY57QJZqsbALncdg04pFC\n40XS9W3EnnQsX3KrhH1z5Bw09yED7FmfWWzmmGfk3u8Q+N3myrHbLo0mHfnQ\n2b1F9dkkgS/f6eEY3humWgJSUw6eatAu/Ut8j9GGEsDDoYgjyUurXc5GUNu8\nPL+ND52RH0eZXkPFumnliaPZU3byjCWOvZeIbqhyhu7iL3hRYcDhW2CxPObc\n15ELfA6TWElaVVFZtXA4+KR146xjhmydRd2gs/s1ceAritSCUknWkOLAU+3O\nh22gLW27qMmN78+AlHY9aXQiNcQIDqvhTOo1jGaR/BV9x2iT/pnEpbPjzKFC\nHIp2M4Xv8Va21T+5TA8B3PlH8XHCWXbGbgm569w9OBqNxHfamFYsXD7kjU0E\nKhNGQIBgI7Hh6m6NkAOXXziWojPMM5OTTrgtrbJa3cQoqxsu+sMp2jdxZPPo\nJRHnkJ82b+6xy7NVCOri3xgGUH4t+gqVCIEp5Dgj80XkV+OfxLl5984qD7aQ\ncesAm6UBFylsQaNegIxQq7k5MYl3f0wCVzaNB3Ia0tYDANCTvCOZMXdl0Z26\ne9AV\r\n=2mx9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdbfMa+JHb2hXiuPbNKLvUx5247yFuDh27bJ9RPHAiqQIgTV9V7Qrk1DScWSQtPEzvAXOmTK11P0gCO1ZsNaRdBO8="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.11_1545537169954_0.3157581833165928"},"_hasShrinkwrap":false},"3.0.0-pre.12":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.12","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","@polymer/iron-localstorage":"^3.0.0","@polymer/iron-ajax":"^3.0.0","i18n-format":"^3.0.0-pre.10"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"0e426a079150f091e6d275c9cf7bdc7fc27f7e58","_id":"i18n-behavior@3.0.0-pre.12","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-lnGeRRuizVThom5UsbxpedDceeikrFc/Mk5yksPmG1I0l5BFhuzTWHyb/1kTIs/d8JAfKZmYHgbXfkDIp3rINA==","shasum":"aa817fd266510f99d636d44593451dd226ca3f01","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.12.tgz","fileCount":1135,"unpackedSize":22339659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHy+dCRA9TVsSAnZWagAAu4oP/jWAEWkJOGhHCgOFqdY/\ngJpgI9Upclj527A2BKT9imib2TnG2RS1g1p07LOKCOJQgmH5D37cMiVzafjF\ndY4qUgjQJcI105FO2qq5QBXzaH0uqqg4t1fXojc0O/7GcVq6xKG650knchhS\nhKbAzCASySDzIGkgMqIDaGh1MY1Mm/gBq+EilsWuC877fI/23A5vE341mZfQ\n/8LLkhZ+w1BDFt5SFpQlynRHOKVxxhcoDLC5o5i5q155WBAe3LGMrqS+hQTE\nqUcelvk3YPZ6XZFuujsT1Bq6uYGRf90MGgOPmhTQkGmv4mpkx3Dyq7e72GRy\naqr4ZVFus5E0z8LZ/WaJhkjoBedzCSspMhXO2PjiVsPme1iDk3f/aHnNnsy+\nGidzRNn/rWK8MObcJoWB5kHLGoGwGIaM4KxW2ckEGYmDcTpg87CN+19uB9sM\nRHnGiFwlpd3+mr3LWrmkeeibcrjM1reRgOMY+gqijMgFzOHPpsMak8keAbGw\nt4i+NKRhCx/AKUiYlgFjmCwNYE8+o8pDs1nQGwY4U+6ZnSlEqPQMhAXH4hRu\nSvUoC9e3A9fzunVKJc/ogKVVl/MNYjHFyPSo8Mn/ow3DJQmE6759FPOtPyhi\np6Co5Astt7KednA518nWJf8U2T7/3Yrz3QRgsMhpWLuv7sX0jZWMuTAqvX9v\ndp5W\r\n=cEx1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3NL5nfW50TNrmXAUTXH5IZs5Yd/A6SPm9Mn0lil1VPwIgcFuUBGdTXsfxkCnIeP3WsUjDIROf69n1amCr+TaQXl8="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.12_1545547676464_0.1953206842309574"},"_hasShrinkwrap":false},"3.0.0-pre.13":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.13","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0-pre.11"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"30533a60681092305cddac66e9c1551ef4fa0a6b","_id":"i18n-behavior@3.0.0-pre.13","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-uJfP9lAvkJaI1GcopkELPf4xY1sHo7Fdd5wGt8GWRCkectRKNN9FwXzZcCbQJT80Iqme+/5yIjdbQB9zmoKweQ==","shasum":"32d857543dd7595c2216246523e24c98a71b55ee","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.13.tgz","fileCount":1135,"unpackedSize":22339659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKZsxCRA9TVsSAnZWagAA/oMP/3mRcqFY2rH5mjJ5pYAV\n31F1ctwalj+DZy//ohxqgrtI2Tp3GA0007PtvD1q+ZaqQ0UHHzRUQqWe8T3h\nGkQalaPZyuD08S/1Lx5twAUwHMY8s7SFvOGanT44B+hCtkTzRWUtpnB/qyZX\nduu9t3CeXt8aRSTKlIN+bSY9CbiJh0Iz9yPWlszOnnhVU0N+lXn5zjhQTtxy\nbmQSfiLJECOGifNzlKNBZqnX2IZIYmR7+h0UKL0e1xXZ+ASi8jLbNA+68kTV\ndW5+TaW72K6pQ5rxWJsKd1qiBMO+7mwZdzWiV4u3mWc2P+SQL7ZAY1wYgEGM\ncE3BdxHZdk5SLuRQg/IJ8dkcI3aLC1fGoIMPss/7ryxhVdlQKd5Hqw/dw8qu\nvWgS2NmDsgJy24Aj2sSRXEZAF2sRXnbfW4nMcATkFI43+kiihczRs5723yhz\n4lf5eqZGNAbPWttodvegf+C/Nd6C+PhymqkhNbMIsbqP/5nANv0ogVJFfwbz\naKJNaEAS/3IlumXVkeu8CPQeqA40o2UgTg1rNPZhEhAJK2suWD28L5updbUR\nxHc8kSvfS88JBWbbUpIUtfHffz5p6C4v6d7TtCD5BCNGtaxCX5JuEmJCosaT\nXfYOYtJ7oJlGgM/+unBOSCDKoJkKaJC+duEgvU98Omws+M43llTssejJIYCH\nKaL8\r\n=5U2y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4kukRwyAeQrB3t2sDjJ4FQXXDV8MDCfxEpMs9etMJswIgGtp4eUW2J8ekBrw+wxVxexxFfakFJZantawu/Jj1z10="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.13_1546230576247_0.7179555752044069"},"_hasShrinkwrap":false},"3.0.0-pre.14":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.14","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.0","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0-pre.11"},"gitHead":"819bb91680bfbadee94f22bf9027181a62b12a3f","readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","_id":"i18n-behavior@3.0.0-pre.14","_npmVersion":"5.10.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-Y1Ug6CsBT66oN0XjxOhsvfJfaFbf6QDM0+C7Z+xt3VaYoc26RnPlGC1h95UYn9HH9IKDWL13kl6UWOCSwqOlUQ==","shasum":"95100f1d1c1bd0070bbdb23ca7cd0d420d350bf6","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.14.tgz","fileCount":1135,"unpackedSize":22339897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKvydCRA9TVsSAnZWagAA3jkP/0Ww2cyA0k8x7BZGM7Sr\nmdfNsL7aim2s9pE6GsO+V6uOc+vc+EQ93PejiJh4iAlReXdlFvcpxQybaofF\n73qw8SGZxVYEPFNrJMJ6Rq+GUaT54eracB7T2xlzwFMmeaQtnDayQupUDFYr\n6EP9WiIUl+196Y0q4mQcuVMW9B/QfG67hjdKayTTatobg+RUeHhIbDNJTuqV\nVcSyXzOlSfyb0e2je2gWpYxK1O/kvsin6Qp8c4AWj3wrSI812kuAPoEsonT+\nW0aEC9iI/I0TT7XA6Cpd6CyWuw+AyiVQsRhBJBo9BIlxzURB5MnoUdB7O6OF\nJoaGA0qbRLOnMKE92ZxW2C0sYNgNIQ0dRTqoOg47eCsi14JO2f63FAbEHN1A\nzDV180qlHtCoChKl/1Vdz76ehMMLVHYM2tU4zbqsf5jMwRnm/0eT1g9BJYow\nol768SEH3yCqEJ68e+N82Zgu21TA+rLNzVxvTYQqtY5h7xfJWhYhQ0K5Vk64\nGB8n9gGQOJ5Fg6PgZGWqwsYswFokSPqf4J/bDA6FEFsBQ87b1lIPtPMp0oVF\nxFRr9SsMJHPeLF9yOBOoJ2nd10MMllDdhJtUU4bNHYmdC61sHjtzbRfMbb2T\nLFMFneGF7f17m7m6tv4OWXvzbpfptPusldyVh41Ps2BSK74R/K8e+gtZiM0W\nTGBf\r\n=ia2R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0MHBBW+TcUXXn+m9HHx9PWY+IiOmypN6Ne7pVbgiR5QIhAM5qiDI0VkBFttEflYt+VzrXNggY0K/paYUDuyribqEl"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.14_1546321052300_0.2503384414371279"},"_hasShrinkwrap":false},"3.0.0-pre.15":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.15","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0-pre.11"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"d75db916c44c51bceedbf9df3841b370e34fb4a5","_id":"i18n-behavior@3.0.0-pre.15","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-bpjT9Bes5khAK90wh0/R6t9h8HXlkk8A1uzzyOyykeghHYzTo1oo1okHKCR6VdyTkRWa1BdfWrUDjwvzF/MGxA==","shasum":"7a7d1d10357723b09225e8e701f776b59832e64a","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.15.tgz","fileCount":1137,"unpackedSize":22349231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNHRgCRA9TVsSAnZWagAAX20QAIQqePYqW93sEcJy5cIb\npWPt7UfPNLSYzK9sGRW2/Ix7P3b+OIsFXpktgAs69FlgChjLhm53oM+cg6/m\nb24Znh5TngyKh2/OqSqGS5OuAyUY5qNIVNE/NUY2G1e68Kxnx2BIV9K2kGHT\nrynrbRay9nwmaE4SI4VHpHDuJKXyqnmJgAl8WnznRZ8QKpsosWWpaoHXEWPf\nBVM2//AldfI2IkcY7Ct++24dQZS5fLHrxr/i6nQr2Pa0tdgQ485t/91hN5eL\n+1b380FeqN33riL5YPO7wqpDAFBL1OVUsDs1ekx1xp9t+G++xDUl1h1IM3wt\n8q4J9P3XmHbOOx7ttSDVCA9yQT48xrqA7UC+nAVRm3BCyLZodQdji4YaYARi\nNPQW1HICZUZfGn2jpHAAUHU0/pH+Pe7KgheEhg9Zc0SuC0070S1n8KuMueP1\nufISB9JdERfPxfG8CQEaQNME9GGRi6vNo2SY5dEJkZW+9Ggn1Gb+bU09BzIH\npWsyPFaRLIo7vDtMY3CfQq9y3diBI9CyyE/tgiw5PS+gs8r3XxIymKg/GVAw\nSG6KtRSXjg3xjr6i/kyf6ysEHvyBvkbYxY+l63onSK/DHScaHuilHvTaPMAX\ns1PpqhsQj+MjTzoz/T8gGqvncDYOYl4213v1WW8YxLPOND9Tcn8TkvKSLCL8\nD7z1\r\n=lDnZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF62mAYHTcpKmpEOJDUpIhZgikUY78LZxDFoWvmOCJ6aAiAQBjtQcNuv6XSV2RpNWj4HCEpxtnBN26W1PuWNsMkFpQ=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.15_1546941535253_0.35981986154276435"},"_hasShrinkwrap":false},"3.0.0-pre.16":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.16","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0-pre.11"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"7b1e1afb90dfa0e48d0eae2ace9603bc83c18d6f","_id":"i18n-behavior@3.0.0-pre.16","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-9YG4K3mGYPOcKUyAEXesPCkr9bOrrsYFDuKEu7jJ0Kug3XU3Qcp6ae9lI/vfALeawyFDo+Nb0Oj28Zz/ZVzSuw==","shasum":"5acce8a24d45073048fbe98c96a2a9ea76b7684f","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.16.tgz","fileCount":1137,"unpackedSize":22351043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNILrCRA9TVsSAnZWagAA4vcQAIKrglwZ4BZFl5fUhl6I\n5So3hpRvCZiygwMFNQD1RB6pIwtjkEKFNQ6MeDptNyFeuNFZ3xDpkpRNLobx\nH6b0RmU825XPEHwDofb9N5PGtqlAlZksEx2qZCpn8dlIDCEJPGh3gkmq4bxQ\nhuJeIVkCJjb37qPUwBBWlw6zYdNBa7n0fZJoaJ2F+33mHL4FPDW3552hVndk\nJQJPqyG0ATi2PYHPEzYIq8h2W2X8XgurC+vqfp19oKlvLJ1aAgEEtnz1Lahe\nvDznNzpApJkfqlKn7iiLLDy5yDZn5am93PCoPglUDI6qIrWadVV4UIo4257M\n/RRvMpkSaRM7vBy7ffNh7An/i4WtYhWbm+7RfcrUJOXxZJSBOZGgVRhSFiGo\n1OvFV8SRDAvXy86K970QO+ro09w821sB2DNUHbtDHWIN5MUzQBj8yRuNkP+0\n9ImXZ54dw8tWF/hdYGUpEKkP/71UtGveGf4nXWf0OeuvOVTz+omFXpbrm6iz\n1wOT8Atw1uyQnc4CardYeOlZNk3WT1opB+0CxZvx8Ha6vq6MVpZZZRGTAX24\nOClieZQAD90y/GUCXEPF5DEQzeeZJM8qHSzvOqN2CeTzxlYsqmlnGfR4qnJ9\nxU9aja+5mh2TbwApCx50JZdUmpgH3rsJTb8X/pUbcKpLtKi6EMc3o+QckvH8\n7edZ\r\n=YwPe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHX3PjXvqYE9fuPGeY2DZb/eu5p+i3IscXD+9k3zlhvLAiEAwFeewXIqRQY/u0CdwudE43lB7lft32AyTDPHcYBxfrY="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.16_1546945258867_0.03553004914485669"},"_hasShrinkwrap":false},"3.0.0-pre.17":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.17","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0-pre.11"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"a541e50041424682e743089f6b32ae10256b24f8","_id":"i18n-behavior@3.0.0-pre.17","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-obhxD4Pk7h5jxgJCJdlA7dJxo4fBRuPHv6sDWp9xFlWjrr11SBsah8mgUrchl7b72nkaozQOl+IZltNRaMDF/Q==","shasum":"4c58746744e53c7d7f9dafa2fa3d72e5bd66039b","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.17.tgz","fileCount":1169,"unpackedSize":22625609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNU8UCRA9TVsSAnZWagAAlzIP/RQ+PpyoM90jb1fXqygC\nP7IYBHNb+axM8JKoW/3KnAsmhbJilvdG6rBxT4dV0dftvVri7dp/cHEtkiC9\nSxYsDeI1+R+ITaeFLc5JsjQD1sMaWTxkJbaNfV9sIcYaMEp5Dlh6PuuXrV4x\nDV8+vRq+aSyPCgsPsNHxxtZff0w3wSVKb7zZm2/hS4hux5mGuaNH9pVkdPXa\nyA+Nc4VZdnIVNoY0jqsQ/Q5EmCFnqT3rHTzl8PfpVVld09n34nQxjZGMNxFp\n2bk3RJ365rllXxtTlegHZi0RTR7MtE4po8/Fo+MKuCfenRNFa1taw1cmTGjy\nHaymwMON7bETBSoWcv7Bh7RRY+mcggrJspGqB5mJdO0yonEOY3kSRi4SEks9\nROupRb7ZxdTLwOorwYEH3BdKr8+ynVBxtleXHYr8BVmJWp5rZRsw4hMQ+jf6\nFDfmJhVFIdbGw/YpJfp5a5YIsL+2DQUafj02GVj62FW0Yp6QzuA8AYr3SR9N\nFgxc08mHmxQnxV051Lo3uzq9wYDRHMQJ3QbqEwL1o2qxcAxfYmke5K0t4c99\ny2RHE8K9I+g/WVFACVlmPHC2kHfPJ3vknH/LAYiBINI6DUgkj77zLhTXfePt\n0KMhHsbQMqHq8Sjt3Swd7Ipu/vt0qnH4a71jpzDraZ6J5imHdV2+U3oEOfwQ\npC8p\r\n=Lmd4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC6/t6bry/Ha/FNmLt2ISnq9tJDcohCbnuy6Ye4TzKDWAiAISIQdmpHQAgdtxKiyiDUm3n2tKQT/rkcbyJEqtztZ2A=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.17_1546997523570_0.4785722524551421"},"_hasShrinkwrap":false},"3.0.0-pre.18":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.18","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"test":"gulp test:local"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0-pre.12"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"9623dcf13d2baaa4c56eda85e57d4ab572953310","_id":"i18n-behavior@3.0.0-pre.18","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-6cCtN7ghFJYmjRflvAbAVNcCn76JzEK4KwCZ020jkKf2x8+VzqazoAiR2it9bbk0fIrMSRGfmX06MuzKB77wGQ==","shasum":"d2cbbd9f31f3b5ec2bbbb7d484b4de12db2e7cfe","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.18.tgz","fileCount":1169,"unpackedSize":22625609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOGbLCRA9TVsSAnZWagAAY70QAI0/eCMJlr4+Ly8FAvsW\nGu6aDv057WvkTlKm/KeVz9VWmb+UlJym9rgWTywO6GHm/z2bpdehifWrFaiJ\nQ9PDiwLOo6XEo5KiXo6BbJxbOFTrTtiQgn+/1tzeg7wrL1uS2zCtmzTzOf0c\n2EPbAJW0r+W6vpDUSUd2KTSV5xlgEmkA9DUMoxCK7+fKV/z4CoqEjUwsNEvp\ngsqsL3dgNEcly8dfsH+Efk6su0EiRdqp+H/dPq2YHWFyyX7wsKmUUfqYaLS0\n2t3uQ8hpXNmF3M0u0kjujNqSGAXXWliP30pKZtnoduPvtoIaTGW+TY3xemGQ\njuTQuD1AwszSOm0KYFsw/BvkLxwngjWOQ1hKCNGsFFVYWT3FiFq9ksOd5njH\nUW9zSRp55cdul2/vHpNTLVEFfTqX4OBVl83KNe6x9MP2uU/lAsEuAnw7Kazy\nyVF846256T5FlX5vlV0FA5Vnr60SiAcQS0p2FY239Hocr/6jMRUmRq2OqINS\n1M+n98+vrOqDCQ9vQ5lRt0s9MvytLmLxX7SgQmucyYnX1ZNN54c81K3pRZBj\n41ClX2X1wTObECQeTrNfVHkeIIM0S0bs2AUZifoCIM/6S0QpZ6SOlNPwRUaq\nPJmHhtWpo/CIwXXQ2mcIo93/E8OCbXMOSqe7LGF/+2FMOjtWVZ0dVKC/+FXn\ngz1H\r\n=vuk4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBjDPFEwW8eqetkTspPxf+lgUBAEpQxdHLPE3HET6lVSAiEA5LmFREuUdzEfePIErY0LbJxp4fRyUlDIarrxSCrO3jU="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.18_1547200202055_0.9586709433453393"},"_hasShrinkwrap":false},"3.0.0-pre.19":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.19","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0"},"gitHead":"6b87c110bfbc8ab039b01d7c249bb99182c81ffd","readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","_id":"i18n-behavior@3.0.0-pre.19","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"dist":{"integrity":"sha512-khg2htMNo0iLolyoKlBUfMyBnndc4OCnyc5Qf3WFRgZ9yYWFlt/c9wzVp8RIFDCr+Y1kJooSR8c5TI/cq+qg4g==","shasum":"17376cc037ec496a83c9c7fd73bd73ef83da1c71","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.19.tgz","fileCount":1169,"unpackedSize":22625600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPzHNCRA9TVsSAnZWagAAsmwP/R6NG0W2g9u9bixXIUUh\ngRvBc/DlfOosAt1sX/3yvB6lDgNj2reMuFRQO2BnB8jTTfRhM4qVvn9l/pCb\nmiYjv9SrOEvPgRUbjaJGVdR/txtDkxZ4v3eVZyfU05T89s2aE4XKnKPkegBZ\nnoPnkmqPP2mKIKDzOIoWbfyn7ndn3Zrar6vBcYcrI0Hkx0FGoO9YJ9a0+fQ/\nTcEZpr4qjCMJMyWsdVJxmlgK47xvoqQggari9KQcCE+MGk1d/ENwLZITTwuF\nSokVt8JAabdJnkxHbeNlQFQlarEPQvRC8bPpKyPWBwXKbPSN5Bun2aCGztJ+\nJo8dlP4NKHlSx5nv+iVU6lsLH+VpfbWcIpRQjYsYZ2G0SlPp1iaWLpe0WZ6s\nBL9hb1VhLVT10JHhHg7CinC08Zotnig7QoPo6m11m0Iwd8hcC8N1CGTngosO\nFUgZja76iO225ZitAhAo0cruolM2xuf+kdda2NzuOnXU2k1TOEaXTQQq6Gge\nuYF0DvI4ALojiUOy+wN9zsbN/j2Skta9gVfmBxWCtezAUaE+fVUxJg68Nh27\nw09tlJwJWCkmx5b0ASjuE7mGP0uMRmt5wtFBT2qylPdd4Lc6glzbfiG62EN3\nDJAyS4SbIDteFtO6lHfvKwrg7XvlbukQ+nVKZJH5A9AXTnOMmzV1Go/bLsfy\nqdg8\r\n=ojLP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHnyEisAy+APxxnp9iV68XsncCuUomq+DtpUHI8SDVOiAiB3hmDN4abmQyPPdYFOAggC6g7a9iAlnF+HbImd5zPUxg=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.19_1547645388296_0.026472278038738084"},"_hasShrinkwrap":false},"3.0.0-pre.20":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.20","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"4d23820c05f3630d8184eff5aa1bcbc9320195a8","_id":"i18n-behavior@3.0.0-pre.20","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-Y4fxsMbT/PDz9RfpqplkMeuPZEDFxhVMJUlPsWQFrEUYhNxFQGC0BEXmg/acH+fhpOYtHEtIj+3uXY1nLdVwIg==","shasum":"b172b1dfa74f0f5a23cc684d9eb0399e25157df2","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.20.tgz","fileCount":1170,"unpackedSize":22651058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQyVkCRA9TVsSAnZWagAA8noP/RnR4ajaGtEN70bYKWDI\nq6NG6H2Zf/GHtbbw9IzBeiGvXRtMZdapNCABITLk0pjs3PL7/Q5BjoZYWdu8\nwed4k136q2qE1aPe4Fb/pcHcYPSiCu6hjalv/uRKzl9MkiMbXvGN9YTXfVNT\nMGANF/3RX7wzwFUGze/l05mF3KYBlA+WwXzrso608sxd8d1acrHvDkZcQ1ss\n7vx/BExFpIaE7bel8t90GFssZOO5EkhMrHxZuuLeUU4WqsjkSKzi9HWiseL5\nc0NHAY52/Sjecr6lUJRbp8jwlRJQbIpYjd+8qs4utWqJNqWBaN3O+j/UylpH\nb0tmjj7VvB2lCIlCpwkV32Fta+LQ3N9ODmo0bz5C26oloq3HIoAv3WLtVxnU\nmcYdqU6184diVDB4Hz9ZU9+1Xpb2jnADURUJU2xhfIUzFhBEaWPoPuDVBD0K\nemkcsV3N0dWaFwB30ZAmwyllOjVjVQ09IVOJYK1pYj+JYM/haSasFveNjRwe\nUIHYjw9OnMnVRNPqQfiIlVK/9n+qZBqihQekKPGHA9HPyV/GkJiy9ZBzXz7s\nY2xRhyJ3ojiCr9fNytF9+xShzO7bd7f/15gEAYPhMqrHWVKRJryjJqOgIJFw\n4WEHrLFBaQaFUEyzOBTvN4fqOfJt1hpRFsjlpLtHQLTq1cYDMWPpqyebbRPo\n0C+S\r\n=fgSc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4atktoC97ssyB1N/d6mfglDGUYk8VF2m8wi+0/norQAiA/nIyZFANU8d/hBQ+R3w36uaejnokGoX1yypB8t0Lk/w=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.20_1547904355815_0.8309295491550255"},"_hasShrinkwrap":false},"3.0.0-pre.21":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.21","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"7d5926d5cd675bc26e0939ffd1942e649a31c081","_id":"i18n-behavior@3.0.0-pre.21","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-OZ8gU9aLC0PHRlONfb9oyJSIjCvAu9ZwztYAIzwYIlVDp9QpASSD8E2+NHYxnfz2wlFmhju16jyK1/CGTnIlhA==","shasum":"5b1a2399fb7b85004ebe7277a853c0977c0fcb40","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.21.tgz","fileCount":1170,"unpackedSize":22659349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRB3JCRA9TVsSAnZWagAAKm0P/ii5HaPc3b2L1+xBOQjQ\nC8fpUwaoesWZ5hRF2HhhNaNqEWUiyC7LCV2xUt0mB5twuq9WCcedJxyD3oyP\nc4WoVJzqhs6Dq2BBRuUHGvjavLA/y4NwjWoVGj0+Q6kkOo4Rsn8fypp0cnqF\nB0ep9TCU6EvApw8xbP+nPsqdxv3mtQH+W7HmjTs8rxlZuUBJ4Q5hPCuAADfr\nWPWEEKWJVmoPbCJptrrTrcCXtoK94o8bg2wVIcGvVW4d4sdpA0CbHnIRHuQE\nLI0QiW+ltUHqfstynbgBVzVOoH4oPXylGYJRYvCr0GojD2M4AYEnXaAoec+K\naiQHEyt0AjMikK+suL5M9//dRgJ/4wFDe8LWAIc9iwrjKvqpZC+zN/VzUNc7\nj/JklpgIxFdkquOENtFbpHSBGacNiRw+rGMUKF3k0cbDMKqqRbg6x3rS7bVx\nL0LK6X0M2fn4OhT1UFLNTLWPKRmsXhIO3T4YeRuA8RBm5iqd1v7Hgyi5y2bI\nIHt6DGZzZ8c3jubdiaxAjNc+KQNbaAI9iWABAOdNwBXy0S9RWa8ZJdOarIvv\ne4/9w6iO+JFNiBXdOknYrBZe4UzeUrwouB68s47Qi4i5rcdAmxbG4yCErVO3\ndnz/bP5nHGAv+q5zPOArqT7f7BoqS+WGGnmw66mVbxvINiNOpPxoft4aV4h4\nbeQn\r\n=aYZu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVcq2gNJ9P0rfhyVYHhHp1S1lOFq/tL7gaWiw4LXS96QIhAPsT/Ybovj1nfKL3zwFajHTiX55xIFEDSoePKay+3RLM"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.21_1547967944988_0.9616468627182093"},"_hasShrinkwrap":false},"3.0.0-pre.22":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.22","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0"},"gitHead":"85ecb4b4741dc71c9f8d568ed9db3e590dd07913","readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","_id":"i18n-behavior@3.0.0-pre.22","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-+vlwAK3rtu0dVkdqrzIfX+0or8i/gFmv5aBmiL6kmH7inNb0ZLww1crPuXcw3WD96Oyas/46ur77x4KE2tn11w==","shasum":"4a650920ff6ddcd402621f1a781631a9c3da54c9","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.22.tgz","fileCount":1170,"unpackedSize":22660830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRttSCRA9TVsSAnZWagAAslIP+gLVZGev5bS1N5VM91s7\nmtYVHMkNAzyTAdvHRbLPaSh1nqEatwsYXJOUb8WUj54eCXbGnO8jnGXlLQrA\nqXkcz0fXNiCS+tfUNYluZeSZ2kdVkF71kt4um8z9jTgFQTd8UVmMmaUFREEe\nG8pCL0c+eYg/z+NRGwojWnPzniqZmUSJEc02IUPMXdoXjMVBO4KrsEh8Ld+Y\ntI/Du/UfB8Df/KSM4IXfiLbDIP2jM+xi1LGhTARGxQ3PTkLR1l8DjGEXilCe\n0c7QS0d9366hLvlhS2e/Ny1oEjbUatp/PObDTg+6jTMDeC+CiihIJrcGdGlc\nK5nDL79cKvYr0J4qJpYnLRS4c3qNVf354fBvBAXmYxrJkl8UnVgcQM011db6\nQxN8EH/+wxxUE8R7ehvDPq12YvcPSoLSrvLMMstXb3bhQ3ZzQsX07nsr6ATG\nYrQPTVqvZ2rMaNUXlUkGqJkZdTjluvhLS4wjVtBBN+qgrDjGufRdbmCe+P1q\nVdsoF0GRPfd6Y+bnNXyX8+SduQV9HiRhaEvzxMDbf7AknA4VF8U9e2EgAU/f\nCwanthF9SFbCvNme5CGgYI0Z5OZnhRcCL7YhyWLr3dgJm+sna+M6N5/UuNmN\nf3o7AYNo8LNgl3Q7ND3VfrCYFY7v1sQbucP1en9ac4kHjNxE/UeCjMKewD6X\nhpyb\r\n=4pHt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbaUcChBQJgPtdoj3lBkD8iFKvu2pie4yH06Jn6c/1DAiEA14MpyTQEjWV9tpvplcxoQ9xelBMHWSw2nYeL+L5kmMc="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.22_1548147537716_0.48559788542451576"},"_hasShrinkwrap":false},"3.0.0-pre.23":{"description":"Instant and Modular I18N for Polymer","keywords":["polymer","polymer3","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.23","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master&build=157)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n[![Bower](https://img.shields.io/bower/v/i18n-behavior.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N for Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/demo/), and [Test](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/) on GitHub Pages (https://t2ym.github.io/i18n-behavior)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n\n# Releases\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- (Work in progress)[live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\nPolyfilled by [`webcomponents-lite.js`](https://github.com/webcomponents/webcomponentsjs)\n\n### Polymer 2.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 11  | Safari 9+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n__ES5 transpilation of Polymer 2.x library is required for non-ES6-ready browsers.__\n\n### Polymer 1.x\n\n| DOM       | Chrome* | Firefox* | Edge 13+  | IE 10+ | Safari 7+ | Chrome Android* | Mobile Safari* | Opera* |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n `*` latest versions\n\n## Install\n\n```\n    bower install --save i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [polymer-starter-kit-i18n](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n## Import\n\n```html\n    <link rel=\"import\" href=\"/path/to/bower_components/i18n-behavior/i18n-behavior.html\">\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n```html\n    <dom-module id=\"custom-element\">\n      <template>\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      </template>\n      <script>\n        Polymer({\n          is: 'custom-element',\n          behaviors: [\n            BehaviorsStore.I18nBehavior // Add this line for I18N\n          ]\n        });\n      </script>\n    </dom-module>\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Changelogs\n\n#### Stable Release 2.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [0.0.66](https://github.com/t2ym/live-localizer/releases/tag/0.0.66) | L10N widget (WIP) |\n\n##### Highlights\n\n  * [Shown above](#stable-release-200)\n\n#### Stable Release 1.1.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n#### Stable Release 1.0.0\n\n##### Modules\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n##### Highlights\n\n  * [Shown above](#stable-release-100)\n\n##### Known Limitation\n\n  * On Safari 7, `lang` property cannot be bound as `{{lang}}` or `{{f(lang)}}` due to the root cause of [Issue #36](https://github.com/t2ym/i18n-behavior/issues/36). The property `effectiveLang` can be safely used instead.\n\n#### Pre-Release 0.0.1 - 0.0.60\n\n  * Implement core features\n  * Bug fixes\n  * Comprehensive test suites\n  * Basic demos\n\n## Quick Tour\n\n### Quick deployment of [`polymer-starter-kit-i18n`](https://github.com/t2ym/polymer-starter-kit-i18n)\n\n```\n    npm install -g polymer-cli\n    npm install -g generator-polymer-init-i18n-starter-kit\n    mkdir i18n-starter-kit\n    cd i18n-starter-kit\n    polymer init i18n-starter-kit\n    # Add Locales\n    npm run build locales -- --targets=\"de es fr ja zh-Hans\"\n    # Build\n    npm run build\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Build and Merge Translation\n    npm run build\n    # App with Run-time I18N on http://localhost:8080\n    polymer serve\n    # App with Build-time I18N on http://localhost:8080\n    polymer serve build/bundled\n```\n\n### Change language\n\n##### 1. Press F12 to open debugger console on the browser\n\n##### 2. Navigate to the elements or DOM tab in the debugger\n\n##### 3. Change `lang` attribute of `html` element from \"en\" to other locales such as \"ja\"\n\n```html\n    <html lang=\"ja\">\n```\n\n### Update UI strings\n\n##### 1. Change any UI strings in the following HTMLs\n\n```\n    polymer-starter-kit-i18n/src/*.html\n```\n\n##### 2. Merge changes into JSON files\n\n```\n    cd polymer-starter-kit-i18n\n    npm run build\n```\n\n##### 3. Check diffs\n\n```\n    git diff\n```\n\n## Testing\n\n### Test Suites\n\n| Test Suites (`*-test.html`) | Description                 |\n|:----------------------------|:----------------------------|\n| basic                       | Basic functionalities       |\n| edge-case                   | Edge cases                  |\n| multiple-case               | Multiple element cases      |\n| template-default-lang       | `templateDefaultLang` tests |\n| preference                  | `i18n-preference` tests     |\n| no-persist                  | `i18n-preference` tests     |\n\n### Test on Build Phases\n\n| Build Phases      | UI Strings | L10N JSON            | HTML                    | JavaScript                   |\n|:------------------|:-----------|:---------------------|:------------------------|:-----------------------------|\n| src(-lite)        | Hard-coded | Modular              | Modular                 | HTML Embedded                |\n| preprocess(-lite) | Extracted  | Modular              | Modular                 | HTML Embedded                |\n| vulcanize(-lite)  | Extracted  | Bundled              | Vulcanized              | HTML Embedded and Vulcanized |\n| minify(-lite)     | Extracted  | Bundled and Minified | Vulcanized and Minified | Concatenated and Obfuscated  |\n\n### Notes on Test Suites\n  \n- lite means polyfilled by `webcomponents-lite.min.js`\n- Both Shady DOM and Shadow DOM are tested on Chrome browser.\n\n### Online Test\n\nAvailable at https://t2ym.github.io/i18n-behavior/components/i18n-behavior/test/\n\n### Rebuild Test Suites\n\nRebuild [preprocessed](https://github.com/t2ym/gulp-i18n-preprocess), [vulcanized](https://github.com/Polymer/vulcanize), and minified test suites by the following commmand.\n\n```sh\n    gulp pretest\n```\n\n### Local/Remote Browsers Test\n\nThese `test:*` tasks perform the `pretest` task as a dependency.\n\n```sh\n    gulp test:local  # local browsers; Chrome and Firefox are preset in wct.conf.json\n    gulp test:remote # remote browsers on Sauce Labs; Edge, IE10/11, Safari 7/8/9 are preset in wct.conf.json\n```\n\n## Contributing\n\n- Issue Reports, Feature Requests, and Pull Requests\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"d321c1bccbc8350f2fa84c33b4f85622fabc514d","_id":"i18n-behavior@3.0.0-pre.23","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-3n2cTJtYbXq13dNitEivwNSpkhA0t/wE/xC3jw/d5MKOmJ7iT/0xueb7HIx0rz/tRaKy3RN/Lwe4IEO4T4h2xw==","shasum":"3d88be6acd58a7c3b02d9b8844e11ac8aae6039d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.23.tgz","fileCount":1170,"unpackedSize":22638536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVFtqCRA9TVsSAnZWagAAPDwP/iWjNF2UvdqTqQSbF779\n619uJfPPL64CcnZUifRoxsFV+i3DfglQ6kwB6InYKJc6AQYo0i18r+9Lvuez\ni0p/f958SGsTarzAHcooTITh7rD/aUHa99he3/iuWR4Qg1kba3cRrcq6rr3C\ndOtIOlJpP3Nf9ZnHqw78A7uSluIeZ9Ck4pXLrzYdE0dgNZrIBDQ404OmbFdq\nWkwqJGQKEcy1kEJemY4FjkhhFF6zeVKuof0k9mQ3IroSS8mb60OlNb6k0EWF\nz/H+aBly78f84NIf8mw8DG/DJUiW8ih3ooj/cMkQfP+SOwlE6pQgVMXABsWP\nVqIZJ8gu06Iqqa3KIwyTA9KIhPfJKwYNpc6Y56cZmw82E2v/dfu56yWBYITO\nAW2VO4Vt5/XUKhaoxDl+htinXD8kfOynLbzm/CygsW2HfANXFSnbzfow2sTE\nktOXDJ0Al35BwAXkqh4iR9/HV+pmIHRjSwpaVOWShKWh5ZVLchUCK2NiJzuS\nh+nhvReYWw1p/FNEGwwNp2iSwlNDH44e1TKP+st7cKEOCCNG0X0lazaOX5xr\ncsxXTki3Gj085s+PGJaJkY6R8TorEevQQFsAZC/9HA59pN0rD7IA6bsPKKMs\nR47ioLo40qiBvu7fkVFXlBJYAzGqo7wZgvzeTtUtODDQVpPFQcohOCI4m+oX\ndjw2\r\n=8u1u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCK61M73L1893Xr9w2fhw1N2XjMFIyT3P8azVDzFlgLXwIgPMImM2A4UJrcJ5bzAxGAydHS1pust1Z4p5mzRjL5Dd0="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.23_1549032298149_0.4246362050293846"},"_hasShrinkwrap":false},"3.0.0-pre.24":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-pre.24","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N framework for lit-html and Polymer\n\n[API Docs](https://t2ym.github.io/i18n-behavior/), [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/i18n-behavior.gif\" width=\"768px\">\n\n## Conceptual Workflow\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Browser Compatibility\n\n### Polymer 3.x & lit-html with the help of `i18n-element`\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n[Quick Tour](#quick-tour) with [I18N-ready pwa-starter-kit](https://github.com/t2ym/pwa-starter-kit)\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Usage\n\n### Run-time Automatic I18N (for development)\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior` for run-time automatic I18N.\n\n#### Source Code:\n\n- Note: [`i18n-element`](https://www.npmjs.com/package/i18n-element) package wraps `i18n-behavior` to support `lit-html` and Polymer class syntax\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration: \n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property:\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property:\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON:\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N (for production)\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## Compatible Versions\n\n| i18n-behavior | i18n-element | Polymer | lit-html |\n|:--------------|:-------------|:--------|:---------|\n| 3             | 3            | 3       | 1        |\n| 2             | 2            | 1-2     | -        |\n| 1             | -            | 1       | -        |\n\n## Quick Tour\n\n### Quick deployment of [I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Changelogs\n\n## Next Release 3.0.0\n\n- Support Polymer 3.x with ES modules with the help of [`i18n-element`](https://www.npmjs.com/package/i18n-element)\n- Support `lit-html` with the help of [`i18n-element`](https://www.npmjs.com/package/i18n-element)\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm | [3.0.0](https://github.com/t2ym/i18n-element/releases/tag/3.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm | [3.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/3.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm | [3.0.0](https://github.com/t2ym/i18n-format/releases/tag/3.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm | [3.0.1](https://github.com/t2ym/i18n-number/releases/tag/3.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.4](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.4) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.1](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.1) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.12](https://github.com/t2ym/xliff-conv/releases/tag/1.0.12) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm | [3.0.0](https://github.com/t2ym/live-localizer/releases/tag/3.0.0) | L10N widget |\n\n## Stable Release 2.0.0\n\n- Hybrid support of Polymer 1.x/2.x in the legacy syntax\n- [i18n-element](https://github.com/t2ym/i18n-element) I18N base element class for Polymer 2.x\n- [live-localizer](https://github.com/t2ym/live-localizer) L10N widget\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-element](https://github.com/t2ym/i18n-element) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-element/releases/tag/2.0.0) | I18N base element class |\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/2.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | npm/bower | [2.0.0](https://github.com/t2ym/i18n-format/releases/tag/2.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | npm/bower | [2.0.2](https://github.com/t2ym/i18n-number/releases/tag/2.0.2) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.2.3](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.2.3) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.1.3](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.1.3) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.10](https://github.com/t2ym/xliff-conv/releases/tag/1.0.10) | XLIFF/JSON converter |\n| [live-localizer](https://github.com/t2ym/live-localizer) | npm/bower | [2.0.1](https://github.com/t2ym/live-localizer/releases/tag/2.0.1) | L10N widget (WIP) |\n\n## Stable Release 1.1.0\n\n- XLIFF import/export support with [xliff-conv](https://github.com/t2ym/xliff-conv) converter\n- Experimental [Polymer CLI pre-release 0.11.1](https://www.polymer-project.org/1.0/docs/tools/polymer-cli) support with [I18N task integration](https://github.com/t2ym/gulp-i18n-preprocess#integrate-with-polymer-cli-project-templates-highly-experimental), based on a private API\n- [Selective I18N-target attribute](https://github.com/t2ym/i18n-behavior/issues/42) support via [`<i18n-attr-repo>` element](https://github.com/t2ym/i18n-behavior/issues/40)\n- [Compound bindings](https://github.com/t2ym/i18n-behavior/issues/46) support for I18N-target attributes\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.1.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.1.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.1](https://github.com/t2ym/i18n-number/releases/tag/1.0.1) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.1.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.1.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.13](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.13) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n| [xliff-conv](https://github.com/t2ym/xliff-conv) | npm/bower | [1.0.1](https://github.com/t2ym/xliff-conv/releases/tag/1.0.1) | XLIFF/JSON converter |\n\n## Stable Release 1.0.0\n\n- Instant I18N by one line addition of `I18nBehavior`\n- Minimal or no overhead for development: Run-time automatic extraction of hard-coded UI text strings from HTML templates\n- Optimal for production: Build-time automatic extraction and bundling of hard-coded UI text strings from HTML templates by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) preprocessor\n- Modular (per element) JSON support for storing and fetching localized UI text strings\n- Bundled (per app) JSON support for storing and fetching localized UI text strings\n- Automatic application of [`<i18n-format>`](https://github.com/t2ym/i18n-format) with [Unicode CLDR plural rules](http://cldr.unicode.org/index/cldr-spec/plural-rules) and Gender support\n- [Polymer 1.2.0](https://www.polymer-project.org/1.0/docs/release-notes.html#release-120httpsgithubcompolymerpolymertreev120-2015-10-22)'s [Compound Bindings](https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#compound-bindings) support with [`<i18n-format>`](https://github.com/t2ym/i18n-format)\n- `i18n-dom-bind` template instead of `dom-bind` for instant I18N of bound templates\n- Dynamic on-demand fetching of localized UI text strings from JSON under `locales` directories\n- Real-time observation of `<html lang>` attribute value for UI text localization\n- Robust fallback of missing UI text strings to parent locales and finally to the default locale (e.g. \"fr-CA\" -> \"fr\" -> \"en\") with practical [BCP47](https://tools.ietf.org/html/bcp47) support\n- `this.text` dynamic object shared among the same custom element to access localized strings\n- `this.model` object deepcopied from `this.text.model` object per instance to access localized attribute strings\n- [`i18n-attr-repo`](https://t2ym.github.io/i18n-behavior/components/i18n-behavior/#i18n-attr-repo) to maintain repository of I18N target attributes\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to merge changes in the default language in HTML templates into localized JSON resources.\n- [`gulp-i18n-leverage`](https://github.com/t2ym/gulp-i18n-leverage) filter to put meta infomation, that is, L10N \"TO DO\" list, for the merged changes in JSON resources\n- Option to define I18N target strings manually by `<json-data>` elements\n\n| Module        | Packager | Version | Description |\n|:--------------|:---------|:--------|:------------|\n| [i18n-behavior](https://github.com/t2ym/i18n-behavior) | bower | [1.0.0](https://github.com/t2ym/i18n-behavior/releases/tag/1.0.0) | Run-time I18N handler |\n| [i18n-format](https://github.com/t2ym/i18n-format) | bower | [1.0.0](https://github.com/t2ym/i18n-format/releases/tag/1.0.0) | I18N text formatter |\n| [i18n-number](https://github.com/t2ym/i18n-number) | bower | [1.0.0](https://github.com/t2ym/i18n-number/releases/tag/1.0.0) | I18N number formatter |\n| [gulp-i18n-preprocess](https://github.com/t2ym/gulp-i18n-preprocess) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-preprocess/releases/tag/1.0.0) | Build-time I18N preprocessor |\n| [gulp-i18n-leverage](https://github.com/t2ym/gulp-i18n-leverage) | npm | [1.0.0](https://github.com/t2ym/gulp-i18n-leverage/releases/tag/1.0.0) | L10N JSON updater |\n| [gulp-i18n-add-locales](https://github.com/t2ym/gulp-i18n-add-locales) | npm | [0.1.0](https://github.com/t2ym/gulp-i18n-add-locales/releases/tag/0.1.0) | L10N JSON placeholder generator |\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"7b54e310c197aa592f8e86ce0f9ce0e5a56b8900","_id":"i18n-behavior@3.0.0-pre.24","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-4EC5yTh4R+dbTgVBc9QOAdGQL3LWVvt68Wv9+7qaOM/Afne1MIiG7RWxMWI3vrGNn5KnJ0aS6qatXnVr1sIIMA==","shasum":"a04de47d449b26a1e5b11279964d180a245f71d8","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-pre.24.tgz","fileCount":1172,"unpackedSize":22757316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVZJsCRA9TVsSAnZWagAAEA0QAIcmkspHswZQ8/3W/dtO\njHGves5LRFfBQ960ufLZUJwxtDX/74dfzLRP9oE90MROyHugvc24k0o5wcal\nN74JKJu45+b7meYxx+CGeRlU2epujGUU0vI74NqJbfdFTGT/a3Jlo2femGCF\n01TAgdLfM6t6El7V31kMS0oguKKuyyuu8J4MqIBLd7NZwfxlM+j7X6M6mZ8M\naz/PNslQhu890tC+Y5ZmGwW+xwC2TKmPAZooddUfXi13acb5b04uTGGkwXdQ\nxXBerVUb69N6/Ysx6fakvdnLXrmTN6xdaPNc+abegQe5zMdFipcjUwB/Gf5Q\n3/d3prT65WT+Xuijwo5b1fN3A0ZxZC67rNwec8m2v1EeQIe9Ay9PJMq9zZ6W\nYwL7kc8bjxZODbE+5R6/fsSAw1pZqRHxLG6HDfUJ6ZAoJWusr5IIRsJ17P6/\nfo3rHlAtSJ0AKyXglGg2p9oADsZ77o9eE/c4BB9fKy1BqZIU/0lDJ23zzmjN\n72pmqH8T+SxY/hMzLmSy9nTg71IeejmOqMAxMuJ2LPbQlyJQyCzFe4rSpmBn\n8WcuCAb39eUYqTT8yUCu1MfgaZInQYPafPbYddJdiEhWopJUhm1x/GfJWpVj\niVkM7qRqIo96mVIUS8xDU4FzkoTV+XCu4dmt1rLLO8aT8ce1f2qi0BBJROGN\nHjz7\r\n=vhfG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmnXGdaJE2EckNeMdkkzDPfcWdE3lLYSl4ystBY117JQIgVmQhWRkVNcPVZgdF4sx4ENTseoqkPN73aTORbwEBRek="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-pre.24_1549111915944_0.1028147417857459"},"_hasShrinkwrap":false},"3.0.0-rc.1":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-rc.1","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.1"},"gitHead":"ad9b0d0b67be31d5ea99d1b7c739ce8317d336a2","_id":"i18n-behavior@3.0.0-rc.1","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-d5nO2Qfe1J78cIVCJFGSLXnMRUSPnbmmMdgVZUUQMhrw3lWFKz6yQh8EL4TItjb7cbTvnpDM2GhhAouNGg0CWA==","shasum":"3c8e739b7ded6d2482a84a0d06745b503f20f3e9","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-rc.1.tgz","fileCount":1173,"unpackedSize":22698519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXRRDCRA9TVsSAnZWagAAOKMP/iNIiQNbAwXiPXDvhTFN\nUe2+frLoeyvHcH0YCdHCBrrhJ8X+Xlxpu2ybKJFVidtYI2onI7HigTLrMB/V\nIyAq8gskLe5M299PITGi/Oy18VNaa9aSmN0fDzfUkIpIJcfhQgO4gx46xDDl\ngwFL92f6eyICiyCSQOxITnfKKkjAvbuhG8L8z23tzv2eCJiX5h1CGNOalh29\n9MM/Ve+GmQ1fG0P3FXFM0uLcIj82lArsbqWQzYSKQDUhFDyfnRcek+EWkMsD\noNHvpRSh1pZlxOWnFoifanrvGBb2p8SIid5pxBAof5ppc1eEEZqXUZZne07o\nCH00hAaWgbmpjYezbH5gyFws+8ldIcvdbcZfCVDfQYBtGNCvT0AYx8Pflk4t\njBsU/yYaVDQj/B2chv2fuTnIY4KFaV9lAoFX+tTuqTnypG45sEL7BMLZK97G\nwqILxvn5SVGh+cU4ve6plgsKpbhrCcVQnrQ6qr/w5NtuSVjgPEMU8/Jpe1y6\nF3VbGq1lBw0w2ThXCccpJePQTA0zynE4GUihQ72717stM0RE5QVN5UPlg0xv\ne+iGEP6XsUMFCwbXdipvLiJOcK0mEc/MsOTJB9apHMAa+KeN49mmq6Ol6bZm\nU35/7BvuHLgRIuzL80l6QYAsX22bVoRRCYzBvjnz/EWrHnNNYZTQp6ndp2kE\nzQAd\r\n=KF+q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlSM9jZFXm+akpYg92mSuGUGgQQ1VSuwCaBRHz6kgIzAiEAhDWu6/2y4K1f68Srmze9aUb6WecwRWLFIgwq/GD38A8="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-rc.1_1549603906496_0.7658949161890729"},"_hasShrinkwrap":false},"3.0.0-rc.2":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-rc.2","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.1"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"5983fbd2a539b4117b6c5c0f33b11e638553cfd9","_id":"i18n-behavior@3.0.0-rc.2","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-4q4/A94R7lM7D9B6XZXWvAY5vmwkfcxth1ihOH3L3WBAPpBd4eQWZ2BihkgwYGJaew2MIGo1TroSNOjHFrqKxw==","shasum":"0f8876fa1181119e2fc87366cf557b1533e4ab3d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-rc.2.tgz","fileCount":1173,"unpackedSize":22699624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYTEpCRA9TVsSAnZWagAAyX0P/0UwjUcGwCSUgDhzP72n\n+coMXoSucjZkepx4a4zX/W9RpH69HEWmr51vQmjaQXCdzobpe6uOzpeusK92\nGkfiNUTltQU/YB3ISQOluCExy01BEBk84DwRs5TUinAHT5eEcjCsL4sY3ry7\nOMkSeo4qRrn1kChMp341uINdAGv0+yKw5bP9kjLqxaUalyUzO9PAwMdAAjP+\nE7pxK+Fjh1KnJDcrdePxc1QA4SO7wAGVnq5JYmj7Rj429aADPinCGxsE8qyL\n0YUzYu3MHoEJIyQPXnW23/IdEKNakCjQIDTIldBDGfYjCtywr+QM3DhqpwAK\nYo6fkVGKFv+GALWFgaLI00RqI+tbnddP+RLOy49+EvhsQ819TLIBZCGgamHQ\nbLytkOyAi+0pv5dfuy5iWzJg2dcO20VXdIGmFDCMtPA/wXgTtPG0fM/fT0ia\n2D+iF5EbzcsPbp+eRtiGokWommoijsGKR9yWrVW1yODGkdyGOOCo0Q31TlAG\nSRATog3jaaqxVz36rF6ffIQndW6Q8UNS6HPll+YzB/P6EkAb1h5SGkjt0rYi\ngOqenfWKIS/e5yzdErCjpM8cQRo0y7IyXkEKchzkFNVj3LkgF9Or3RrMdciH\nI2EUz/v6sKhBXY5LuXkEYxJx3cV8a544iN12t/uvoaz/P5tyHs6D8xWMwbuW\n6CCV\r\n=6jNt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0RPbpkWhzbg5j1vMwMEodoKhixnPVG0wv/4V0gX1aHgIgD365lTsCX86xz1EcwPjeZgjf42V0uokcw8+J+Jq4SeQ="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-rc.2_1549873449287_0.5542305008799127"},"_hasShrinkwrap":false},"3.0.0-rc.3":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0-rc.3","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.1"},"gitHead":"b09d29c0adbb4045d6bdededf133bc6f086bc400","_id":"i18n-behavior@3.0.0-rc.3","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-OPxfKbuXFuTd7oZ6MBGeFiF+NjPdybPEe28jmBgoNTLswEiQ6mnvyCK/UyriiBVwD8JliyQCsBkQKITyFBUtDg==","shasum":"8dec6a955f9935094c21400e2c8d0a69b9ccb6fb","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0-rc.3.tgz","fileCount":1173,"unpackedSize":22699676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccoeoCRA9TVsSAnZWagAAMmwP/A+rayfeBs7TcZj924A+\nnpzwEKfuQ/Vwk46pWv3vO1BUrC0UTkqEeh4jxJq8V2Kj+MlemOG39f1v/iF5\ndhDp1UjiiMWIuUlC+ELiJ+ZTEFQpoPpOphU+UpEF5o2D6tiBiDCAhQtTP7DR\niOXLlJRUe9beOGCBnD7u0qiUE3OCkJd6LTeJ3mVda+vOSmFG7QTK1U3Zljyd\nDw/l8PTYeY5q2laLj56zoaCAmMMRxdbmvxM1J0W1zl+X6hI5gYWBQVNhuk+V\nMirrR4Sc1cPGdOm4+HQrk8xTkhvIid1LDdK1FR93gEsRWaIptawCZAhp2QCN\nCk9LEHQVY1SOa/5dF6ctsZBLkeYCvBWIlIfOj8KAd4Ttkigk01Z89al9d4YZ\nMlxGuQ7oEgLU+xniyqHmFyG5AeOpISieMBp842GwFwKKt6znyviuscMoeQk+\nrF1jCKhwzTQLKE+iMK9pRUJDJ3MsHdn36GBK/MPWZ0B/FJ0XdWlnCWofujaY\nqNKSw4Yn9ELD8SeeRie/rLr0ouf6pOiuQWJy02wn8vqZKcZ6M5IAADiBKt7y\nRBw4fJdDyE+DPMoCZRjwpxd67uIdxBtA8cjdDxC69cSyW/qE8bkS2M2mNDlT\nMVW5DRNDWUI29ksaWDB3h5cqr8brgBqu+tisyPmRjTc2GfQsfTkwu4NcXF6u\n83Am\r\n=bdjR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEI26rqKYmbob8pYSyFNusqMBJCDoeQeRr7owOIOy7s5AiB/xsPE2NoJmyKl80Dt4Gnw5a/UoEyOQ+C3oLIOvn/bAg=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0-rc.3_1551009704018_0.26949311622634564"},"_hasShrinkwrap":false},"3.0.0":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"3.0.0","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^3.0.1"},"gitHead":"ed466d6a50465de5a979a7d6463277de82df34d1","_id":"i18n-behavior@3.0.0","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-Q6Uk/GXGvBh1/58iPw+5sl3faFrkX7NTOyisDeJC0iEGIkpUv48xgBnFoKybMRCXJdFPJhwVELF/RJdr0CpFRw==","shasum":"bc669a2a2ecd21864507eb83d9ebb708b5207502","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-3.0.0.tgz","fileCount":1173,"unpackedSize":22699671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcco65CRA9TVsSAnZWagAAYAUP/i8tDvbyd/9PSSYoqyTU\nsmn3PsZ3R5gMdNfKi5Neo+yxK8jFRQEKQYPt44FVvrWhN26aCDQoPolYbNJD\nW+zxl2SkEVtwjQ9rqM1OmCo41f4D7zu/GonRKqBDTSK1AUNEgAiOGG8p8P42\ntjGLSt44hY4DdXB9va3Enwh4HpjcLKEDZKW/Kp7TxQhFOtiIG8OHWXH6yZJk\nY76SPW4LZGOl6lMreHWVhcBB+Ljvb9V1r+eyMGkIA/wDkVTmz4DGQEOYV0aR\nKpIQRBLe4EClytLO6bCjpcvATOQyAUpAs02Rwrq6vVXg5CjcbT1Ym8sr/ob4\n1hjcTzvffR29HOAptJyA1PpUa12D2wMrm7ULMB3k81G3vBSOtpfkha/vfG7K\noVuJj5Qb5lZfAG3Ff76MMI1Wd7/LjbJ8+EFBuDqhFX54KG38TV6JoQsWS/4J\nnAF57IdQTp9Kg564cGDKHlXdHipBwrKo7tQiT5A8KKv+lm7VoXffyvIuWsU7\nGBazYJSrJDgWZcVrh2CSjpTK+JeKQ+HjHqm3UoDL7p6Vf0SZzQOz98+USDcW\nHkmkdLJbnTkB9Yv5vR7OudpSEjMZgfts8FTzDP1DCyju3RizM5rSdqd/7a0S\nLMAsMQBhuE10+OzMyJh3ZS9U4/lpT8icRuk4CXV3EdllCGMmGMjYyWGuBgh3\nFgIo\r\n=yp3K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICN4gcGLifpzlr4Ql+cJwK227/C7O+kA6FEK/u2VRX+zAiBt1HpTcHGwAHH1O2AslrsYLQuQ59W1b6tRbEksb0KUow=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_3.0.0_1551011512514_0.9227156391744464"},"_hasShrinkwrap":false},"4.0.0-pre.1":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.1","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"729eb0f8bba3a82562ff68a160fb6702d185dba5","_id":"i18n-behavior@4.0.0-pre.1","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-UTSJjApJNDnS+EhNezBjDAdfzJS1zzu+J+Ydk50SCVhDsHywvg+9yLet2LWRmo1/Ecx89tFQLi/CqgMvxVI5AA==","shasum":"7f018f13b14c6c61101b7b4bc3d0d9d0e3d3a601","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.1.tgz","fileCount":1174,"unpackedSize":22701442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfNRhCRA9TVsSAnZWagAAXkIQAIRGJrVHWAVxuNpSS/wn\nsqQVgfSMlzsL50hAICASevws9omoyj6E+TWjm79ClhcIYwbjS5jvaBr3aVUL\nAxANKiB3bFkYNAaXJSBWXdiH7hlznc+MVklvA2CxrxeRqZIlFRgyPQe/4HUu\nA+n+9TOrvd/zIOBIwlqNH94BQby6EMfF9lRh+EvPbNN7uanlDDeJ301OoSJ8\nFrZVE0EO5zH3ymJ6p6dGKTT8kb13MSbHXKFMd6qTk6gwOfQNr+xm6Y7kUrqh\nc1uMZUd0c5EH8AYaa3+Nzb4En/am+/ThXaC3Q3zqpxSrwJe8k9AsC7FcUsCC\nilMhf0R7ZLSwyYzP0Q6LdTGjJZUzqw3HjxHpvBnzMi9RByxFgDyN0Ic8Cv+4\npyNh5j5kyPBV0PZ+ZnJILUfSuzucEAQqqHqYF/nafheMKsnrBsRnWpaFBh0W\nXv1J+7mLeSBN2WHRWEWE4csfzzHJ6zcVZSgZ1nMzJKKYOIBaqSzgnIMuYrg1\ndz1Wlp1mT5KcoQJkDoevpj/Ci1uvamok6o5A0wrccG6jup0bFoQBMfglVNs4\nL51UF1lrdNJqOkaEa1N7I+v3f9hvf/mCg8rLVwK+ssbE272j7mLnbWrp4CqX\nobgMNRbBPLes0EBqx4cQ+7lBTTrobikNb90g19gq5kjyKCfdlRREz24I3UYR\nFzbc\r\n=ZTzv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMIir8AvsiiPfXvs4S9GLtuWSR4/h2xlfygIfuQwFpDAiEA2vuAmUzaCO6dzlGXBc6XWm+ggQYYiwgtckM9nY1IBds="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.1_1551684704811_0.9524936942472801"},"_hasShrinkwrap":false},"4.0.0-pre.2":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.2","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"24632206025e6127190c8601e87f5624142594dc","_id":"i18n-behavior@4.0.0-pre.2","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-VRqwS0sQstAxx1UE3amLnTYBKK5JACmY+X0OkXvfvA2mlgL/MgTBrYLUL5a7mFkeel7Z1JquhccNoqMcha4Zcw==","shasum":"c7c8541de91cea212074d068084073a7e17134d5","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.2.tgz","fileCount":1174,"unpackedSize":22701442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfPF6CRA9TVsSAnZWagAACrcP/i4f2GCCRi2csR4JWqOq\nTnXSH6BjummHlCMiXkttb8sscpkk24u/mXSg2UXKZ0MUMj+dR0oM3DoSTElA\n78AwDorQji2zfPDIl6lWQSV0CBZmI6mmWZM5G6Ee2OQ/BiXR687qoXfZamrv\nKU7GMS16ACfvh/17eXns0p9BDONUJhszvxPJXAe7RkjtZyNpGV5Id/5Nrd/g\ncsAlXLhfHRVuuK1QWYIqZ7uUcwu/hloheEkYeubIB9qMGE+t1H8p289JvTUZ\nmmxJpa8R8YRbxn01AEw0tg+SUq2d7r/e5zQs1TaBu4ODDzUH4MZHctHghEmd\nE6cAQidbkobLp93vTayPyRrR2pp8Pkewr1eKQtmtOxKQgPH0T1aRfahEog9d\nFiL856wn+l+/RgDOMJNFtl18dAsUbKC9f+NItr6gBfUPZsfejhQRqB84Evfx\neaCnXasdIzpXnPMUjkw6dLK+t9uIyKxIJk0kS6B9zKhQfxQq5gPazj+A4jav\nd5a88RUV1l51fmSpvhmlSHxMLcx46sFmddYSNnFDr9it6VXn+WG1lfxkpwgC\n1qTXbymPyHKBQIoSen27prRyV2q+eE6wQVxO6ZK45HWzWcZUaBPcV1/eo/aE\nxOzR6teYu5Y/zoN/jwtAHONtxaUnjt/b0pqiUP59VCkww68HMBYwlBhUdwwN\n0Rgs\r\n=g6+B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBUbAJ7MQ9qnu5ITz81bSRydrnsZVpF8mYRdw/kdYrcDAiAKwhlVDNXCUh8n1lG48Ii1auGFjm4482w650idcEJNMQ=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.2_1551692153718_0.6039453134110617"},"_hasShrinkwrap":false},"4.0.0-pre.3":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.3","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"eb4d4d7f4bf7bc0c7b98e1dccd3a5dde78d94722","_id":"i18n-behavior@4.0.0-pre.3","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-W7pMmBivIqnD8v1iQDA7nYKinPJODDurfNh7QgCIzvMywzbICQGr59zoWN6C7JA6DUMg0hYg7P3GHj+yODp3FQ==","shasum":"99708f7bf4d9a367495ef8164c3a3175a317af78","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.3.tgz","fileCount":1174,"unpackedSize":22701442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfTP0CRA9TVsSAnZWagAA0ogP/1E10AW/Flnj91K47uHS\nxMJQfuZEOsxCKO3ShsY2jfNo47/OcDdPBHUIBGMdchhwqwpllIMLSUpoGYCh\nkHK00clfVn1brcTzMwWbzr+XamHz+AO+KRKgLbYr/GPGt6fLXDUdsn1ZHMHT\ny36G65MKvS+3twTk4yyaNljgINxHx8JL9cE7evdEAbysgs2V62MqgVCIjZ0Y\n8lLBfCj/azbbpEP4MsWDn+5dF1DRKnQ5cAOgcQtRsfbxKL8bX/k0FZqgPZ1m\nJhX6iHB1aZIl+djmnhzXxbcA04312IZn98pnSfrqMdEwf8FoFnhFNKOrAu45\nfEXMZZs7+Hh2SzRSAtiIb0Qy+0rv6f9qNO7za0fuNHrAjaAX9yghVoE/Mca6\n3B81jwiXUD/JFQZ8+W3l2UcW8zCinnmbdA7O4cUYZBQu8T1aZDmA42btfRcp\napNF0X7zSBreWS15q+MxoHrWB6Avxe/PCKOYoVjwqtPX8V1xXWusR9ySnuiX\nRtaymI4irvGe6CF/nzbespQC9NpGANavSwzdoNyX7XuINFq6btDXHZH8M1PX\ngtckqlFeRx4Gc/Ov+G1NkzHIFp5z8nqxFcVn0QIkiwfqo0ju9B89LQBlRE2V\n40XXcvOhLyPCAC1xOuzJUTVGq7R2cK48bTaYLrnBdSE1mXwjcGvtaIWSWLSS\nN1Ke\r\n=9Lk9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaZ1RUkoxw/2C15k1QmZ+7GYxOB61UPBCkTfrePl+ppQIgAox95Hg2Xv7whDQoqfrCEhd409++chPuIAwmik7Ejhs="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.3_1551709171630_0.13955334295698507"},"_hasShrinkwrap":false},"4.0.0-pre.4":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.4","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/iron-localstorage":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"d28dbdde68232c3f91fd604fbf9a5b9fd91f0ea2","_id":"i18n-behavior@4.0.0-pre.4","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-pc/1e6TY4q6G1Gj1I5J0e73dA4rcOKIkhiWfB+b+kBOGWPlxE4b92QaKb//kBZ2GWXr3BZjXvpuJrPqZl7qTsA==","shasum":"ce83b1c225517aa2c4deb519be527f4cf55341a4","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.4.tgz","fileCount":1174,"unpackedSize":22700799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfme7CRA9TVsSAnZWagAAvQgP/RJTJVh3L1uCQASna8tA\nK/MH6ZOAGAstUpv1/HVOuefKuYy2n/JBxryr0lT6S4JEJ02qgiWOlIXfEXrb\n5FoAHPXhnoxi2CJrLI1tqznb0JmtSmYE9tFDk64A/6HIeoc2/WNFXWQ1rMYb\nFAavam2r+9ofTnHA0xR5eXtKgaLRiQt1vSMYd9Oy1wV9Xpujx+CMS02StnwL\nVBpu4P65NM2gntYpQYGiGh6oZoOhuchdTIbLHKt3AKEw80v1FAuQBDLluyjR\nteKdd7H6SoQ+b0LiMQOc/HUkusTLB3WHySm4KX6pnWENxTIZ9AALBskndAbg\nLLWk36Tx8gbKnajvsRhx6CwxZkvSAmoWmNjw6yiJ3UyIOXZ31aYzGXHmpP+i\nuA0W8MeR/HlukJ2/zbwcV1xRMX0L3tTHxKtPduMQIDR+jFR53Ixw1G8oRlBa\nVc9xWaacirys6VyUSttR9gAXTwCSm4VwJDZDnsrk96sjMd2BiEXjWPZ2gxKv\nGfvGKDk1mlakdrwjB3rZqNPvtl1VpvQroR4QTSJ9Bp/YWWI+sfWiL4T7Z+ng\n/V6OCGk/JD2LjwPjOYVCyjSD+uzgHlehf3FdUIekj8EtYmHNTTcgh+g0r2rx\n6xIPYY6z+rf04n//WLWjAX6Uo44jo8302/GfrSKwxsMenxJPYNN3sx9de15i\ngNtn\r\n=jLen\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDobzMftkXZ9HN5rKB42uASepJ8J9YwuItIeyj00kvI6QIgQ8VhqhEcitzpNWMWulVM1KS6gNInTNpi7J+R9Xf5dqg="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.4_1551787962698_0.28705521756635366"},"_hasShrinkwrap":false},"4.0.0-pre.6":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.6","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"4c2023c819289e1f4c9efc376d6a8efb0dd85168","_id":"i18n-behavior@4.0.0-pre.6","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-DXxBCw7Ac5HC0lm9sKcwkfSllfBPSCaimLuRKH1s5aN0sDsxHFp2kKcwBcF+32SRqmEojWk2l6jlI/YlHIASLw==","shasum":"ca9875e83ec5a035d37e52812dbd0e1513212d49","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.6.tgz","fileCount":1174,"unpackedSize":22702805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf8k+CRA9TVsSAnZWagAAJPEP/isaLCVpmSiFosMlEYrN\n4VongxuvjGPKcUU7Eg/+/i0EAEFKpcJ5KGlVP1F3pxJtRY/C9/1v88YT6eX2\nSe6p7/U14ZspjK3SQy3CpIOUy5jkseJzoPa5AjoiOy1AkeiJf8JeAvwxBe8+\nq3eKM4HzelKOFWTxCstg66qa4sOIGhwIK/jAvPnhRwPTPdsCtSqQHw4CY79Q\nWfrOa/BMtOFBWD2LeF61hj6esWBQ7cJEocJyBxcgG8Wks2hahOVQXi37+MlR\npR89PXwe84E2dwP+oLPynedA/TijTQa4go5BX15VU65H5AoUml6tSBsKpwSx\nM1MasYULHhp4x80CIO2TlaULun5A1r+Vke8z7yOkIjYgh54NL3cghGDze+3q\nN/VP/ut2tYHRemba1IyTVFmHwW2E2SG0IlDVBbeo3Jm9RXeyyBvoX80VmE5b\naQFAj97L7ekV4HAU1rq3vPjcVUDLnLkAUB/pVu/KLUz85aV02MIDUj1yO1xV\nfQPJpUZ05EOn4ymHlZM5zSaz30wJJ4SVOtMtQiHs0CkB1p0c+9k8hG9nHody\nIR7r1xZqA59/bMhVIHfXsPUVVGhn5XbIFwKwu3QFjzitzJq4Vzn2z99uScc4\nQ7nZ+YULTAWSmn9Utw4lQ/zvY9QWOK4dVlCI+sOzBeVeHEWos/xPvOqGPtpt\n3B68\r\n=LFo1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID635TamfVmk7OxrmYydbnjD0M1M885I2UbIpyQ8WIUaAiBhYyZOkjX5PZrIhmAuCpeVads3mrqOFDAPfa8G5bpOJQ=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.6_1551878461836_0.9133412885710839"},"_hasShrinkwrap":false},"4.0.0-pre.7":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.7","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/iron-ajax":"^3.0.0","@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"aad07e51f91aef531b7f6297459751901e38380f","_id":"i18n-behavior@4.0.0-pre.7","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-3GpTn0LpjbpRP/yhOSB6uf78eM6RTCEtVwcsTVA27GiNh0yNBmC3Cxwguno9S8uDLXZ9OirK1hH6+SW3WwG78w==","shasum":"4c33b710fbe7a5d625ee275ba72f2ab810bc55b3","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.7.tgz","fileCount":1175,"unpackedSize":22711209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgMH8CRA9TVsSAnZWagAA6BYQAKM8Gy6PggbvhJbWoUXw\n5+QS1I+2vCoyU+X3sMC81Jrzy5dDb4OboytH1YzTs21jMpHhsrcjHXV1JHM8\nVy/41TMS1vxfkNs8iUT4CmuWLLDmfPofcyTaQ/M/seBRGUtg8/AMrGm/7YSD\nWGTBUfeCqfjnoQiHazwh6gAk6BN1IL12Xe5dmQZ6J3w/J8pRH6Ke6svfiFm8\ndZ0Ha/vjqFlvPbgju2iav2LKCCKTav8u7ahZO4Ya4ozGMG0eK6GpYoQWTnI8\nG/bIVXgJEQxuVWEX9qfyfDYRMNpTP/gBapVnXVQ56W6HntHjjUyEyXGrQAg6\nU4ywXBm1fs9PT1jBFNu7j246ymCiZHrrpIDur/n2hkspcmIeIgTt8knzkEhX\nyYW3ley8fRIbeA61uZ01huHRn1TfvIcaebLA1BQv997mGGfOgcIxJceIQUna\n5KRZlkDouEA+f4xK/mYxODtIgNB+j+QHQD+f2eXgg4aVjajaaFELaGmFbK8O\ndarqVaDIx32DzqUlRqspaUyMhol/ZDd8VxjwvOx52oX3LaMptrilzpijJRbc\n+B98PAh0x6eGgXdAz+S/tKNTshBSmpygCC5022ioK9X23liDEJ6N6E3C+B5d\nZe/xewDZBg+t8p4dPeaJ9SJiS1JLiUynDesF8jHI621kZcXSK4R0hj0yVxqB\nrpjH\r\n=6SH8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAD1PavmoO37HUjNmFjH1EqeoE4i/N4+iy/lN7FRIFANAiEAxcuWiY8xB1+VotcnjW1f+vYp3Apm1B1/7MB190hYT0A="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.7_1551942139491_0.329037767322935"},"_hasShrinkwrap":false},"4.0.0-pre.8":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.8","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"@polymer/polymer":"^3.0.0","deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"c5dcf34f2a78064616fd5f3f3c9e7228b1378c4e","_id":"i18n-behavior@4.0.0-pre.8","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-EnT2wV1aRMeJqR9x8JKKFFMR4CGJx8qKVeIijmgsOUzUo5qDvRWAeX8AH0XGF9YzKJVVj3zC7fQKem4+9gYhiQ==","shasum":"94fc6bfbcf359b4bc2d90036294f37889361416a","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.8.tgz","fileCount":1175,"unpackedSize":22712800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgkaYCRA9TVsSAnZWagAABucP/1mOObvBHgMEe5Y96e0D\nPh4+LugRkmiZfVz26pQTdfCTeJy9HqV76O8MDm06FlvPJMxt2bm8mE7VWdJL\noZFcbooNDVuzxV48rs7x+++ffbZO33sF22C2S2rZS96ebDRczTyyX7PZ2WPy\nXw9OsP0oTX061EN2QLQb9pAUNL7j987IvuK9Ozp4TJStfisSwsWoqwEywx3N\n3byVl0g1PrVWY8CagCLvXPzPoptgM0LBjqpgl8jj+ECrrCOvAlYRmNjz/LQF\n8GbefpyXmE6nGd/04Nh13GHBtmdYBmYaaQzjtf0EFauD/TBRFGhfsWgWriyj\ntDdWjFAb+3j1S6TMr/+8t6tTkbK8weLURgn7TDbPMaCcNkBuC+8mjl42rMCj\ne+NtEJ4qUQFctkT4knrDam3mHN5FeK8kfM/JfVSCD6+428fn2YmSZpbWh0lk\nUa2OaNE/nIMI0bX/o43EGMlaeYq4RTbookRCWm17pMp4kMm+KpwpbsnpTAjQ\n+c77kYYKK2yJBc6Liiak1TMMzIMgcMrGHhEdTqzJF/5aqxZ7MMoeDA8cCROk\nYbDl95l4xwku9ISp6KOC4P5Wg50BnUxRuHLjw0eKNCLyL1ipkLVE943uPsOX\niWhSqgZvnyaGd2zZLaUSMnob+cSCkWlkaA1tSJTLiQQM5iv1zyriSZs0f6GX\nV3XV\r\n=sYgv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+Wau5K08NPwHOQCPLedJg2CSdB1YZ8p+mXF3uQUpyxgIgH5FlvNnPl6GBEwdJtlo5p3hOp0ILaZlH1+pRuMfwCTQ="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.8_1552041623704_0.6423205632760012"},"_hasShrinkwrap":false},"4.0.0-pre.9":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.9","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"df00ad7b9c642f5aa2805c796c028335536bb0d8","_id":"i18n-behavior@4.0.0-pre.9","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-91sJ0z3Fu+2dXhoq0ITOXdsu3c+JBkw79ntV//DQGmRWxnH2elmJQznJrf9w5mJZKn8YueAzwgBUcAFYbgrLHQ==","shasum":"97625da699e388ed66c8624dca5fea920e7b8fe8","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.9.tgz","fileCount":1176,"unpackedSize":22718754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcg3TGCRA9TVsSAnZWagAAeTUP/iG4bxjplx8S7BIIRwp0\nPkEzMI8FttlL5oygYeHZIGdTO0/209ThGoBThOiSVJG73IEh5oucOU86mLNA\npU6VHst7dVkX8PhsxG2285xbw178BCTeVtcrPatwYx5Cme1thSwJpG1EliB0\nZ+ktcQ980NBCeAaoP2pcTbCkQxlmVDzZup8+1BVLDGDVgqXxW4/aD7t/Vlff\nfk/79bSwaI4WrvKlKQAh664KPut9PvjNdMuOafhY2bho/V4Q2qL+NIKi3pte\n9De4CWI6lHtEzzfql1ilCHa/WlrHK3ag2z5JvN0hC6ho+hbUZG8laFz8Qn7Q\nV2VZi5tbgYIIm7KYr+IVVfCIz+tiXbjZ5PSj2K2D2eqOQWPtP/h8qZcxmeJN\n5bbiPzKjHVJypSFWo6bMxKafvD5zbSzlGDF1fniLqiK45fmc1S0Po8WdoJni\nQyamlewSdF9YViKggFSHiyQeAVXU9rbi/2DdqXwYQNUxYGWm2QgijeQZGBFi\nDu2kayLiT00zFLZ0n+eXf2C76GoAYi7maPkFUQuKBU+CUYFvr53a793pZtCp\nacLhYLFe8KV5NlHJZRi0ohGMxAQC825tCKDuOM+OcQkQ7nZyYSeS+wJpY9wL\nd5vB7lWNONWQCFAKTzE/+noFd6WvpIgpGvqde5GHCU0+fOIZt+qCZN9mVwUx\n0VZE\r\n=3WBP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoT+JEflP6sMgmkFgcvTRimRLi8cJcWucGOyi2snH+3wIgPBCUOO5P7BIUAvltzTK4bfb5fU5jFrO2pMUxZLIdYXk="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.9_1552118981990_0.8810992369149924"},"_hasShrinkwrap":false},"4.0.0-pre.10":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.10","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"c853b76a4cf7b63a20e7b0ba7f77672ef6ff786f","_id":"i18n-behavior@4.0.0-pre.10","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-zDfuQV/VJA7stG35+IqghZ27ccQybDB4h42rSaLB67SKxzstZQOEmf3181KwhxpItnnGVdO1XTuyni+XS6pPdQ==","shasum":"7cbec857a0cafa8485f952a6eb3c2b0f783d1779","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.10.tgz","fileCount":1177,"unpackedSize":22724502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcizoOCRA9TVsSAnZWagAAP8sP/0+Bmkm74e/VQhdJVRf1\n3OaSbDZiR4VvqPCQ6oCj+ldXS6gEu1X3NQiP1BHV03arT6JQWWXQYJFnPxoy\ndM5wm/cIceDCg+7dPgALyDP2k0MNSE9vz5nKxZNzDf0o2B9C9TAlueEX1m0A\nDKTrj7hkIhFbelmBpU/Ua6Hzj9gSxatRnMZ/foiWl2MClZuauIu5hsZO0Auh\nuYTkiDhS4bk7BDKTuHsl1SZveJVAx5gPmRcUctTxLOMw3cdosuxEolBY898g\nNiloDhraoAvb49/aaoZJViNmR88aN4iBCIpOL0P6nK/5mvZ99YFxBjY89ijG\nHENC8BW70FW3F9YWwkTMD2WTQDgsfwXI6Sl06Na1M0XtAACQog5oq1PH7KRx\nPIwPZU2J2NtDpbTi5ceSjHcdb4sBGzsyhqUCuFl+HZ+uF1mOmz5NJO14V87B\n6kjszQEmikbfuE68YWtk+hRbeVxUQe+fu0lHxfAOrXassCeuaLiPbF3XWYyR\nVZ5NiEOeBh2eK05UeliSUfI+08858lcT/O8Ao+GeOAZXt/yNz6mDS8uqFnG9\nbLOXD7U6oxpkKzLLrw9jAl07H1onIwn6fpSNpP6n9VXvXeR9atXCpJBx08Nt\nhh59F25QI6GLMW6osPSzFfwqnsGJ22EgalsAEQH1lgWvcFsERe7xMdOvrR9S\njf4g\r\n=zcrm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCis0bF6qt7ldjl5hSV0OOXCc1OgHCMriyYxziKozs1EgIhAMt8pbVDx25q6qPgIvb7QWUtO6IqxtZpv6fTz+fLuVYi"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.10_1552628237944_0.5349094477082703"},"_hasShrinkwrap":false},"4.0.0-pre.11":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.11","main":"i18n-controller.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"c9f1c02bf63357b6ab32dc1da5a2dbfae80d76db","_id":"i18n-behavior@4.0.0-pre.11","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-+uXemrU8xLjP+5tV3rO+3Bc8EmFIPsJvctGWBBpdryb9qdvoAi1ywNGdRN2thjDPc/1ujqt5bLfkiR7w1sbTjA==","shasum":"bc6dba39f7017514f5213804ab32c4e62231303c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.11.tgz","fileCount":1177,"unpackedSize":22724746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJci54DCRA9TVsSAnZWagAAQYAP/1q0ggMtdgagNDiclvS+\ng+cnvUth7INlWTWYEnixr224gEXkLz8vxJtxy4Wv5+b9NWKW0PHW5Tc16cTy\n40yZTnlUpzJ7MEgORLZdKqh8v8lJjtEqZ7VOjxx+d+jpX+r0RPUSKJNCOjeG\n83MU7f5H6N46Xbr8BEPPP3t//EKEnaYIGdGm+bomraqQUlRKJTQsy+OxcABg\nO5kg/viIDJoC27dUPwLogyb2x4BXQYZmDr0+cjHSfJMN3nuLC2gzOaQQzr2u\n1D2ZopcAimH4M/TBlDKQ7XBdvU3QdkrgpWUHC8lKN8xLFevIZLwlqg1cztqm\nIn7eDokkQDGUjvM4EZLD0U9ppsuIGmtLxGhNvDZmX44wWtqfARmxJ+Ywij3Z\nlZ0ve51nHo6PmHqrwDQB4Hjue5LvyDpZRIeeL+LEEV9YOL5DFAUis6nX3vPK\nOZfht/oXU2W1AMhvxn8VjxfxiyUivNBIMt40Is5ema1oG+5geaVx5t6SW/B4\n1q/OsFpG7ML4j1maP6qgl/4qFzBw+gUDowk0bxvbBJU9nTin8IALC5ZfMNe9\nAV16d8xqpLMphTpJemQNaxCRHmwEA/HT0lU6GSdJxjncONc53Yxv90YVkjJE\nftEQXWFHEI7bo5w/Dbz8kO6h9+Wh8r/QeJnDQdEwFxnh//MvauDWxS8+j3xb\nsN4g\r\n=5+aG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjzlQRvcja1X2j0+OJYaJChntHYMsSj6pBY/rtkGZ0EQIgF4ris87e+P0zmikUYRUfpd9FIz5e0mhWYoUgybVAGmc="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.11_1552653826746_0.5734364516430648"},"_hasShrinkwrap":false},"4.0.0-pre.12":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.12","main":"i18n-controller.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"56b393d4fbec6a718547df4a19d74debe12d26af","_id":"i18n-behavior@4.0.0-pre.12","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-2T03bmtCBa+tYsRzcipyAerqvNd8qawQQPYZABaTmGVcLGtREGXmpOcRs4amJ/PcBflbuIMe0X7q03tXB/nvHw==","shasum":"a98aff626f503878883e05983bde969dd40cf553","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.12.tgz","fileCount":1177,"unpackedSize":22724571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJci6QaCRA9TVsSAnZWagAAoFYP/RbFKZKtkN7oaes5oZR+\nCcBs1EPjsggkyQPLcvUyw22S9Kqcz33+b7am1ttZAp312Qpd/flhREfTmwTH\n3tGvh3DqGi9OCJuka8RmqMJ8539qIlKLhcTBX9aWY2I41ZyUw3//2q3/7Z8A\nDRAd8iw7etBDcOmtOTahqNHeJnHXmSl4bOulmqH0xE8otlvVCGSgzfYoIQFr\nQH9md402LqyYSBqD/h5Cr6Xc7avAYOUwQQzz3vgJJZjCGz6KcS0pgzPeum68\nKqHDQnZhfSLqzx1ubdI9KFnXDBbV7Iq1B0TThEdZa+4+D+oZR5u2dBbiAYuK\nh1GctG949v3bAIknYKqzEKE1H9tArF3/7qweFOjhjf6t3N1rPxQ22HHSeFE6\nd3cIL66vc1YRk+3PK3nOZGocTLe19ycsF6RQYoaYJJe9xL5coU7vGDPjI0VU\nm1MvTJ3F3RhHGF207Sa7XiE3+3qgfvwy2uLFBlZ4j++aCHI6TvICoF+aTgGX\nYl+N0a2t4bsLZyIxtbgROzzNN8GSRt60QfaKgfLnfBTc0jhfHLLwSZOt9bIC\nV2giMhTZleSlzkWib31zWazBv+NzVThao9JG8QuiX5Cu+p3VB7vWUM9nvObm\nOlsw5p3W2SLQAosWl8suB6z7qR/T3B06FB1FdvH+vUfPPgPnaWE82nlH7XsI\ngKHe\r\n=yfrG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDEjd2e/q1/dV36qvLq6MIdiSPgOWccxCvOTUkAX/24UAiEAtHypArKRxcuaHsEoDT7MXWsOxsd+wISOlc/BBLj0fhw="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.12_1552655386035_0.5505119963073171"},"_hasShrinkwrap":false},"4.0.0-pre.13":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.13","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"db6701e6ed4bc52b9dfa1500e2b4884eb5b99b05","_id":"i18n-behavior@4.0.0-pre.13","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-YjVk3PS0I3ownQAglc4LWibsSBhLZt1wVu1UI3x2o77xiDO4lqiJjr79rPyBqAD9JHWxsrF7KL4c1W46DJfZsw==","shasum":"c9f1428bb86f37a60fe343a8c5e269cbec954143","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.13.tgz","fileCount":1177,"unpackedSize":22724649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjCK0CRA9TVsSAnZWagAAnxYP/REYDuN/upPBdBVPKcuj\nImz8TNEKEUDiFzENxrICjD8c8XRwDCJ7YI4vNwwRrk07YwmuKDwN1wwHlmGH\nDxsOwucJgKshzJy0UOM8Mp6WX++iwTKZBimOzdPpEhJzXUz+lB1kvE3ANs1Y\no50iJF5NmL1ZnyIshC19gj6i7th6zxG+cEBHOiv4E6ZQPntJODHuJX8ky94i\nuWqiFsVx+nlTYh53dhcM32tAGjDe77t8tK6nGMYaluuBSdDtJ/KSKw6JPRFU\njIDhDvRAWUzqKQeOp/Z6ye6Og0G5HNWYtdDAapZ4oEHDZ1Nnd00rKVT0Q6z3\n4gKXbEVTRiYvqPeeGKal43XUz2uydbDrkjulkNbVAPL4ZOwSi7jKxdRfHwC8\nEHm4fG93Z3IBYhTMXADo8G1l1vMdAqYy5ZS22yeEeqeAjSiqYCCBLQ/rpXiA\n3d3CBe8xfw2BvPquzFGWL+AvbOeP+O8Y+Z02P23aEzhYn9O/sErpMP66eLJ0\nqabL+jyJ9aW8fLq86MUxAemMijK7d0c/6THLDSAeM9aU9tkyEoDWnkWtNH8r\n3lCLdW37lid68rfG9Z1ty9Ly85eSv80D8DwthmwzZmQPnJ6SchGbfGxdvcIn\nm1yVvep7LZcc0bCy4pYYXVghCrR17KJRI6FKL4Cf7guyTRvrT8rWpuG+lv0u\n1NPv\r\n=PPsT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJl8voF/vVrokl8O+1mYm/KmkDTGwJzlbfRxRhLot9wAIhAP4uNa037WU2gxV3ysYbfIYTjK5JF4iHQKwlgdgdQTKq"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.13_1552687795348_0.3944671554789654"},"_hasShrinkwrap":false},"4.0.0-pre.14":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.14","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"a4e3ddb70c05da277b897deb7e226159848968e6","_id":"i18n-behavior@4.0.0-pre.14","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-uWVUEO/GAOiRUAg2SxXkLKgncF82k3V4/R936XB4CxaETpVL7xRpfZsEKJWjWtjQNEgFUf9y3BZKWTW7dkm8Qg==","shasum":"025266f187bbe433c532cdeee5a3cf8c5c81e84c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.14.tgz","fileCount":1177,"unpackedSize":22724649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjEQjCRA9TVsSAnZWagAATo4P/3RABQZeSDbyizoLcsY/\nR4C1Dp+ZPUzlZjVUdT1JLGCMif0g3mC8l9/qQOwg/UyhD9m7zYogNEBvRBqo\n0w16CAwqgM/CdoXv/hnSuOF31FFfn9wlrIMPf/z6iKggfJnXKYcM2bCh1sAP\nQlqGvxdt0fq4aAbE01xKtpA1gXM+JXX8bqqLYG2VyGcp3QIUlwido79M1sMk\naAkPg/CRxXrQtAct8fBjow1QHgZMw7noL0bF+cuFioqtgc48ZQJ7Ylxz9jUk\n6Fp2XY/HkZffHzaAJaPsO//RmdRemQO9iZ1RsRjl1rem+oy3Bbe48bu5oVzq\nztI0kOkZVCV6KvBoLfhQxJnc/GaxxfV9K2bB07/cxM0Louz9ZuiOu5dTmBqX\nA75f/G54ETgeL99PojS2pR7Ct0r0+JknIRoMeyKXVxGN5QIlUlRva5uozBTe\nyLwlHEO4Xo12zAAxpIk71Mbau8Hc1l9dcHsom9v+JaWT+mC/g4y7q33usgA3\n4qDkA65G8Wqx/oLQToTctPMYgVcjyVbGNQ3CT8q1296tBvmoXZR4bhsU4UFi\nnzBkGpHJpJ4HpEj2cmp/edSfQU/JwClt9mmjjTNk9jC3rEs3xyYfaqzqdUcn\nkhnOOh0O0LWZicysFwSH72E7YtMumpOqcii3X5OWG4DJPwNtnydy5u/bVwCa\n9YOI\r\n=uUoI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7FXlFaSV1z7VCDysHa/OCAmroCvX6VPw5tkGhN0Qo4AiEA4yO0xXIhEDntZmwBEhd4YEaBuZSR3OeS/0Ew3B9I2E0="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.14_1552696354283_0.8091406446863907"},"_hasShrinkwrap":false},"4.0.0-pre.15":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.15","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"d0531607ada92c4cecd1f5a99d1e7a8a87af2334","_id":"i18n-behavior@4.0.0-pre.15","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-EORwELgFa9qQCJLaDTzwekRO6gEDojtGEZsYzsYQETfswt1kaTSNzUNF14q4AY/UlR84OhM+tOQHuAadhWtUmw==","shasum":"02cb5e3aa5ff29a7c136e89992147446417b401a","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.15.tgz","fileCount":1177,"unpackedSize":22724649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjgRLCRA9TVsSAnZWagAA0PoP/jC9Occ3D86rRgyMrP8S\nWoNyuDKor68JrjEQMKRQPAb6Ivsn6Di7dKzYFl2R5/rjUEcOWVFUQ2+NsFAB\nEK70iOCEYMAp8T3ouW+bsIUwZ2NBnF3extbC22P/01SFNX7dPoLnIWjznmtl\nZLw3ZkRQr9CeVkhUbooOyNKfPzi1uG3CWXlPvNAqdU9qYemyRh7zn0xyUgVw\n+Qmm2+JNNWaZcdck2fm2hRcsbUsJYmw+34mfTeOQj3gxdMSpSLN+gluzJaR0\nUcgeNH86MZR7iSyGJGGheC20Gt0suqOeJBch71WUiVAG3YeoW8kAlbg/7NOo\nA6q/oyG4pHf6BrwtFzA9Z1SXLJ2JWKq7w1lbwRjYZ3Sws/9Vl8OZNEcYcVBv\nEjVv/64vsgEt6FTk53ZoYc9pRFWyrn4cWoZI66tjd6JFh/l6qo0bBScn8QCg\n+uKaIXHkqK4ktsz6jRA64YXZMm/9OpWD2353VjN2yJcFxBLB0NEBZQvxC1J9\n9F1GGOo3O7Ihw0jhqYI20lP7g2YHGAXNEnBV8Og/4GBcO8rZOaHFkC1hCO5e\n+xZypAFAtUf/MXZ669saptGvQ3uNEXYM0LrpTZHbTBD6MWIyWpJhfcaJjEW+\nz5FN85guYC7ExWh8e40YYbJWRWtZUbfoPDxddtRnbYLnqycIGnk0nBYGgm9x\nzlzi\r\n=0F91\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpkgOCbhvx8bUzEFrkNeGzLuxWVGxHnrVGIM8Mm3wASAiBBHKxvq0QszpFd8RMZlpVHCcGGpc34t0ROQAXNm+Bfkg=="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.15_1552811083234_0.9011168862997347"},"_hasShrinkwrap":false},"4.0.0-pre.16":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.16","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"3cc64a71a873751fbc7828ea19a37d66db37e18a","_id":"i18n-behavior@4.0.0-pre.16","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-LSkAM4VfLzBMk9WCp0hIV5VW5dpfaa+o9F1eLDPybSxWSZiaGkwcNgdldUdtDIzx7ruVG8bJAyLuen+Acr3vGg==","shasum":"46b9208707720e69cb423466300dce698dbc4049","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.16.tgz","fileCount":1177,"unpackedSize":22724907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj01jCRA9TVsSAnZWagAAZbIP/1xofO+SVnsQwHpdsmxX\n4y/961xu25ojuihNj11KeW7zS/oN8+z9PlaxUFUPnnsqYc6Ry0zbcJG7w2BQ\nK+a+aUcvzCoqWde+VFQEdXT565YM7JwnVvVjP7IO6Dw4Tr9ICCDdnsawq2ni\ng+nCTlo76wxDAY6XOPAoCkp+qWFMVu9WysHfVUfIhLtQFlwkDPxFr8wQsNfk\n3+aQgh8+vmpzbF0stnAoCznClPydGxHLreaE189gAaQRSlR/pzISiUejnkkY\nhzbIsd5N9GWa7cS6ijCt3w0M1Yl2gF1YChpRzHtqDK/j/Xr9Ni0i/FsUNSuQ\nOccOncTr8tLWtLK4EbxIQjAp7IV5EnKgm84CptEAgweP7B/XN1y+V/0IpnPE\nJynBJWx8HoZhSsTkA9FG9tsO9YNN3ftYbhcTHdKD/O20RYHNz84AFu46IxYk\nJQDiYLiVY02KC1yeSxgtyIVAcMEQavngFVxlkNU8aebJwtrT4jbngFpkxF77\naoEuE/ehPuc1igP8VvTWnnWTttOlQrUwCzRNFOrWK4iq5+Nj2dlIp0jNAlLC\nJWmM2PcwjdDGGQZbGeaT20aVk9s70gzHAYLOPEyTYMGX4YpVB+Bg9m1R+QHv\ny7OL7ibsk/e8ake8QWTQiQZP0FuCwoXR3znE9djSbWYT7QD8TWPL0fvbz5ZS\nJSQP\r\n=Qu0/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAZEMdNaBdVGwm5CPS7EX6tUZHfuJiAOmWTxPX2Hx27wIgFtNPaRDDsJS+TEoekuOxszEV4+QoKhSoI4R52Ta7ewU="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.16_1552895331165_0.13768801348953819"},"_hasShrinkwrap":false},"4.0.0-pre.17":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.17","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"71a3e1d5e174d4769240a143e4217595ce4ccf7f","_id":"i18n-behavior@4.0.0-pre.17","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-oPGqCnzr8i3jsWSm2OnySwtxbnokWl6u1SWxTSr+y6Gqz6Nemt8gEOajo/QtNX545ACWoduj6/O27FSk3QuutQ==","shasum":"df1b64e3db55ceeb2ba16cf9821e49fb4cf9493d","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.17.tgz","fileCount":1177,"unpackedSize":22726903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj5g7CRA9TVsSAnZWagAAYwAQAIcpnmhz2lHZze7hthGr\nKOIjDFu1Ge9gw41fukiEQv50ipjP8pbKsCdXWTpuyJHzueEIQ+IIwNl7YRuJ\nmsYtRNMdPe1d+xIprGofdIGJ8ty0+LIh83lBDmE2mZuZia+fjcCVAnkR6S6I\n9/8UKMaGj5xp1BEa7jzcDyH4bmXbDg59CGQ6UlyAFOeSMEa+TkFnt+HJaBDJ\nqhvPRJzDSwxmyMHr/WhEdPR2N3IT5H9PFRuaYOtf7CWH4of6va9ZhcUvxOIu\nhSMd3dUbM+5EO1VNOoEzMAzNN6Af12eczMnR0M/+ajZ+J2q/XGrYCT6n0NYf\nY8ZFEGdeg3YBl6ZVMMGdX+sn0vIWNJ8+C4BFI6EF09ciTMS6KURrD72d1NPM\nuh9lihj07WC5mDbO3tab5j5TkYJin/MU49TK8wqh3rRNlGXKZNe0t47/lnFM\n6sEr9Fr0+OGXYdVHdwCtMza5iJb+M54bU66YUaML65J7n3+UHPux/l2ftBP7\nhwG1wPz8iPXtCGBVud2sOsxdqpyu44v0VF6lfF77s++k3lg+AqUeE4ShTFG5\n2CHvej7jMiXh2dE1chHPfG8UWW2X9fj+C82/eIqYKRSaIVNXs6VHR5BRg6u9\n7uyI6aV2+PMXulBU46VXptfJspBQZud6fVuwxThNOsSp64nFtrRTldX7Y/85\nUHwd\r\n=sC2z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAoSUGH8oRkMONviX6sLTu/au3Hrdjm1dZuNJvjCx+OvAiEA1WsBjCdT+CEWkPlENZMOPLnMCS5nuXzXmCfw4DKXTAw="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.17_1552914491053_0.6231905106981139"},"_hasShrinkwrap":false},"4.0.0-pre.18":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.18","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"da08e232da5708010df42ceddf870a60025c65da","_id":"i18n-behavior@4.0.0-pre.18","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-MWj85vyW9mJYPYjU3KU3oyJk7JfMKC5v5vh5YifWVtpDBTTF98+ROGCpUYtBduOKT5Q8W5SXY12JLF3/mY53EA==","shasum":"16a29bbf1a15e799bc364deb6ba7e7bf045aad1c","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.18.tgz","fileCount":1177,"unpackedSize":22727327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckHX0CRA9TVsSAnZWagAAIvYP/0Mme9lnOzMY2al8hMXU\nGontNANIzl/7RcbTywynbZjwQqUUCd4ljx9Rm+aYInZ9jCgs+CZPBmiJJ4US\nVcQvleXI/FeslZFPBIdr6PiDX/wCzypk8fM9NkEuutaqP2O0Gt2JB9DG9H9P\neydnJRgkpd+I/lICE7blB7Yo0+/MGIxUIpeA+5neLGvUW2+bump6i4bHYeI9\nwsg1K8CzyMWMP/hm80yKIKpHR7M8oJdldBHs3QHbDPd6A+FsSoEAGegprm6w\nix1zRenbPyRjJo7BJGAC+g7+Y9xtkPF+F0kenoZJTqR9K0L6jqDFDjXGiF1O\n8yEy6akkz1DrurA7nz106yIizTFBt71/Q1lyg676ke2+hR2b6th5qfrmi1r/\neGaW5VlX8oedfbZ3AUocedQLHS4kdL08O7zoJZJMViXAuy7emtwZse7IRJT/\n3W8KnLeHvRBAFKHNpOyoTOoO+awSeGN/6m/NJsOeEaeKV7gjD9u1xoOuqXeV\n84CYmw/e020weGnLUrCFiZTt81UjmtrweNi4sQoLZ9D7l9s/i4WC3U64RCa3\nZfBV74rkRgzG8i+nA6p74MDduqsmBP85kcAGGAKWkZaQPf9tT2aJsYsxUnd5\nCg8H5W0b3qPJt1iZc31Es2P1UskwHhhawXnUOS0iEn/Fa1e/C2pKW5nkN01y\n797P\r\n=tpSm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7+NSiwqaHI5cM0jzkSoKCGhTEyB9/NWRRPcgKxzLnWQIhAM5TX0fkkdhTnfxRAnItkqJ3PKgnZ1P1NkZm08HHH6Uv"}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.18_1552971251933_0.4252214523863891"},"_hasShrinkwrap":false},"4.0.0-pre.19":{"description":"Instant and Modular I18N framework for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0-pre.19","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0-pre","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 3.x            | 3.x            | 3.x     | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 9+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"17fed51e8fef5c9f25196880cdec98f5e6f8b60d","_id":"i18n-behavior@4.0.0-pre.19","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-j2PDlZmyBQI9IoLaRLyc3r6eB9ImgBRd0Aq3ynvd4f5zyWrsEJ0c3yVtvX05jhzRWhYXfiWA3eYVygLOtTYI+w==","shasum":"7876aaf6342cf6407b1a85cc542a825b92f5dcd9","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0-pre.19.tgz","fileCount":1177,"unpackedSize":22729946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckfahCRA9TVsSAnZWagAANEgP/1HhfPpmBAd0Ci5wT3a7\nMw3Cme10h6SLxM+FFJBr3UIsomAixmOjp2VUYIXYjD6fTnf9CZEPGYqOF0tw\no2Sy0jXWVP4/oHGx5fd7LLdH5yeCkEdPDlyuKQixoeaAQmcxXwRQZu8Uo2ZL\n4s/KOgk+67ptVEFHNs90Ow6JLfdMdrYxGV1Bg3xwxYoN5WWx5elOFGnYcNn2\nUmguzZSJK9LGop4OLcivcz5NmyG6F0MDt+TRC1OGtdUx5kpYc4568a37Knp0\n0HYxiyjFkuP/aIwl3ijmFF9s1hRaQ3rIk4vayNOpsrKY4dB9+yPdYUJAjNmL\nP89aYWVrYQ3D10AhW427s2LWIRN8xY6LEht520flA+DUh9udamVfqe+kJXhR\nYqQ/H+ItmgU4Vhwq4u8prvZWFcM4gLp5fZ2n9Sto3aY0rLYEU7oqhDweDXe8\nXsVp85Ev5PQ2L5rbhiavysLnolO3Nk0zv54wCPk2gs6Bzh9QHaZa0BWMbFNJ\n0dlNDBWq+xZ1dKkzo9iowgDvKirL2pLJLFoEGi3MlUcseGz5542A4ms2PLfl\na9j8fse1yVlQKG69vv2LIERR3W2axyMVjoVj2RzjrlbCPTgBzf0+98C57L+O\n31EPA7Bzx2+IqcnjBNjir5q5pQMDxSVPdDBZqYbqFMrg75g0y1MmbYALIqj5\nG9pY\r\n=OTb6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLAyn5HTWElb6XxVuY/dnNO1V7+AkGA5XaYiCKmzY/+wIgOmTTE4ulnH0r9f12cGcy4Fg3viLQyDGPQb9nYvtJkGk="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0-pre.19_1553069728644_0.5290213415968696"},"_hasShrinkwrap":false},"4.0.0":{"description":"Instant and Modular I18N engine for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.0","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0","wc-putty":"^0.1.0"},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n- Polymer library (`@polymer/polymer` NPM package) is configured as a **peer** dependency since 4.0.0\n- Polymer elements using `I18nBehavior` must depend on `@polymer/polymer` NPM package themselves\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 4.x            | 4.x            | 3.x (optional) | 1.x      |\n| 3.x            | 3.x            | 3.x (mandatory) | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 10+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import for Polymer elements\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","readmeFilename":"README.md","gitHead":"1f1aa85fc07d3cb8db27c57c98c4fd3ff1fd5b2a","_id":"i18n-behavior@4.0.0","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-NnypWKqh5H5CalTHGluemL2y170dJ+Hh5HvLI99M2zD7ae2aJYvQv9zH0GaIqWn8bcPE6VGZvkNo+r2sgbj/1Q==","shasum":"f8e2e01f64795a7c1f078462b62569a78bec0997","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.0.tgz","fileCount":1177,"unpackedSize":22730971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcki+RCRA9TVsSAnZWagAA96sP/25rkfsP0rXDp3bki4Mb\n4vGZ+n7KcwU/7/c/LHhTFDRntda1vjiiuiLMfOpKjwU9sRa11J6YfOuYXTY1\nWOJjKi9zIcsZRSDkhwcqsALJIwpE0RnohN8ec4MOMpl/I/ueZASeWPY/8601\nXC1+8rpzCQqd8h9OGyQbCXDbgqm2/VQZOUerdG2oksDaHD14iJfr6Ws5hUBA\n6opUv1QA0zmoMOrWk7NFuhM5KLZeAo1WeZXYy1qys76b79HTJ2ZasllluRSg\n95OYLCWOs3c70i7l76xoI5tXpqfYPuJet0s25UZkJ2lE2OlRtyNECOzXbz9U\nD9bdwJt95vOCsnMkTu5bRaWyZ/z6cScATDMgre1C2p3Oa632EsDgSbPYA5Cg\nL3zNDfSooBG5Q2QBL85ixmxgZEeKCRPdki2FBng+zgWNU3PFtzRGx8/ZDKIa\ng2U9gk/edFhWYmcZKUCyclIyyQXpK//YkRAG8WjeXHGymJ2Yt3SpY2sW+n17\n+opnOqvZRX35k/1UQDvEiSq04SPDrAjWaVMg1+kZCPPNX4Le4a6XUg+fE9OX\n6AAdXS1lP15yOhd6Ucx3P27SmwHiDXLYLbfF3l1NCMM35aWqeIeF+qjOfoGb\neOhxywirgTphtY00zUzVQn0hn5y7j39TkjLHUozeAtKtyuDkltgYjhszIYwS\nc7Id\r\n=dqsa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENS7GmXX3zdRUzi8QWmFkjGx4W/KB7Bnd1DM3rt2eVtAiEAg8U0RlyaITClyeneDAbxEEsp5rBlukNBJtYAmdazzYc="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.0_1553084304759_0.43474441808911424"},"_hasShrinkwrap":false},"4.0.1":{"description":"Instant and Modular I18N engine for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"4.0.1","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^4.0.0","wc-putty":"^0.1.0"},"gitHead":"9bdd3874213f5a656ee0a647f661ce4097a8143a","_id":"i18n-behavior@4.0.1","_nodeVersion":"12.16.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-58VUbVBhkaZS0Jkk/dLchJKkyjhZ6OCt8lC75tHTNl0JaX3USICa71IPFaZRUstmdpfdJZ4xh9Kk/gypSOA/ww==","shasum":"b5cb819ee0125839f1c41f724ad8ee248a3b4a50","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-4.0.1.tgz","fileCount":1177,"unpackedSize":22732012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefvioCRA9TVsSAnZWagAA1PQP/3ofmGzlXgsQT4MV5vll\nif4mpIzyVv57gqVmWoSbL5+mVgfRS3uKBVlnsfvE1KNjKT9L2LZGXjTC/1tw\nbi53P5X+CP993R8QNBHl67gsPuZF1Cc0qg8DBPkUQKRANQC845seMyHVJUcH\nBUdTG6AZQ7HOWwF+dB6lyNo4Ogi/YZmUBq94TnjA+B5zZhmpVuJa6McOJ/cZ\ncbZAduOxNzGPf7pyxSf/DgsJzBExH54bSaEsmnDByrAscM80yors3juJAuHJ\nkyAvSqAClJTY78YqWd3uxZ8nlZVTxdVbva9uY83R7ZC/wV03pmOdld5sCEUe\npmqBp457DP06YjrDhlncJOXSZtctEQsUkFSP1eMDg2NxQG3+N+9i56QfwQxZ\na63+/nYQOI9Cp9bdXmcb9oxSza+GrXUrjbre+eAMy+hTNvbkT6Zkhh/xRaRi\nIqFhMJ1JZWIffUhzzhtFIW9u1mBf/cy9Kwz3PRx2eGyGuUwoEEkJx7HmlBre\nuO66VdC06wA4vTdu2PhPf+9MLUFJEc3g1IwaImCR92TJSmz/AAd0ruR/vIZh\nOx5d8e3EwzHyXHDS3T9E8TKADcksdiNTUsYPyl7FIJUduWqKon2oFPD0IWeX\n7a0BXqLsTVpGpVu0GvnLcnM8ga3vXSVCI8EjoBdmBrvu1U93XQZVnU5hHJlo\nWvjA\r\n=M0L9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgfQfzP7voITBdTBoWcHOPlZuV2zlqZCnfUL2wgOHWZgIgYkLEuFr/4ZaFA69OD/fxzh5Erpt2j0wMRX/Vlafg9cA="}]},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_4.0.1_1585379495557_0.294409822376954"},"_hasShrinkwrap":false},"5.0.0":{"description":"Instant and Modular I18N engine for lit-html and Polymer","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","name":"i18n-behavior","version":"5.0.0","main":"i18n-behavior.js","directories":{"test":"test"},"scripts":{"demo":"cd demo; gulp","build:demo":"polymer build","build:docs":"polymer build --entrypoint index.html --name esm-unbundled"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"devDependencies":{"@polymer/iron-component-page":"^4.0.0","@polymer/iron-demo-helpers":"^3.0.0","@polymer/iron-flex-layout":"^3.0.0","@polymer/paper-button":"^3.0.0","@polymer/paper-input":"^3.0.0","@polymer/paper-item":"^3.0.0","@polymer/paper-styles":"^3.0.0","@polymer/polymer":"^3.1.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-preset-es2015":"^6.16.0","content-type":"^1.0.2","coveralls":"^2.11.8","del":"^2.2.0","escodegen":"github:t2ym/escodegen#es2018","espree":"github:t2ym/espree#es2018","gulp":"^3.9.1","gulp-babel":"^6.1.2","gulp-crisper":"^1.0.0","gulp-debug":"^2.1.2","gulp-grep-contents":"0.0.1","gulp-i18n-add-locales":"^0.1.1","gulp-i18n-leverage":"^1.1.4","gulp-i18n-preprocess":"^1.2.3","gulp-if":"^2.0.1","gulp-ignore":"^2.0.1","gulp-match":"^1.0.2","gulp-merge":"^0.1.1","gulp-minify-html":"^1.0.5","gulp-replace":"^0.5.4","gulp-size":"^2.1.0","gulp-sort":"^2.0.0","gulp-sourcemaps":"^1.6.0","gulp-uglify":"^1.5.3","gulp-util":"^3.0.7","gulp-vulcanize":"^6.1.0","json-stringify-safe":"^5.0.1","lcov-result-merger":"^1.2.0","merge-stream":"^1.0.0","run-sequence":"^1.1.5","strip-bom":"^3.0.0","through2":"^2.0.1","wct-browser-legacy":"^1.0.1","wct-istanbul":"^0.14.3","web-component-tester":"^6.9.2","xliff-conv":"^1.0.10"},"resolutions":{"inherits":"2.0.3","samsam":"1.1.3","supports-color":"3.1.2","type-detect":"1.0.0"},"peerDependencies":{"@polymer/polymer":"^3.1.0"},"dependencies":{"deepcopy":"github:t2ym/deepcopy.js#0.6.3-esm.1","i18n-format":"^5.0.0","wc-putty":"^0.1.0"},"gitHead":"b7ed5bbe0d1ddd7d421ae3d6eadfcbf6d5956a24","_id":"i18n-behavior@5.0.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-r5KC/3v2g3yfZG8UIiByWrMl3+BB7f0xKKkMu8Jc7Ml0DpiN8R+glipwkeqKKwTAARK7tfpbIySVUCco8foq1Q==","shasum":"bb40c4b056b1bcda37830ab5e3829e9e0639eb2e","tarball":"https://registry.npmjs.org/i18n-behavior/-/i18n-behavior-5.0.0.tgz","fileCount":1177,"unpackedSize":22732203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2t4JCRA9TVsSAnZWagAARvUP/jekmmReF3cN2A0GJHOt\nBqELbM0JrT542CLUWDfCJNfTyMfjpCjwKf2kSco8+hkHKGP84BVl8Xo7fDPy\nRe15m0uX9aj3Cmz1Ug8pE1fk9Vl2tis4e9hge6ZYKMAmXLSYlWig38B+4WqR\n/ZzdP7/x7r2rZGXISdkMiGRoSS2DqGfw2a7UVM3WStyTaLMivPP7Cjv/HXwZ\nFdM4i1IOjlJfckYTE9U+PTYjRS1skVXkfJO8coCXQNlKrJAQY95Ng2jWBZAb\nNgtL+8TG1jkBg/M9QnHwPzwV4vzoW2AOh6uM7C81MTrLumOyD6olaR9zcAdO\nUuSYJnNvzjnZcdLVr01fC/W2JTMWKzktqIwKoF/CNEjhkIOiL48+vlHFmxkJ\nmnv3aUr7JTDFmNaj2I72ticrKi20qtv+vrR1OCodCwxXVCMxQgeOHrPhhBhA\ntOzJQGsi4G/QoDyV6okzdcRxnVb3Di6TxXKUtUuHaTRNVRuXji310Eytevnn\nBSiG8dY0GkuTWMsjTDhcO4UvvDKfnm4V5OioZ9hOnI4a0JcjFk2XkNL+gBut\nVf4bYVmeK5MTyD5AhfmNsWkIsdG93MO3HbxrJFZvKqo1s6zdfCtddbuTefTA\nm8NjJnv6P/RbgXx+8wFdYKf97DE7h7a8ed2VPds2rYV8gJt0QP95emI+Tbbr\nvdVr\r\n=+7Qs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPCvxT+QxtyWJKNm5M2/TAjJYqbkf9wnHxRAH0zw4ecgIhANQfvs0bLvSrlteu1qGOjuBM3mWtKCPoJNObisi5dBSG"}]},"_npmUser":{"name":"t2ym","email":"t2y3141592@gmail.com"},"maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-behavior_5.0.0_1632818034243_0.26492108996162944"},"_hasShrinkwrap":false}},"readme":"[![Build Status](https://travis-ci.org/t2ym/i18n-behavior.svg?branch=master)](https://travis-ci.org/t2ym/i18n-behavior)\n[![Coverage Status](https://coveralls.io/repos/github/t2ym/i18n-behavior/badge.svg?branch=master)](https://coveralls.io/github/t2ym/i18n-behavior?branch=master)\n[![npm](https://img.shields.io/npm/v/i18n-behavior.svg)](https://www.npmjs.com/package/i18n-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/t2ym/i18n-behavior)\n\n# i18n-behavior\n\nInstant and Modular I18N engine for [`lit-html`](https://lit-html.polymer-project.org/) and [Polymer](https://polymer-library.polymer-project.org/)\n\n`html`\\`\\` tagged template literal API is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n## Compatible Versions\n\n- Polymer library (`@polymer/polymer` NPM package) is configured as a **peer** dependency since 4.0.0\n- Polymer elements using `I18nBehavior` must depend on `@polymer/polymer` NPM package themselves\n\n| i18n-behavior  | i18n-element   | Polymer | lit-html |\n|:---------------|:---------------|:--------|:---------|\n| 5.x            | 5.x            | 3.x (optional) | 2.x      |\n| 4.x            | 4.x            | 3.x (optional) | 1.x      |\n| 3.x            | 3.x            | 3.x (mandatory) | 1.x      |\n| 2.x            | 2.x            | 1.x-2.x | -        |\n| 1.x            | -              | 1.x     | -        |\n\n- [Changelog](https://github.com/t2ym/i18n-behavior/blob/master/CHANGELOG.md)\n\n## Browser Compatibility\n\nTODO: To be updated\n\n| Browser   | Chrome  | Firefox  | Edge 13+  | IE 11  | Safari 10+ | Chrome Android  | Mobile Safari  | Opera  |\n|:----------|:-------:|:--------:|:---------:|:------:|:---------:|:---------------:|:--------------:|:------:|\n| Supported | ✔       | ✔        | ✔         | ✔      | ✔         | ✔               | ✔              | ✔      |\n\n- Polyfilled by `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js`\n\n## Conceptual Workflow\n\n- `demo/gulpfile.js` provides support for extracting UI strings from `html` tagged template literals in JavaScript sources as well as Polymer HTML templates in HTML Imports\n\n<img src=\"https://raw.githubusercontent.com/wiki/t2ym/i18n-behavior/PolymerI18nFlow.gif\" width=\"768px\">\n\n## Install\n\n```sh\n    npm install i18n-behavior\n```\n\n## Import for Polymer elements\n\n```js\n    import { I18nBehavior } from 'i18n-behavior/i18n-behavior.js'\n```\n\n## Quick Tour\n\n[I18N-ready `pwa-starter-kit`](https://github.com/t2ym/pwa-starter-kit)\n\n```sh\n    npm install -g polymer-cli\n    git clone https://github.com/t2ym/pwa-starter-kit\n    cd pwa-starter-kit\n    npm ci\n    # Add Locales\n    gulp locales --targets=\"de es fr ja zh-Hans\"\n    # I18N Process\n    gulp\n    # Translate XLIFF ./xliff/bundle.*.xlf\n    # Merge Translation\n    gulp\n    # Dev build on http://localhost:8080\n    polymer serve\n    # Static build\n    polymer build\n    # Static build on http://localhost:8080\n    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}\n    python -m SimpleHTTPServer -p 8080\n```\n\n## Usage in Polymer legacy syntax\n\n- [API Docs](https://t2ym.github.io/i18n-behavior/)\n- [Demo](https://t2ym.github.io/i18n-behavior/demo/preprocess/)\n- ES6 class syntax support is provided by [`i18n-element`](https://github.com/t2ym/i18n-element)\n\n### Run-time Automatic I18N\n\nApply `BehaviorsStore.I18nBehavior` or imported `I18nBehavior`\n\n#### Source Code\n\n```js\n    // Legacy Polymer syntax\n    Polymer({\n      importMeta: import.meta,\n      is: 'custom-element',\n      _template: html`\n        <span id=\"label\">UI text label</span> <!-- no need to touch UI text strings -->\n      `,\n      behaviors: [\n        I18nBehavior // Add this line for I18N\n      ]\n    });\n```\n\n#### I18N-ready preprocessed DOM at element registration\n\nHard-coded UI text strings are automatically extracted and replaced with annotations bound to `text` object.\n\n`lang` attribute specifies the current locale. By default, `<html lang>` attribute is observed and\nmirrored to those for I18N-ready element instances.\n\n```html\n    <html lang=\"en\"><!-- html lang attribute is observed and mirrored -->\n      ...\n      <custom-element lang=\"en\">\n        <span id=\"label\">{{text.label}}</span><!-- UI texts are bound to text object -->\n      </custom-element>\n      ...\n    </html>\n```\n\nIf the containing element of the target text has `id` attribute, the string id is named with the `id` value.\nIf not, the string id is automatically generated. It is recommended to put meaningful `id` to each string \nfor robustness. When attaching `id` attribute is too much for the containing element, `text-id` attribute can be used instead.\n\n```html\n    <span text-id=\"label\">{{text.label}}</span>\n```\n\n#### `text` dynamic property\n\n`this.text` dynamic object property represents an object with UI text strings for the current locale.\n\n```javascript\n    this.text = {\n      \"label\": \"UI Text Label\"\n    }\n```\n\n`this.text` dynamic object is SHARED among all the instances of the same custom element.\n\n#### `model` dynamic property\n\n`this.model` is deepcopied from `this.text.model` per instance to store I18N target attribute values.\nUI text strings in I18N target attributes are automatically extracted and replaced with annotations\naccording to the shared repository (`i18n-attr-repo`) of I18N target attributes per elements \n(like `placeholder` attribute of `input` element).\n\nOn `lang-updated` event, `this.text.model` is updated but `this.model` is NOT automatically updated\nand needs explicit update like this.\n\n```javascript\n    listeners: {\n      'lang-updated': '_langUpdated'\n    },\n\n    _langUpdated: function (event) {\n      if (Polymer.dom(event).rootTarget === this) {\n        this.model = deepcopy(this.text.model);\n      }\n    }\n```\n\n#### `<json-data>` for manual text definitions\n\nOptionally, any JSON data can be manually added to I18N target strings via `<json-data>` element.\nThis option is effective for manual extraction of hard-coded UI text strings in JavaScript literals.\n\n```html\n  <dom-module id=\"my-element\">\n    <template>\n      ... <!-- ordinary template for rendering -->\n      <template><!-- containing template element to avoid rendering -->\n        <json-data id=\"items\">[\n          \"Responsive Web App boilerplate\",\n          \"Iron Elements and Paper Elements\",\n          \"End-to-end Build Tooling (including Vulcanize)\",\n          \"Unit testing with Web Component Tester\",\n          \"Routing with Page.js\",\n          \"Offline support with the Platinum Service Worker Elements\"\n        ]</json-data>\n        <json-data id=\"sender\">{ \"name\": \"Sam\", \"gender\": \"male\" }</json-data>\n      </template>\n    </template>\n    <script>\n    ...\n    this.text.items[0] === 'Responsive Web App boilerplate'\n    this.text.sender.name === 'Sam'\n    ...\n    </script>\n  </dom-module>\n```\n\n#### Localized text strings fetched from JSON\n\nWhile default text strings are extracted from the hard-coded strings in HTML template,\nlocalized text strings are asynchronously fetched from JSON files under `locales` directory at the server.\n\n```\n    /bundle.json\n    /locales/bundle.ja.json\n            /bundle.fr.json\n            /bundle.zh-Hans.json\n    \n    /elements/my-list/my-list.json\n                     /locales/my-list.ja.json\n                             /my-list.zh-Hans.json\n    \n             /google-chart-demo/google-chart-demo.json\n                               /locales/google-chart-demo.ja.json\n                                       /google-chart-demo.fr.json\n```\n\n### Build-time Automatic I18N\n\n[`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess) filter performs build-time automatic I18N and embeds UI texts as JSON.\n\nI18N-ready Source Code preprocessed by [`gulp-i18n-preprocess`](https://github.com/t2ym/gulp-i18n-preprocess):\n\n```html\n    <dom-module id=\"custom-element\">\n      <template localizable-text=\"embedded\">\n        <span id=\"label\">{{text.label}}</span>\n        <template id=\"localizable-text\">\n          <json-data>{\n            \"label\": \"UI Text Label\"\n          }</json-data>\n        </template>\n      </template>\n    </dom-module>\n```\n\nDefault text values are immediately extracted from the embedded JSON \nwithout overheads of run-time traversal into the whole template.\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/i18n-behavior/blob/master/LICENSE.md)\n","maintainers":[{"name":"t2ym","email":"t2y3141592@gmail.com"}],"time":{"modified":"2022-06-18T23:45:36.211Z","created":"2016-02-21T15:08:00.330Z","0.0.28":"2016-02-21T15:08:00.330Z","0.0.29":"2016-02-22T03:38:43.625Z","0.0.30":"2016-02-23T02:06:01.127Z","0.0.31":"2016-02-23T02:11:37.043Z","0.0.34":"2016-02-23T14:34:29.606Z","0.0.36":"2016-02-29T09:05:49.011Z","0.0.37":"2016-03-01T02:39:03.999Z","0.0.41":"2016-03-04T08:15:04.971Z","0.0.43":"2016-03-05T12:22:45.953Z","0.0.44":"2016-03-06T12:13:56.750Z","0.0.45":"2016-03-07T02:57:09.547Z","0.0.46":"2016-03-07T08:15:43.963Z","0.0.47":"2016-03-08T14:54:35.734Z","0.0.48":"2016-03-10T03:25:19.058Z","0.0.49":"2016-03-10T14:39:15.186Z","0.0.50":"2016-03-12T07:07:50.800Z","0.0.51":"2016-03-13T14:30:02.036Z","0.0.52":"2016-03-14T04:43:28.847Z","0.0.53":"2016-03-16T14:04:10.171Z","0.0.54":"2016-03-18T04:07:12.060Z","0.0.55":"2016-03-20T14:39:41.845Z","0.0.56":"2016-03-21T06:37:48.120Z","0.0.57":"2016-03-21T08:07:45.187Z","0.0.58":"2016-03-22T14:49:56.577Z","0.0.59":"2016-03-25T04:37:41.949Z","0.0.60":"2016-03-28T10:15:22.846Z","1.0.0":"2016-03-29T12:32:07.664Z","1.0.1":"2016-05-31T13:20:47.741Z","1.0.2":"2016-06-20T13:28:51.979Z","1.0.3":"2016-06-24T10:49:21.687Z","1.0.4":"2016-06-24T12:44:12.168Z","1.0.5":"2016-06-25T12:01:51.932Z","1.0.6":"2016-06-25T12:40:46.090Z","1.0.7":"2016-06-25T13:23:51.363Z","1.0.8":"2016-06-25T13:40:59.165Z","1.0.9":"2016-06-25T15:04:22.020Z","1.0.10":"2016-06-26T08:46:24.581Z","1.1.0":"2016-06-27T09:28:25.454Z","1.1.1":"2016-07-07T13:08:51.630Z","1.1.2":"2016-07-08T02:42:05.016Z","1.1.3":"2016-07-09T14:23:41.624Z","1.1.4":"2016-07-11T07:23:32.856Z","1.1.5":"2016-07-14T07:29:21.331Z","1.1.6":"2016-08-09T13:16:25.059Z","1.1.7":"2016-08-24T08:44:29.100Z","1.1.8":"2016-08-25T06:11:47.685Z","1.1.9":"2016-10-12T17:21:20.930Z","2.0.0":"2017-05-16T11:38:47.950Z","3.0.0-pre.1":"2018-12-15T14:26:30.009Z","3.0.0-pre.2":"2018-12-16T08:24:53.731Z","3.0.0-pre.3":"2018-12-17T02:51:25.319Z","3.0.0-pre.4":"2018-12-17T03:42:57.501Z","3.0.0-pre.5":"2018-12-17T07:25:01.685Z","3.0.0-pre.6":"2018-12-19T02:22:57.699Z","3.0.0-pre.7":"2018-12-22T08:32:26.060Z","3.0.0-pre.8":"2018-12-22T13:29:16.804Z","3.0.0-pre.9":"2018-12-22T15:48:26.588Z","3.0.0-pre.10":"2018-12-22T16:09:01.882Z","3.0.0-pre.11":"2018-12-23T03:52:50.203Z","3.0.0-pre.12":"2018-12-23T06:47:56.733Z","3.0.0-pre.13":"2018-12-31T04:29:36.663Z","3.0.0-pre.14":"2019-01-01T05:37:32.660Z","3.0.0-pre.15":"2019-01-08T09:58:55.493Z","3.0.0-pre.16":"2019-01-08T11:00:59.179Z","3.0.0-pre.17":"2019-01-09T01:32:03.924Z","3.0.0-pre.18":"2019-01-11T09:50:02.514Z","3.0.0-pre.19":"2019-01-16T13:29:48.558Z","3.0.0-pre.20":"2019-01-19T13:25:56.045Z","3.0.0-pre.21":"2019-01-20T07:05:45.256Z","3.0.0-pre.22":"2019-01-22T08:58:57.994Z","3.0.0-pre.23":"2019-02-01T14:44:58.370Z","3.0.0-pre.24":"2019-02-02T12:51:56.174Z","3.0.0-rc.1":"2019-02-08T05:31:46.764Z","3.0.0-rc.2":"2019-02-11T08:24:09.505Z","3.0.0-rc.3":"2019-02-24T12:01:44.402Z","3.0.0":"2019-02-24T12:31:52.820Z","4.0.0-pre.1":"2019-03-04T07:31:45.135Z","4.0.0-pre.2":"2019-03-04T09:35:54.080Z","4.0.0-pre.3":"2019-03-04T14:19:31.934Z","4.0.0-pre.4":"2019-03-05T12:12:43.013Z","4.0.0-pre.6":"2019-03-06T13:21:02.099Z","4.0.0-pre.7":"2019-03-07T07:02:19.764Z","4.0.0-pre.8":"2019-03-08T10:40:24.043Z","4.0.0-pre.9":"2019-03-09T08:09:42.297Z","4.0.0-pre.10":"2019-03-15T05:37:18.217Z","4.0.0-pre.11":"2019-03-15T12:43:47.129Z","4.0.0-pre.12":"2019-03-15T13:09:46.465Z","4.0.0-pre.13":"2019-03-15T22:09:55.696Z","4.0.0-pre.14":"2019-03-16T00:32:34.540Z","4.0.0-pre.15":"2019-03-17T08:24:43.505Z","4.0.0-pre.16":"2019-03-18T07:48:51.404Z","4.0.0-pre.17":"2019-03-18T13:08:11.399Z","4.0.0-pre.18":"2019-03-19T04:54:12.137Z","4.0.0-pre.19":"2019-03-20T08:15:29.110Z","4.0.0":"2019-03-20T12:18:25.033Z","4.0.1":"2020-03-28T07:11:35.923Z","5.0.0":"2021-09-28T08:33:54.728Z"},"homepage":"https://github.com/t2ym/i18n-behavior#readme","keywords":["polymer","polymer3","lit-html","web-components","web-component","i18n","internationalization","l10n","localization","format","customElementsV1"],"repository":{"type":"git","url":"git+https://github.com/t2ym/i18n-behavior.git"},"author":{"name":"Tetsuya Mori","email":"t2y3141592@gmail.com"},"bugs":{"url":"https://github.com/t2ym/i18n-behavior/issues"},"license":"BSD-2-Clause","readmeFilename":"README.md","users":{"t2ym":true}}