Skip to content

Commit 68af7b0

Browse files
authored
Merge pull request #2 from translation/develop
v1.1.0
2 parents 560b303 + 1545c68 commit 68af7b0

File tree

7 files changed

+12
-64
lines changed

7 files changed

+12
-64
lines changed

bin/commands/init.js

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ function _default(config) {
6161
}
6262
});
6363
});
64-
65-
if (options.debug) {
66-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), "translation-debug-segments.json"), JSON.stringify(segments, null, 4), {
67-
encoding: 'utf8'
68-
});
69-
}
70-
7164
Object.keys(segments).forEach(function (locale) {
7265
var languageTranslations = segmentsFromLanguageFiles[locale];
7366

@@ -97,31 +90,9 @@ function _default(config) {
9790
});
9891
}
9992
});
100-
101-
if (options.debug) {
102-
// Write debug files
103-
Object.keys(segments).forEach(function (locale) {
104-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), "translation-debug-translations-".concat(locale, ".json")), JSON.stringify(segmentsFromLanguageFiles[locale], null, 4), {
105-
encoding: 'utf8'
106-
});
107-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), "translation-debug-segments-".concat(locale, ".json")), JSON.stringify(segments[locale], null, 4), {
108-
encoding: 'utf8'
109-
});
110-
segments[locale].forEach(function (segment) {// console.log(locale, segment)
111-
});
112-
});
113-
}
114-
11593
var translation = new _Translation["default"](config);
11694
translation.init(segments).then(function (data) {
11795
log.success("Project `".concat(data.project.name, "` initialized with success."));
118-
119-
if (options.debug) {
120-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), "translation-debug-init-success.json"), JSON.stringify(data, null, 4), {
121-
encoding: 'utf8'
122-
});
123-
}
124-
12596
Object.keys(data.segments).forEach(function (locale) {
12697
var translations = {};
12798
data.segments[locale].forEach(function (segment) {
@@ -135,11 +106,6 @@ function _default(config) {
135106
encoding: 'utf8'
136107
});
137108
});
138-
}, function (error) {
139-
if (options.debug) {
140-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), "translation-debug-init-error.json"), JSON.stringify(error, null, 4), {
141-
encoding: 'utf8'
142-
});
143-
}
109+
}, function (error) {//
144110
});
145111
}

bin/commands/sync.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,6 @@ function _default(config) {
8787
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), config.translations_directory, "".concat(config.source_locale, ".json")), JSON.stringify(updatedSourceTranslations, null, 4), {
8888
encoding: 'utf8'
8989
});
90-
91-
if (config.debug) {
92-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), 'translation-debug-sync-source-translations.json'), JSON.stringify(sourceTranslations, null, 4), {
93-
encoding: 'utf8'
94-
});
95-
}
96-
}
97-
98-
if (config.debug) {
99-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), 'translation-debug-sync-segments.json'), JSON.stringify(sourceSegments, null, 4), {
100-
encoding: 'utf8'
101-
});
10290
}
10391

10492
var api = new _Translation["default"](config);
@@ -133,12 +121,6 @@ function _default(config) {
133121
}
134122

135123
api.sync(sourceSegments, config.readonly, config.purge).then(function (data) {
136-
if (config.debug) {
137-
(0, _fs.writeFileSync)((0, _path.join)(process.cwd(), 'translation-debug-sync-response.json'), JSON.stringify(data, null, 4), {
138-
encoding: 'utf8'
139-
});
140-
}
141-
142124
Object.keys(data.segments).forEach(function (locale) {
143125
var translations = {};
144126
data.segments[locale].forEach(function (segment) {

bin/index.js

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
2323

2424
_commander["default"].version(_package["default"].version, '-v, --version').option('-c, --config <path>', 'Set the config path. Defaults to ./translation.json', './translation.json');
2525

26-
_commander["default"].command('init').description('Init the translation.io project by pushing all source and translated text into the backend. This should only be executed one time per project.').option('-d, --debug', 'Enable debug mode').action(function (options) {
26+
_commander["default"].command('init').description('Init the translation.io project by pushing all source and translated text into the backend. This should only be executed one time per project.').action(function (options) {
2727
var config = (0, _resolveConfig["default"])(options, _commander["default"].config);
2828

2929
if (config === null) {
@@ -34,7 +34,7 @@ _commander["default"].command('init').description('Init the translation.io proje
3434
(0, _init["default"])(config);
3535
});
3636

37-
_commander["default"].command('sync').description('Sync translations').option('-p, --purge', 'Purge when syncing keys', false).option('-r, --readonly', 'Only pull translations (do not push local translations)', false).option('-d, --debug', 'Enable debug mode').action(function (options) {
37+
_commander["default"].command('sync').description('Sync translations').option('-p, --purge', 'Purge when syncing keys', false).option('-r, --readonly', 'Only pull translations (do not push local translations)', false).action(function (options) {
3838
var config = (0, _resolveConfig["default"])(options, _commander["default"].config);
3939

4040
if (config === null) {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@translation/vue",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"license": "MIT",
55
"author": "Simon Depelchin",
66
"publishConfig": {

tio.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"key": null,
3+
"source_locale": "en",
4+
"target_locales": [],
5+
"source_path": "src/**/*.?(js|vue)",
6+
"translations_directory": "src/lang"
7+
}

0 commit comments

Comments
 (0)