Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
brent-hoover committed Mar 22, 2016
2 parents 5b23c1d + 2ce52ca commit 73eccf8
Show file tree
Hide file tree
Showing 33 changed files with 77 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
reactioncommerce:[email protected].0
reactioncommerce:[email protected].1
reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected]
Expand All @@ -155,7 +155,7 @@ reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected].0
reactioncommerce:[email protected].1
reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected]
Expand All @@ -165,7 +165,7 @@ reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected].4
reactioncommerce:[email protected].5
reactioncommerce:[email protected]
reactioncommerce:[email protected]
reactioncommerce:[email protected]
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/reaction-core/package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package.describe({
summary: "Reaction Commerce Core",
name: "reactioncommerce:core",
version: "0.12.0",
version: "0.12.1",
documentation: "README.md"
});

Expand Down
3 changes: 2 additions & 1 deletion packages/reaction-core/server/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

//
Expand Down
8 changes: 7 additions & 1 deletion packages/reaction-i18n/client/helpers/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}, {});

Expand Down
2 changes: 1 addition & 1 deletion packages/reaction-i18n/package.js
Original file line number Diff line number Diff line change
@@ -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"
});

Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Arabic",
"i18n": "ar",
"ns": "core",
"translation": {
"core": {
"languageDirection": "rtl",
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/bg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[{
"language": "Български",
"i18n": "bg",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/cn.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[{
"language": "中文(简体)",
"i18n": "cn",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Czech",
"i18n": "cs",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "German",
"i18n": "de",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Ελληνικά",
"i18n": "el",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[{
"language": "English",
"i18n": "en",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Spanish",
"i18n": "es",
"ns": "core",
"entryText": "Español",
"translation": {
"core": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "French",
"i18n": "fr",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Hebrew",
"i18n": "he",
"ns": "core",
"translation": {
"core": {
"languageDirection": "rtl",
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Croatian",
"i18n": "hr",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Hungarian",
"i18n": "hu",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Italian",
"i18n": "it",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/my.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Burmese",
"i18n": "my",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/nb.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[{
"language": "Norwegian",
"i18n": "nb",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"i18n": "nl",
"language": "Nederlands",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Polish",
"i18n": "pl",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Portuguese",
"i18n": "pt",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
5 changes: 3 additions & 2 deletions packages/reaction-i18n/private/data/i18n/ru.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[{
"language": "Russian",
"i18n": "ru",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down Expand Up @@ -169,8 +170,8 @@
"barcode": "Штрих-код",
"confirmDeleteBarcode": "Вы уверены, что хотите удалить штрих-код",
"details": "Подробности",
"detailsName": "Название характеристики",
"detailsInfo": "Значение характеристики",
"detailsName": "Свойство",
"detailsInfo": "Подробности",
"generate": "Сформировать",
"generateBarcodes": "Сформировать штрих-коды",
"hideBarcodes": "Скрыть штрих-коды",
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Slovenian",
"i18n": "sl",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Swedish",
"i18n": "sv",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Türkçe",
"i18n": "tr",
"ns": "core",
"translation": {
"core": {
"languages": {
Expand Down
1 change: 1 addition & 0 deletions packages/reaction-i18n/private/data/i18n/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"language": "Vietnamese",
"i18n": "vi",
"ns": "core",
"translation": {
"core": {
"accountsUI": {
Expand Down
38 changes: 27 additions & 11 deletions packages/reaction-i18n/server/import.js
Original file line number Diff line number Diff line change
@@ -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);
}
}
});
}
});
};
Expand Down
4 changes: 4 additions & 0 deletions packages/reaction-schemas/common/schemas/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ ReactionCore.Schemas.Translation = new SimpleSchema({
type: String,
index: 1
},
ns: {
type: String,
label: "Namespace"
},
translation: {
type: Object,
blackbox: true
Expand Down
2 changes: 1 addition & 1 deletion packages/reaction-schemas/package.js
Original file line number Diff line number Diff line change
@@ -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"
});

Expand Down

0 comments on commit 73eccf8

Please sign in to comment.