transync 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -8
- data/lib/transync/runner.rb +2 -2
- data/lib/transync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53afd1b65e808cfce2e81eec433f2503ecc48e50
|
4
|
+
data.tar.gz: f82b54ece69a6a9517e1926cca8b960325e99f31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adde07a797914699e9de74366856e41daff5cd4569c533aa6af8c1ecb95067e62f2e63f5f53b3bb405c85ba3f1117cf5bf30998672ec6014bcfb67781d3e186c
|
7
|
+
data.tar.gz: d124defa8261d27de9f511354fbe9f364233900acd74b5b18022a9eebdfb932deded157856f95bac16a553042c2d76e1d40a7e76e433d82e85109349c6dd7173
|
data/README.md
CHANGED
@@ -9,19 +9,20 @@ For example see `transync.SAMPLE.yml`.
|
|
9
9
|
|
10
10
|
## Assumptions
|
11
11
|
|
12
|
-
You have xliff files in one directory, named like: common.en.xliff where common
|
13
|
-
spreadsheet tab
|
12
|
+
You have xliff files in one directory (I suggest `app/Resources/translations`), named like: `common.en.xliff` where `common`
|
13
|
+
is name of the file and also GDoc `spreadsheet tab`. `en` is language and you have GDoc with structure where
|
14
|
+
first row is `key`, `language 1`, `language 2`, ...
|
14
15
|
|
15
16
|
## How does it work?
|
16
17
|
|
17
18
|
Updating GDoc from our xliff files. It won't delete any key, it will only add new or change existing ones. Same
|
18
|
-
for direction from
|
19
|
+
for direction from GDoc to xliff.
|
19
20
|
|
20
21
|
### Process
|
21
22
|
|
22
23
|
- Create new Google Doc Spreadsheet
|
23
24
|
- Copy it's `key` from URL to `transync.yml`
|
24
|
-
- Set all the languages and `xliff` you want to sync in `transync.yml` (look at `transync.SAMPLE.yml`)
|
25
|
+
- Set all the languages and `xliff` files (without language) you want to sync in `transync.yml` (look at `transync.SAMPLE.yml`)
|
25
26
|
- set `XLIFF_FILES_PATH` to set path where are your `xliff` files. In project do it with relative path so others can use it
|
26
27
|
- set `MISSING_TRANSLATION_TEXT` to set what text should go to `target` element for translation
|
27
28
|
- run these commands respectively
|
@@ -30,24 +31,26 @@ for direction from Gdoc to xliff.
|
|
30
31
|
|
31
32
|
```
|
32
33
|
transync test # test if all keys are set for all the languages. Also tests if everything in sync with GDoc
|
33
|
-
transync update # will test and add all the missing keys that are not presented for a particular language
|
34
|
-
transync init # will
|
34
|
+
transync update # will test and add all the missing keys that are not presented for a particular language in XLIFF files
|
35
|
+
transync init # will write all translations from XLIFF to GDoc spreadsheet. You need to run update command first, to ensure no keys are missing
|
35
36
|
|
36
|
-
# After init was made you have these two to sync between
|
37
|
+
# After init was made you have these two to sync modes between Gdoc and XLIFF
|
37
38
|
transync x2g
|
38
39
|
transync g2x
|
39
40
|
```
|
40
41
|
|
41
42
|
### Gem development
|
42
43
|
|
44
|
+
#### Running tests
|
43
45
|
```
|
44
46
|
ruby g2x_spec.rb
|
45
47
|
ruby x2g_spec.rb
|
48
|
+
ruby update_spec.rb
|
46
49
|
```
|
47
50
|
|
48
51
|
## TODO
|
49
52
|
|
50
53
|
- use ruby's 2.0 named parameters (more clear method calls)
|
51
|
-
- better tests (move out network dependency -> maybe try VCR)
|
54
|
+
- better tests (move out network dependency -> maybe try VCR, run all tests with RAKE)
|
52
55
|
- add to travis / code climate
|
53
56
|
- don't allow empty keys?
|
data/lib/transync/runner.rb
CHANGED
@@ -27,9 +27,9 @@ module Transync
|
|
27
27
|
trans_sync = TranslationSync.new(PATH, 'test', file)
|
28
28
|
|
29
29
|
if trans_sync.diff(language).keys.length == 0
|
30
|
-
puts "\u{2713} '#{file}' is in sync
|
30
|
+
puts "\u{2713} '#{file}.#{language}' XLIFF is in sync with GDoc.".colorize(:green)
|
31
31
|
else
|
32
|
-
puts "\u{2717} '#{file}' is NOT in sync
|
32
|
+
puts "\u{2717} '#{file}.#{language}' XLIFF is NOT in sync with GDoc. See diff!".colorize(:red)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
data/lib/transync/version.rb
CHANGED