diff --git a/.meteor/versions b/.meteor/versions index 7b985c8b546..42a612d7a8f 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -141,7 +141,7 @@ react-runtime@0.14.4 react-runtime-dev@0.14.4 react-runtime-prod@0.14.4 react-template-helper@0.2.6 -reactioncommerce:core@0.12.0 +reactioncommerce:core@0.12.1 reactioncommerce:core-theme@2.0.1 reactioncommerce:default-theme@1.0.4 reactioncommerce:launchdock-connect@0.2.1 @@ -155,7 +155,7 @@ reactioncommerce:reaction-checkout@1.0.0 reactioncommerce:reaction-collections@2.0.1 reactioncommerce:reaction-dashboard@1.0.0 reactioncommerce:reaction-email-templates@0.2.0 -reactioncommerce:reaction-i18n@2.0.0 +reactioncommerce:reaction-i18n@2.0.1 reactioncommerce:reaction-inventory@0.2.3 reactioncommerce:reaction-layout@1.0.0 reactioncommerce:reaction-logger@0.1.0 @@ -165,7 +165,7 @@ reactioncommerce:reaction-paypal@1.3.0 reactioncommerce:reaction-product-variant@1.0.0 reactioncommerce:reaction-router@1.1.0 reactioncommerce:reaction-sample-data@0.1.2 -reactioncommerce:reaction-schemas@2.0.4 +reactioncommerce:reaction-schemas@2.0.5 reactioncommerce:reaction-shipping@0.8.0 reactioncommerce:reaction-social@0.4.3 reactioncommerce:reaction-stripe@3.1.2 diff --git a/README.md b/README.md index bd4ed28aff8..cfc0fe754b7 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,12 @@ Reaction is a modern reactive, real-time event driven ecommerce platform. Reaction is built with JavaScript (ES6), Meteor, Node.js and works nicely with Docker. ## Status -- 0.12.1 Master (stable) -- 0.13.0 Development (latest) +- 0.12.2 Master ( [stable](https://github.com/reactioncommerce/reaction/tree/master) ) +- 0.13.0 Development ( [latest](https://github.com/reactioncommerce/reaction/tree/development) / [0.13.0](https://github.com/reactioncommerce/reaction/tree/development-v0.13) ) -Currently good for contributing/observing progress, testing. It goes without saying that we're always improving, even things that are functionally done. We'd encourage due diligence in production usage, be very comfortable with the code, and risk tolerant. There are still many parts in development! +Reaction is expected to have a stable codebase ready for some production configurations within the next couple of major releases. Be aware though, that we're updating frequently. Even existing structures that are functionally done are getting frequent updates to ensure we're current with the most current libraries available to us. + + Currently good for contributing, observing progress, and testing. We'd encourage due diligence in production usage, be very comfortable with the code, and risk tolerant. There are still many parts in development! ## Docs Installation, configuration and development documentation is available on [docs.reactioncommerce.com](https://docs.reactioncommerce.com/) diff --git a/package.json b/package.json index 29436e0a42e..1c6d6087f3e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "name": "reaction", "description": "Reaction is a modern reactive, real-time event driven ecommerce platform.", - "version": "0.12.1", + "version": "0.12.2", "main": "main.js", "directories": { "test": "tests" diff --git a/packages/reaction-core/package.js b/packages/reaction-core/package.js index e727fdf00e3..995ad75cca7 100755 --- a/packages/reaction-core/package.js +++ b/packages/reaction-core/package.js @@ -1,7 +1,7 @@ Package.describe({ summary: "Reaction Commerce Core", name: "reactioncommerce:core", - version: "0.12.0", + version: "0.12.1", documentation: "README.md" }); diff --git a/packages/reaction-core/server/import.js b/packages/reaction-core/server/import.js index 4c04f3e131c..3ef54a5d693 100644 --- a/packages/reaction-core/server/import.js +++ b/packages/reaction-core/server/import.js @@ -253,7 +253,8 @@ ReactionImport.package = function (pkg, shopId) { * @returns {Object} updated translation buffer */ ReactionImport.translation = function (key, translation) { - return this.object(ReactionCore.Collections.Translations, key, translation); + const modifiedKey = Object.assign(key, { ns: translation.ns }); + return this.object(ReactionCore.Collections.Translations, modifiedKey, translation); }; // diff --git a/packages/reaction-i18n/client/helpers/i18n.js b/packages/reaction-i18n/client/helpers/i18n.js index 0901e32bf96..b70d4816fb8 100644 --- a/packages/reaction-i18n/client/helpers/i18n.js +++ b/packages/reaction-i18n/client/helpers/i18n.js @@ -131,7 +131,13 @@ Tracker.autorun(function () { }).fetch(); // map reduce translations into i18next formatting const resources = translations.reduce(function (x, y) { - x[y.i18n] = y.translation; + const ns = Object.keys(y.translation)[0]; + // first creating the structure, when add additional namespaces + if (x[y.i18n]) { + x[y.i18n][ns] = y.translation[ns]; + } else { + x[y.i18n] = y.translation; + } return x; }, {}); diff --git a/packages/reaction-i18n/package.js b/packages/reaction-i18n/package.js index 9d5c3ffdfbf..842a1912cc5 100644 --- a/packages/reaction-i18n/package.js +++ b/packages/reaction-i18n/package.js @@ -1,7 +1,7 @@ Package.describe({ summary: "Reaction Commerce i18n utilities", name: "reactioncommerce:reaction-i18n", - version: "2.0.0", + version: "2.0.1", documentation: "README.md" }); diff --git a/packages/reaction-i18n/private/data/i18n/ar.json b/packages/reaction-i18n/private/data/i18n/ar.json index 01598453de4..04e70b9462f 100644 --- a/packages/reaction-i18n/private/data/i18n/ar.json +++ b/packages/reaction-i18n/private/data/i18n/ar.json @@ -2,6 +2,7 @@ { "language": "Arabic", "i18n": "ar", + "ns": "core", "translation": { "core": { "languageDirection": "rtl", diff --git a/packages/reaction-i18n/private/data/i18n/bg.json b/packages/reaction-i18n/private/data/i18n/bg.json index ae468165be0..4e3035580d2 100644 --- a/packages/reaction-i18n/private/data/i18n/bg.json +++ b/packages/reaction-i18n/private/data/i18n/bg.json @@ -1,6 +1,7 @@ [{ "language": "Български", "i18n": "bg", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/cn.json b/packages/reaction-i18n/private/data/i18n/cn.json index 46ec43dc906..faa2a3466d5 100644 --- a/packages/reaction-i18n/private/data/i18n/cn.json +++ b/packages/reaction-i18n/private/data/i18n/cn.json @@ -1,6 +1,7 @@ [{ "language": "中文(简体)", "i18n": "cn", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/cs.json b/packages/reaction-i18n/private/data/i18n/cs.json index 9388ee4f279..9825743c857 100644 --- a/packages/reaction-i18n/private/data/i18n/cs.json +++ b/packages/reaction-i18n/private/data/i18n/cs.json @@ -2,6 +2,7 @@ { "language": "Czech", "i18n": "cs", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/private/data/i18n/de.json b/packages/reaction-i18n/private/data/i18n/de.json index f18067acea4..2f9a24577ff 100644 --- a/packages/reaction-i18n/private/data/i18n/de.json +++ b/packages/reaction-i18n/private/data/i18n/de.json @@ -2,6 +2,7 @@ { "language": "German", "i18n": "de", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/el.json b/packages/reaction-i18n/private/data/i18n/el.json index c07e7a301e1..f76963ff09b 100644 --- a/packages/reaction-i18n/private/data/i18n/el.json +++ b/packages/reaction-i18n/private/data/i18n/el.json @@ -2,6 +2,7 @@ { "language": "Ελληνικά", "i18n": "el", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/en.json b/packages/reaction-i18n/private/data/i18n/en.json index a2421ff2332..6f7a1d0a78a 100644 --- a/packages/reaction-i18n/private/data/i18n/en.json +++ b/packages/reaction-i18n/private/data/i18n/en.json @@ -1,6 +1,7 @@ [{ "language": "English", "i18n": "en", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/es.json b/packages/reaction-i18n/private/data/i18n/es.json index 0ffdc00a858..da67a3d00c9 100644 --- a/packages/reaction-i18n/private/data/i18n/es.json +++ b/packages/reaction-i18n/private/data/i18n/es.json @@ -2,6 +2,7 @@ { "language": "Spanish", "i18n": "es", + "ns": "core", "entryText": "Español", "translation": { "core": { diff --git a/packages/reaction-i18n/private/data/i18n/fr.json b/packages/reaction-i18n/private/data/i18n/fr.json index a506514300b..202053db8c4 100644 --- a/packages/reaction-i18n/private/data/i18n/fr.json +++ b/packages/reaction-i18n/private/data/i18n/fr.json @@ -2,6 +2,7 @@ { "language": "French", "i18n": "fr", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/private/data/i18n/he.json b/packages/reaction-i18n/private/data/i18n/he.json index 7f3526ed263..67a90917e26 100644 --- a/packages/reaction-i18n/private/data/i18n/he.json +++ b/packages/reaction-i18n/private/data/i18n/he.json @@ -2,6 +2,7 @@ { "language": "Hebrew", "i18n": "he", + "ns": "core", "translation": { "core": { "languageDirection": "rtl", diff --git a/packages/reaction-i18n/private/data/i18n/hr.json b/packages/reaction-i18n/private/data/i18n/hr.json index 2d4c7a330a8..7eb72b6d832 100644 --- a/packages/reaction-i18n/private/data/i18n/hr.json +++ b/packages/reaction-i18n/private/data/i18n/hr.json @@ -2,6 +2,7 @@ { "language": "Croatian", "i18n": "hr", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/hu.json b/packages/reaction-i18n/private/data/i18n/hu.json index 5f474e16987..a06d656fbe1 100644 --- a/packages/reaction-i18n/private/data/i18n/hu.json +++ b/packages/reaction-i18n/private/data/i18n/hu.json @@ -2,6 +2,7 @@ { "language": "Hungarian", "i18n": "hu", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/it.json b/packages/reaction-i18n/private/data/i18n/it.json index 260f75e1344..156bd24c0b9 100644 --- a/packages/reaction-i18n/private/data/i18n/it.json +++ b/packages/reaction-i18n/private/data/i18n/it.json @@ -2,6 +2,7 @@ { "language": "Italian", "i18n": "it", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/my.json b/packages/reaction-i18n/private/data/i18n/my.json index 6f798df5c77..ba21c6e1388 100644 --- a/packages/reaction-i18n/private/data/i18n/my.json +++ b/packages/reaction-i18n/private/data/i18n/my.json @@ -2,6 +2,7 @@ { "language": "Burmese", "i18n": "my", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/nb.json b/packages/reaction-i18n/private/data/i18n/nb.json index 5893eadde23..f2495a96944 100644 --- a/packages/reaction-i18n/private/data/i18n/nb.json +++ b/packages/reaction-i18n/private/data/i18n/nb.json @@ -1,6 +1,7 @@ [{ "language": "Norwegian", "i18n": "nb", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/nl.json b/packages/reaction-i18n/private/data/i18n/nl.json index 53cdb7b6448..a144607d8a2 100644 --- a/packages/reaction-i18n/private/data/i18n/nl.json +++ b/packages/reaction-i18n/private/data/i18n/nl.json @@ -2,6 +2,7 @@ { "i18n": "nl", "language": "Nederlands", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/private/data/i18n/pl.json b/packages/reaction-i18n/private/data/i18n/pl.json index a8aa64b0bf8..e4ca90b35a0 100644 --- a/packages/reaction-i18n/private/data/i18n/pl.json +++ b/packages/reaction-i18n/private/data/i18n/pl.json @@ -2,6 +2,7 @@ { "language": "Polish", "i18n": "pl", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/private/data/i18n/pt.json b/packages/reaction-i18n/private/data/i18n/pt.json index 0b7e32db15c..acaa34b5530 100644 --- a/packages/reaction-i18n/private/data/i18n/pt.json +++ b/packages/reaction-i18n/private/data/i18n/pt.json @@ -2,6 +2,7 @@ { "language": "Portuguese", "i18n": "pt", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/private/data/i18n/ru.json b/packages/reaction-i18n/private/data/i18n/ru.json index b9f0f9a70b4..e7f633b99b7 100644 --- a/packages/reaction-i18n/private/data/i18n/ru.json +++ b/packages/reaction-i18n/private/data/i18n/ru.json @@ -1,6 +1,7 @@ [{ "language": "Russian", "i18n": "ru", + "ns": "core", "translation": { "core": { "languages": { @@ -169,8 +170,8 @@ "barcode": "Штрих-код", "confirmDeleteBarcode": "Вы уверены, что хотите удалить штрих-код", "details": "Подробности", - "detailsName": "Название характеристики", - "detailsInfo": "Значение характеристики", + "detailsName": "Свойство", + "detailsInfo": "Подробности", "generate": "Сформировать", "generateBarcodes": "Сформировать штрих-коды", "hideBarcodes": "Скрыть штрих-коды", diff --git a/packages/reaction-i18n/private/data/i18n/sl.json b/packages/reaction-i18n/private/data/i18n/sl.json index 0e98ae82654..5c8addb1c69 100644 --- a/packages/reaction-i18n/private/data/i18n/sl.json +++ b/packages/reaction-i18n/private/data/i18n/sl.json @@ -2,6 +2,7 @@ { "language": "Slovenian", "i18n": "sl", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/private/data/i18n/sv.json b/packages/reaction-i18n/private/data/i18n/sv.json index 95e2a358506..21de20895af 100644 --- a/packages/reaction-i18n/private/data/i18n/sv.json +++ b/packages/reaction-i18n/private/data/i18n/sv.json @@ -2,6 +2,7 @@ { "language": "Swedish", "i18n": "sv", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/private/data/i18n/tr.json b/packages/reaction-i18n/private/data/i18n/tr.json index 23e1509e6c6..6a9bb3b6f10 100644 --- a/packages/reaction-i18n/private/data/i18n/tr.json +++ b/packages/reaction-i18n/private/data/i18n/tr.json @@ -2,6 +2,7 @@ { "language": "Türkçe", "i18n": "tr", + "ns": "core", "translation": { "core": { "languages": { diff --git a/packages/reaction-i18n/private/data/i18n/vi.json b/packages/reaction-i18n/private/data/i18n/vi.json index a39f91d2664..2053e5b021f 100644 --- a/packages/reaction-i18n/private/data/i18n/vi.json +++ b/packages/reaction-i18n/private/data/i18n/vi.json @@ -2,6 +2,7 @@ { "language": "Vietnamese", "i18n": "vi", + "ns": "core", "translation": { "core": { "accountsUI": { diff --git a/packages/reaction-i18n/server/import.js b/packages/reaction-i18n/server/import.js index 80681c76102..53a319ffb7b 100644 --- a/packages/reaction-i18n/server/import.js +++ b/packages/reaction-i18n/server/import.js @@ -1,17 +1,33 @@ +const fs = Npm.require("fs"); + +// taken from here: http://stackoverflow.com/a/32749571 +const directoryExists = dirPath => { + try { + return fs.statSync(dirPath).isDirectory(); + } catch (err) { + return false; + } +}; + loadCoreTranslations = () => { - const fs = Npm.require("fs"); - const packageName = "reactioncommerce_reaction-i18n"; const readFolder = Meteor.wrapAsync(fs.readdir, fs); const meteorPath = fs.realpathSync(process.cwd() + "/../"); - const i18nFolder = `${meteorPath}/server/assets/packages/${packageName}/private/data/i18n/`; - readFolder(i18nFolder, function (err, files) { - if (err) throw new Meteor.Error("No translations found for import.", err); - for (const file of files) { - if (file.indexOf("json")) { - ReactionCore.Log.debug(`Importing Translations from ${file}`); - const json = Assets.getText("private/data/i18n/" + file); - ReactionImport.process(json, ["i18n"], ReactionImport.translation); - } + // get the list of package folder names which have assets. + const packagesList = fs.readdirSync(`${meteorPath}/server/assets/packages/`); + packagesList.forEach(pkg => { + const i18nFolder = `${meteorPath}/server/assets/packages/${pkg}/private/data/i18n/`; + // we are avoiding packages w/o correct path + if (directoryExists(i18nFolder)) { + readFolder(i18nFolder, function (err, files) { + if (err) throw new Meteor.Error("No translations found for import.", err); + for (let file of files) { + if (file.indexOf("json")) { + ReactionCore.Log.debug(`Importing Translations from ${file}`); + let json = fs.readFileSync(i18nFolder + file, "utf8"); + ReactionImport.process(json, ["i18n"], ReactionImport.translation); + } + } + }); } }); }; diff --git a/packages/reaction-schemas/common/schemas/translations.js b/packages/reaction-schemas/common/schemas/translations.js index b4f93b0dbe2..8f95dc4d08b 100644 --- a/packages/reaction-schemas/common/schemas/translations.js +++ b/packages/reaction-schemas/common/schemas/translations.js @@ -20,6 +20,10 @@ ReactionCore.Schemas.Translation = new SimpleSchema({ type: String, index: 1 }, + ns: { + type: String, + label: "Namespace" + }, translation: { type: Object, blackbox: true diff --git a/packages/reaction-schemas/package.js b/packages/reaction-schemas/package.js index 2b9f325aa55..9654a479c7c 100644 --- a/packages/reaction-schemas/package.js +++ b/packages/reaction-schemas/package.js @@ -1,7 +1,7 @@ Package.describe({ summary: "Reaction Schemas - core reaction commerce collection schemas", name: "reactioncommerce:reaction-schemas", - version: "2.0.4", + version: "2.0.5", documentation: "README.md" });