transync 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14ddaefea87d79fa54969295284ba7f048567d7b
4
- data.tar.gz: 5f4e9e49694aafeab4a66ae6b850ff23c62c9d14
3
+ metadata.gz: 826e00df7c16d49a77a3ba40b53df4dae4932b53
4
+ data.tar.gz: 3e7e2a8e1d46072b263450ececeadcd29ca29f05
5
5
  SHA512:
6
- metadata.gz: cc8ee6a94f7ba1628db70c53760deaaa7b947c3dbdff2cdff73abdf07db01de8b8a035eba617a8fca8d1877239650305bfcd36d89e5e74d8f77fb7cc57f63b93
7
- data.tar.gz: ed6b943d8c8564142d3654234110ee3431585f1c21272d5206736d2a31c455796081344bd15cf6d9cda6a34c5dab49edfcff23ad2641f1e7f062638fac309aaa
6
+ metadata.gz: 45d1d05c2d8e1384138a8fb883514dbdcc96bcd9c8fd507e05381b5b15c28f5141ca615fad9f62b49d3dff713dcbd8d3c2e27458f80241678df857dad364b457
7
+ data.tar.gz: dab75e76add54fb2b670446a6f0a1db2895215eeab08db0e36801d1ff9a2b0fb05b7ca78950d3b46f035e063849246c87bdc5c80b809232dd2b127e389552346
data/README.md CHANGED
@@ -11,8 +11,9 @@ For example see `settings.SAMPLE.yml`.
11
11
 
12
12
  - Create new Google Doc Spreadsheet
13
13
  - Copy it's `key` from URL to `settings.yml`
14
- - Set all the languages and `xliff` you want to sync in `settings.yml` (look at `settings.SAMPLE.yml`).
15
- - set `XLIFF_FILES_PATH` to set path where are your `xliff` files. In project do it with relative path so others can use it.
14
+ - Set all the languages and `xliff` you want to sync in `settings.yml` (look at `settings.SAMPLE.yml`)
15
+ - set `XLIFF_FILES_PATH` to set path where are your `xliff` files. In project do it with relative path so others can use it
16
+ - set `MISSING_TRANSLATION_TEXT` to set what text should go to `target` element for translation
16
17
  - run these commands respectively
17
18
 
18
19
  ### Running order
@@ -1,3 +1,3 @@
1
1
  module Transync
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -33,7 +33,7 @@ class XliffTransReader
33
33
  # will go through each and find if any xliff is missing keys for translations
34
34
  def valid?(create = false)
35
35
  missing = 0
36
-
36
+ missing_translation_text = GdocTrans::CONFIG['MISSING_TRANSLATION_TEXT'] || '#MISSING-TRANS#'
37
37
  all_translations_for_language = {language: nil, translations: []}
38
38
 
39
39
  self.get_translations[:translations].each do |x_trans|
@@ -51,7 +51,10 @@ class XliffTransReader
51
51
  return false unless create
52
52
 
53
53
  p "#{missing + 1}. #{file}.#{key_lang} was missing translation for key '#{x_trans[:key]}'."
54
- all_translations_for_language[:translations] << { key: x_trans[:key], value: 'Missing translation' }
54
+ all_translations_for_language[:translations] << {
55
+ key: x_trans[:key],
56
+ value: "#{missing_translation_text} - #{x_trans[:key]}"
57
+ }
55
58
  missing += 1
56
59
  else
57
60
  all_translations_for_language[:translations] << xliff_lang_value
@@ -5,6 +5,7 @@ GDOC:
5
5
  email: "user@example.com"
6
6
  password: "secret"
7
7
 
8
+ MISSING_TRANSLATION_TEXT: "#MISSING-TRANS#"
8
9
  XLIFF_FILES_PATH: test/fixtures
9
10
 
10
11
  FILES: # xliff files <=> gdoc tabs
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - zigomir
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-03 00:00:00.000000000 Z
11
+ date: 2013-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google_drive