From 16c2dccefc24e7d70f5d53bed5970173d5c125b6 Mon Sep 17 00:00:00 2001 From: Stijn de Witt Date: Tue, 27 Mar 2018 13:31:49 +0200 Subject: [PATCH 1/3] Installed i18nline and preact-i18nline --- package-lock.json | 230 ++++++++++++++++++++++++++++++++++------------ package.json | 2 + 2 files changed, 171 insertions(+), 61 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0aa56f1..7f4f62e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -415,14 +415,12 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, "ansi-wrap": { "version": "0.1.0", @@ -616,6 +614,11 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "ast-types": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.11.3.tgz", + "integrity": "sha512-XA5o5dsNw8MhyW0Q7MWXJWc4oOzZKbdsEJq45h7c8q/d9DwWZ5F2ugUc1PuMLPGsUnphCt/cNDHu8JeBbxf1qA==" + }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", @@ -685,7 +688,6 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, "requires": { "chalk": "1.1.3", "esutils": "2.0.2", @@ -696,7 +698,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, "requires": { "ansi-styles": "2.2.1", "escape-string-regexp": "1.0.5", @@ -708,8 +709,7 @@ "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" } } }, @@ -977,7 +977,6 @@ "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, "requires": { "babel-runtime": "6.26.0" } @@ -1539,7 +1538,6 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, "requires": { "core-js": "2.5.3", "regenerator-runtime": "0.11.1" @@ -1548,8 +1546,7 @@ "core-js": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", - "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", - "dev": true + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=" } } }, @@ -1578,7 +1575,6 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, "requires": { "babel-code-frame": "6.26.0", "babel-messages": "6.23.0", @@ -1594,14 +1590,12 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "requires": { "ms": "2.0.0" } @@ -1609,8 +1603,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" } } }, @@ -1618,7 +1611,6 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", @@ -1629,8 +1621,7 @@ "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" } } }, @@ -2657,7 +2648,6 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -2665,8 +2655,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "color-string": { "version": "0.3.0", @@ -2987,8 +2976,7 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cosmiconfig": { "version": "2.2.2", @@ -3005,6 +2993,11 @@ "require-from-string": "1.2.1" } }, + "crc32": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/crc32/-/crc32-0.2.2.tgz", + "integrity": "sha1-etIg1v/c0Rn5/BJ6d3LKzqOQpLo=" + }, "create-ecdh": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", @@ -4423,8 +4416,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { "version": "1.9.0", @@ -4629,8 +4621,7 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", - "dev": true + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" }, "esquery": { "version": "1.0.0", @@ -4660,8 +4651,7 @@ "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "etag": { "version": "1.8.1", @@ -4887,8 +4877,7 @@ "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", - "dev": true + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, "extend-shallow": { "version": "2.0.1", @@ -6354,6 +6343,11 @@ } } }, + "gglobby": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/gglobby/-/gglobby-0.0.3.tgz", + "integrity": "sha1-x9aGwf8spOiCpYrfOKfeJpG6f5k=" + }, "gittar": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/gittar/-/gittar-0.1.0.tgz", @@ -6763,7 +6757,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, "requires": { "ansi-regex": "2.1.1" } @@ -7167,6 +7160,83 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, + "i18n-js": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/i18n-js/-/i18n-js-3.0.3.tgz", + "integrity": "sha512-u144MQhV/8mz4Y5wP86SQAWMwS8gpe/JavIa9hugSI4WreezGgbhJPdk2Q60KcdIltKLiNefGtHNh1N8SSmQqQ==" + }, + "i18nline": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/i18nline/-/i18nline-1.7.0.tgz", + "integrity": "sha512-Gm1V4SoXpms0py7YT2qiyc9LplVz1odEoJPXAf2Z8H8jVRU05Xcjnctzp1dgdhVvGRO0yDaEK7aBzmyjB61CMQ==", + "requires": { + "babel-traverse": "6.26.0", + "babylon": "6.18.0", + "chalk": "2.3.2", + "crc32": "0.2.2", + "esprima": "4.0.0", + "extend": "3.0.1", + "gglobby": "0.0.3", + "i18n-js": "3.0.3", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "speakingurl": "14.0.1", + "ulog": "1.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.1" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", @@ -7287,8 +7357,7 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", @@ -7855,8 +7924,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { "version": "2.0.0", @@ -8970,8 +9038,7 @@ "lodash": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" }, "lodash._basecopy": { "version": "3.0.1", @@ -9514,8 +9581,7 @@ "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "minipass": { "version": "2.2.1", @@ -9633,8 +9699,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "multicast-dns": { "version": "6.2.3", @@ -12640,6 +12705,31 @@ "standalone-react-addons-pure-render-mixin": "0.1.1" } }, + "preact-i18nline": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/preact-i18nline/-/preact-i18nline-1.7.0.tgz", + "integrity": "sha512-8lEmx5toC9UZ22bVxFmqc81eUHs2iiJmWEy0GxoSsDJI8tZNZMVEsdia8DZY6AaxnNkv3xft9H1GqqXvlDvSYA==", + "requires": { + "esprima": "4.0.0", + "extend": "3.0.1", + "i18nline": "1.7.0", + "invariant": "2.2.4", + "preact": "8.2.7", + "recast": "0.14.7", + "through2": "2.0.3", + "ulog": "1.1.0" + }, + "dependencies": { + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "1.3.1" + } + } + } + }, "preact-render-spy": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/preact-render-spy/-/preact-render-spy-1.2.2.tgz", @@ -12711,8 +12801,7 @@ "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "process": { "version": "0.11.10", @@ -12723,8 +12812,7 @@ "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "progress": { "version": "1.1.8", @@ -13063,7 +13151,6 @@ "version": "2.3.4", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", - "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -13086,6 +13173,24 @@ "set-immediate-shim": "1.0.1" } }, + "recast": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.14.7.tgz", + "integrity": "sha512-/nwm9pkrcWagN40JeJhkPaRxiHXBRkXyRh/hgU088Z/v+qCy+zIHHY6bC6o7NaKAxPqtE6nD8zBH1LfU0/Wx6A==", + "requires": { + "ast-types": "0.11.3", + "esprima": "4.0.0", + "private": "0.1.8", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, "redent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", @@ -13141,8 +13246,7 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" }, "regenerator-transform": { "version": "0.10.1", @@ -13489,8 +13593,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, "sane": { "version": "2.4.1", @@ -14131,6 +14234,11 @@ } } }, + "speakingurl": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/speakingurl/-/speakingurl-14.0.1.tgz", + "integrity": "sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==" + }, "split": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", @@ -14454,7 +14562,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, "requires": { "safe-buffer": "5.1.1" } @@ -14469,7 +14576,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, "requires": { "ansi-regex": "2.1.1" } @@ -14941,7 +15047,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, "requires": { "readable-stream": "2.3.4", "xtend": "4.0.1" @@ -15272,6 +15377,11 @@ "webpack-sources": "1.1.0" } }, + "ulog": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ulog/-/ulog-1.1.0.tgz", + "integrity": "sha512-oQDYGh4w/ykGSpffEuwkqFnL5BYJa5HeV5PhpkjuAFwJCyjp2KjT2YDcFa8y4ie8kejdXMwpFCSF6HNM5Kia4g==" + }, "unfetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unfetch/-/unfetch-3.0.0.tgz", @@ -15651,8 +15761,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utila": { "version": "0.4.0", @@ -16803,8 +16912,7 @@ "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" }, "y18n": { "version": "3.2.1", diff --git a/package.json b/package.json index 98af924..3a6bd61 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,10 @@ "preact-render-spy": "^1.2.1" }, "dependencies": { + "i18nline": "^1.7.0", "preact": "^8.2.6", "preact-compat": "^3.17.0", + "preact-i18nline": "^1.7.0", "preact-router": "^2.5.7" }, "jest": { From ac6f493e7b8a09976fc017e6ef000940c4a3e3f6 Mon Sep 17 00:00:00 2001 From: Stijn de Witt Date: Thu, 5 Apr 2018 21:17:27 +0200 Subject: [PATCH 2/3] I18n: Added German and Dutch languages * Added libraries i18nline and preact-i18nline * Added a config that adds the preact-i18nline/webpack-loader * Added a LanguagePicker component * Modified the Header component + Translated the links + Made it render children * Modified the App component + Import the i18n index file + Added LanguagePicker as a child of Header + When language selected, switch locale + When locale switched, re-render * Added i18n config to package.json + auto-translate h1 and Link elements * Added folder src/i18n + default.json: default translations as extracted from source + de.json: German translation messages + en.json: English translation messages + nl.json: Dutch translation messages + index.js: Index file that takes care of config and imports --- package-lock.json | 52 +++++++++++++++++++++---- package.json | 13 +++++-- preact.config.js | 16 ++++++++ src/components/LanguagePicker/index.js | 27 +++++++++++++ src/components/LanguagePicker/style.css | 4 ++ src/components/app.js | 19 ++++++++- src/components/header/index.js | 8 ++-- src/i18n/de.json | 14 +++++++ src/i18n/default.json | 14 +++++++ src/i18n/en.json | 14 +++++++ src/i18n/index.js | 26 +++++++++++++ src/i18n/nl.json | 14 +++++++ 12 files changed, 207 insertions(+), 14 deletions(-) create mode 100644 preact.config.js create mode 100644 src/components/LanguagePicker/index.js create mode 100644 src/components/LanguagePicker/style.css create mode 100644 src/i18n/de.json create mode 100644 src/i18n/default.json create mode 100644 src/i18n/en.json create mode 100644 src/i18n/index.js create mode 100644 src/i18n/nl.json diff --git a/package-lock.json b/package-lock.json index 7f4f62e..66b2b5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7166,9 +7166,9 @@ "integrity": "sha512-u144MQhV/8mz4Y5wP86SQAWMwS8gpe/JavIa9hugSI4WreezGgbhJPdk2Q60KcdIltKLiNefGtHNh1N8SSmQqQ==" }, "i18nline": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/i18nline/-/i18nline-1.7.0.tgz", - "integrity": "sha512-Gm1V4SoXpms0py7YT2qiyc9LplVz1odEoJPXAf2Z8H8jVRU05Xcjnctzp1dgdhVvGRO0yDaEK7aBzmyjB61CMQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/i18nline/-/i18nline-2.0.1.tgz", + "integrity": "sha512-abACtOMahZSwCDL2C1Flqr+WxSQaWgVNCd74UGvsvkVdrt6mFyas2i6XUX74hio5hnGkc9u862t/4y68rIv8nQ==", "requires": { "babel-traverse": "6.26.0", "babylon": "6.18.0", @@ -7181,6 +7181,7 @@ "minimist": "1.2.0", "mkdirp": "0.5.1", "speakingurl": "14.0.1", + "uevents": "1.0.0", "ulog": "1.1.0" }, "dependencies": { @@ -12706,13 +12707,14 @@ } }, "preact-i18nline": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/preact-i18nline/-/preact-i18nline-1.7.0.tgz", - "integrity": "sha512-8lEmx5toC9UZ22bVxFmqc81eUHs2iiJmWEy0GxoSsDJI8tZNZMVEsdia8DZY6AaxnNkv3xft9H1GqqXvlDvSYA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/preact-i18nline/-/preact-i18nline-2.0.0.tgz", + "integrity": "sha512-49AOtFcg7TOpzQU6zNNN5uGbIBNRnFJmBgE43VxUw+eTsk9QQme2Wj7m0jDVmO/4XT8Q+T4q4riZCHxMy5mY2g==", "requires": { + "chalk": "2.3.2", "esprima": "4.0.0", "extend": "3.0.1", - "i18nline": "1.7.0", + "i18nline": "2.0.1", "invariant": "2.2.4", "preact": "8.2.7", "recast": "0.14.7", @@ -12720,6 +12722,29 @@ "ulog": "1.1.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -12727,6 +12752,14 @@ "requires": { "loose-envify": "1.3.1" } + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "requires": { + "has-flag": "3.0.0" + } } } }, @@ -15334,6 +15367,11 @@ "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.17.tgz", "integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g==" }, + "uevents": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/uevents/-/uevents-1.0.0.tgz", + "integrity": "sha1-IAXppHL7CkbIJuz9GJrtmI7F6+E=" + }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", diff --git a/package.json b/package.json index 3a6bd61..a6ea3d3 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "lint": "eslint src", "test": "jest ./tests", "test:e2e": "cypress run", - "deploy": "npm run build && firebase deploy" + "deploy": "npm run build && firebase deploy", + "i18n": "i18nline synch" }, "eslintConfig": { "extends": "eslint-config-synacor" @@ -31,10 +32,10 @@ "preact-render-spy": "^1.2.1" }, "dependencies": { - "i18nline": "^1.7.0", + "i18nline": "^2.0.1", "preact": "^8.2.6", "preact-compat": "^3.17.0", - "preact-i18nline": "^1.7.0", + "preact-i18nline": "^2.0.0", "preact-router": "^2.5.7" }, "jest": { @@ -60,5 +61,11 @@ "^create-react-class$": "preact-compat/lib/create-react-class", "^react-addons-css-transition-group$": "preact-css-transition-group" } + }, + "i18n": { + "autoTranslateTags": [ + "h1", + "Link" + ] } } diff --git a/preact.config.js b/preact.config.js new file mode 100644 index 0000000..cffa71b --- /dev/null +++ b/preact.config.js @@ -0,0 +1,16 @@ +export default (config, env, helpers) => { + // Use Preact CLI's helpers object to get the babel-loader + let babel = helpers.getLoadersByName(config, 'babel-loader')[0].rule; + // Update the loader config to include preact-i18nline + babel.loader = [ + { // create an entry for the old loader + loader: babel.loader, + options: babel.options + }, + { // add the preact-i18nline webpack loader + loader: 'preact-i18nline/webpack-loader' + } + ]; + // remove the old loader options + delete babel.options; +}; diff --git a/src/components/LanguagePicker/index.js b/src/components/LanguagePicker/index.js new file mode 100644 index 0000000..713b0d8 --- /dev/null +++ b/src/components/LanguagePicker/index.js @@ -0,0 +1,27 @@ +import { h } from 'preact'; +import I18n from 'i18nline'; +import style from './style'; + +const locales = () => [ + { k: 'en', v: I18n.t('English') }, + { k: 'de', v: I18n.t('German') }, + { k: 'nl', v: I18n.t('Dutch') } +]; + +const LanguagePicker = props => ( + +); + +const changeListener = (props) => (e) => { + const lang = e.target.options[e.target.selectedIndex].value; + props.changeLocale && props.changeLocale(lang, e); + e.preventDefault(); +}; + +const alphabetic = (x,y) => (x.v < y.v ? -1 : x.v > y.v ? 1 : 0); + +export default LanguagePicker; diff --git a/src/components/LanguagePicker/style.css b/src/components/LanguagePicker/style.css new file mode 100644 index 0000000..bacedc5 --- /dev/null +++ b/src/components/LanguagePicker/style.css @@ -0,0 +1,4 @@ +.languagePicker { + margin: auto 20px auto auto; + width: 100px; +} diff --git a/src/components/app.js b/src/components/app.js index 91a017c..5899828 100644 --- a/src/components/app.js +++ b/src/components/app.js @@ -1,6 +1,8 @@ import { h, Component } from 'preact'; import { Router } from 'preact-router'; +import I18n from '../i18n'; import Header from './header'; +import LanguagePicker from './LanguagePicker'; import Home from '../routes/home'; import New from '../routes/new'; import Best from '../routes/best'; @@ -8,13 +10,28 @@ import Item from '../routes/item'; if (module.hot) { require('preact/debug'); + ((typeof window === 'object') && window || global).I18n = I18n; } export default class App extends Component { + localeChanged = (locale) => { + this.setState({ locale }); + } + + componentDidMount() { + I18n.on('change', this.localeChanged); + } + + componentWillUnmount() { + I18n.removeListener('change', this.localeChanged); + } + render() { return (
-
+
+ +
diff --git a/src/components/header/index.js b/src/components/header/index.js index 7b64f25..c66dc9a 100644 --- a/src/components/header/index.js +++ b/src/components/header/index.js @@ -1,5 +1,6 @@ import { h, Component } from 'preact'; import { Link } from 'preact-router/match'; +import I18n from 'i18nline/lib/i18n'; import style from './style'; export default class Header extends Component { @@ -8,10 +9,11 @@ export default class Header extends Component {

Preact HNPWA

+ {this.props.children}
); } diff --git a/src/i18n/de.json b/src/i18n/de.json new file mode 100644 index 0000000..40b9c78 --- /dev/null +++ b/src/i18n/de.json @@ -0,0 +1,14 @@ +{ + "de": { + "best_e9c34252": "Beste", + "comments_count_0_no_comments_comments_count_1_1_co_56eb6f20": "%{comments_count_0_no_comments} %{comments_count_1_1_comment} %{comments_count_1_comments_count_comments}", + "dutch_6d05cee5": "Niederländisch", + "english_c60612e2": "Englisch", + "german_3ec99bbb": "Deutsch", + "item_title_item_domain_2ba8bfc4": "* %{item_title} **(%{item_domain})** *", + "more_cf9cc661": "Mehr", + "new_13daf639": "Neu", + "preact_hnpwa_f9c867d6": "Preact HNPWA", + "top_66e0adb6": "Top" + } +} \ No newline at end of file diff --git a/src/i18n/default.json b/src/i18n/default.json new file mode 100644 index 0000000..8cffa78 --- /dev/null +++ b/src/i18n/default.json @@ -0,0 +1,14 @@ +{ + "en": { + "best_e9c34252": "Best", + "comments_count_0_no_comments_comments_count_1_1_co_56eb6f20": "%{comments_count_0_no_comments} %{comments_count_1_1_comment} %{comments_count_1_comments_count_comments}", + "dutch_6d05cee5": "Dutch", + "english_c60612e2": "English", + "german_3ec99bbb": "German", + "item_title_item_domain_2ba8bfc4": "* %{item_title} **(%{item_domain})** *", + "more_cf9cc661": "More", + "new_13daf639": "New", + "preact_hnpwa_f9c867d6": "Preact HNPWA", + "top_66e0adb6": "Top" + } +} \ No newline at end of file diff --git a/src/i18n/en.json b/src/i18n/en.json new file mode 100644 index 0000000..8cffa78 --- /dev/null +++ b/src/i18n/en.json @@ -0,0 +1,14 @@ +{ + "en": { + "best_e9c34252": "Best", + "comments_count_0_no_comments_comments_count_1_1_co_56eb6f20": "%{comments_count_0_no_comments} %{comments_count_1_1_comment} %{comments_count_1_comments_count_comments}", + "dutch_6d05cee5": "Dutch", + "english_c60612e2": "English", + "german_3ec99bbb": "German", + "item_title_item_domain_2ba8bfc4": "* %{item_title} **(%{item_domain})** *", + "more_cf9cc661": "More", + "new_13daf639": "New", + "preact_hnpwa_f9c867d6": "Preact HNPWA", + "top_66e0adb6": "Top" + } +} \ No newline at end of file diff --git a/src/i18n/index.js b/src/i18n/index.js new file mode 100644 index 0000000..4a4a47f --- /dev/null +++ b/src/i18n/index.js @@ -0,0 +1,26 @@ +// Generated by i18nline and preact-i18nline. +import I18n from 'preact-i18nline/i18n'; + +I18n.supportedLocales = ['de','en','nl']; +I18n.defaultLocale = 'en'; + +I18n.import = locale => { + // we use a switch here so the import statements are statically + // analyzable. the use of import() will make build tools generate + // separate bundles which are downloaded on-demand. + switch (locale) { + case 'de': return import(/* webpackChunkName: 'i18n.de' */ './de.json'); + case 'en': return import(/* webpackChunkName: 'i18n.en' */ './en.json'); + case 'nl': return import(/* webpackChunkName: 'i18n.nl' */ './nl.json'); + default: return import(/* webpackChunkName: 'i18n.default' */ './default.json'); + } +}; + +if ((typeof module === 'object') && module.hot) { + module.hot.accept('./de.json', I18n.reload('de')); + module.hot.accept('./en.json', I18n.reload('en')); + module.hot.accept('./nl.json', I18n.reload('nl')); + module.hot.accept('./default.json', I18n.reload('default')); +} + +export default I18n; diff --git a/src/i18n/nl.json b/src/i18n/nl.json new file mode 100644 index 0000000..6f28bc2 --- /dev/null +++ b/src/i18n/nl.json @@ -0,0 +1,14 @@ +{ + "nl": { + "best_e9c34252": "Beste", + "comments_count_0_no_comments_comments_count_1_1_co_56eb6f20": "%{comments_count_0_no_comments} %{comments_count_1_1_comment} %{comments_count_1_comments_count_comments}", + "dutch_6d05cee5": "Nederlands", + "english_c60612e2": "Engels", + "german_3ec99bbb": "Duits", + "item_title_item_domain_2ba8bfc4": "* %{item_title} **(%{item_domain})** *", + "more_cf9cc661": "Meer", + "new_13daf639": "Nieuw", + "preact_hnpwa_f9c867d6": "Preact HNPWA", + "top_66e0adb6": "Top" + } +} \ No newline at end of file From 975b79136005f5e9eab20efd07ba19a4bf7cb588 Mon Sep 17 00:00:00 2001 From: Stijn de Witt Date: Fri, 6 Apr 2018 20:09:46 +0200 Subject: [PATCH 3/3] Modified LanguagePicker to be a class on request of Vu --- src/components/LanguagePicker/index.js | 34 ++++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/components/LanguagePicker/index.js b/src/components/LanguagePicker/index.js index 713b0d8..2c09d8d 100644 --- a/src/components/LanguagePicker/index.js +++ b/src/components/LanguagePicker/index.js @@ -1,4 +1,4 @@ -import { h } from 'preact'; +import { h, Component } from 'preact'; import I18n from 'i18nline'; import style from './style'; @@ -8,20 +8,22 @@ const locales = () => [ { k: 'nl', v: I18n.t('Dutch') } ]; -const LanguagePicker = props => ( - -); - -const changeListener = (props) => (e) => { - const lang = e.target.options[e.target.selectedIndex].value; - props.changeLocale && props.changeLocale(lang, e); - e.preventDefault(); -}; - const alphabetic = (x,y) => (x.v < y.v ? -1 : x.v > y.v ? 1 : 0); -export default LanguagePicker; +export default class LanguagePicker extends Component { + changeListener = (e) => { + const lang = e.target.options[e.target.selectedIndex].value; + this.props.changeLocale && this.props.changeLocale(lang, e); + e.preventDefault(); + } + + render (props) { + return ( + + ); + } +}