translations_sync 0.4.3 → 0.4.5
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 +7 -0
- data/README +2 -2
- data/Rakefile +1 -1
- data/lib/translations_sync.rb +5 -3
- metadata +34 -53
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 568de929f677b238fe1cbe0064c74295bfcf55bf
|
|
4
|
+
data.tar.gz: 905cdc5a32efc20b15af73b58e292e2c9eecfb6b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 26efd03cae3981f5a104140e3b05d77295f4cdd6dbb77a2f8d37ae5170f19a889181b9503c55477e404e87c9f59af89f348126badd09b8c1def44db5d4ecd279
|
|
7
|
+
data.tar.gz: ecc6465b8d06fec02f5d45f8e5bb5aaeadc3539b0c500699e1f2daf9c7a9ed5de24cb9993b409975450e864991bcca65a20d77cee21d7cdfa26c2d215015bcfd
|
data/README
CHANGED
|
@@ -40,8 +40,8 @@ There are two rake tasks implemented in the plugin.
|
|
|
40
40
|
This task generates the files with missing translations in the directory
|
|
41
41
|
config/locales. One file per a locale is created with the name missing_#{locale}.yml
|
|
42
42
|
Each file contains the text of one of the existing locales, namely the first one
|
|
43
|
-
existing. The order to check is defined by the LIST parameter.
|
|
44
|
-
can also be used to add a new locale.
|
|
43
|
+
existing. The order to check is defined by the LIST parameter.
|
|
44
|
+
This parameter can also be used to add a new locale. If it is not given I18n.available_locales will be used.
|
|
45
45
|
The parameter EXCLUDE may be used to extract one or more locales from the participation
|
|
46
46
|
in the process. If any locale is mentioned in both lists, it will not participate in the
|
|
47
47
|
calculation of the missing translations but it's value may be used in the sample
|
data/Rakefile
CHANGED
data/lib/translations_sync.rb
CHANGED
|
@@ -22,7 +22,6 @@ end
|
|
|
22
22
|
class TranslationsSync
|
|
23
23
|
|
|
24
24
|
attr_accessor :translations, :list
|
|
25
|
-
DEFAULT_LIST = 'ru,en'
|
|
26
25
|
EXCLUDE_LIST = ''
|
|
27
26
|
TAIL = '=TODO'
|
|
28
27
|
PKORDER = {'zero' => 0, 'one' => 1, 'two' => 2, 'few' => 3, 'many' => 5, 'other' => 9}
|
|
@@ -57,7 +56,8 @@ class TranslationsSync
|
|
|
57
56
|
def initialize(list = nil, exclude = nil, source = nil)
|
|
58
57
|
I18n.backend.send(:init_translations) unless I18n.backend.initialized?
|
|
59
58
|
translations = I18n.backend.send :translations
|
|
60
|
-
@full_list =
|
|
59
|
+
@full_list = list ? list.split(',').map(&:to_sym) : I18n.available_locales
|
|
60
|
+
@full_list = @full_list.uniq
|
|
61
61
|
exclude = (exclude || EXCLUDE_LIST).split(',').map(&:to_sym)
|
|
62
62
|
@list = @full_list - exclude
|
|
63
63
|
rules_key = %w[i18n.plural.rule pluralize].detect do |rule|
|
|
@@ -225,6 +225,8 @@ class TranslationsSync
|
|
|
225
225
|
if value.is_a? Hash
|
|
226
226
|
if (value.keys & [:one, :other]).size > 0
|
|
227
227
|
insert_translation(dest, new, lang, value)
|
|
228
|
+
# we do not process gem faker
|
|
229
|
+
elsif prefix == [] and key.to_sym == :faker
|
|
228
230
|
else
|
|
229
231
|
flatten_keys lang, value, dest, new
|
|
230
232
|
end
|
|
@@ -266,7 +268,7 @@ class TranslationsSync
|
|
|
266
268
|
begin
|
|
267
269
|
h[key.to_s] = val[lang].to_s + TAIL
|
|
268
270
|
rescue
|
|
269
|
-
puts %Q(Can not assign to the key "#{
|
|
271
|
+
puts %Q(Can not assign to the key "#{keys.inspect}" value "#{val[lang]} for language #{target}")
|
|
270
272
|
raise
|
|
271
273
|
end
|
|
272
274
|
end
|
metadata
CHANGED
|
@@ -1,87 +1,68 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: translations_sync
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
prerelease:
|
|
6
|
-
segments:
|
|
7
|
-
- 0
|
|
8
|
-
- 4
|
|
9
|
-
- 3
|
|
10
|
-
version: 0.4.3
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.4.5
|
|
11
5
|
platform: ruby
|
|
12
|
-
authors:
|
|
6
|
+
authors:
|
|
13
7
|
- Dmitri Koulikoff
|
|
14
8
|
autorequire:
|
|
15
9
|
bindir: bin
|
|
16
10
|
cert_chain: []
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- !ruby/object:Gem::Dependency
|
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
21
14
|
name: ya2yaml
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
none: false
|
|
25
|
-
requirements:
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
26
17
|
- - ">="
|
|
27
|
-
- !ruby/object:Gem::Version
|
|
28
|
-
|
|
29
|
-
segments:
|
|
30
|
-
- 0
|
|
31
|
-
version: "0"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
32
20
|
type: :runtime
|
|
33
|
-
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
34
27
|
description: Synchronizes the different locales represeinted in yaml for I18n
|
|
35
28
|
email: koulikoff@gmail.com
|
|
36
|
-
executables:
|
|
29
|
+
executables:
|
|
37
30
|
- translations_sync
|
|
38
31
|
extensions: []
|
|
39
|
-
|
|
40
|
-
extra_rdoc_files:
|
|
32
|
+
extra_rdoc_files:
|
|
41
33
|
- README
|
|
42
34
|
- MIT-LICENSE
|
|
43
|
-
files:
|
|
35
|
+
files:
|
|
36
|
+
- Changelog
|
|
44
37
|
- MIT-LICENSE
|
|
45
38
|
- README
|
|
46
39
|
- Rakefile
|
|
47
|
-
- Changelog
|
|
48
|
-
- init.rb
|
|
49
40
|
- bin/translations_sync
|
|
41
|
+
- init.rb
|
|
50
42
|
- lib/tasks/translations_sync.rake
|
|
51
43
|
- lib/translations_sync.rb
|
|
52
44
|
- spec/spec_helper.rb
|
|
53
45
|
homepage: http://github.com/dima4p/translations_sync/
|
|
54
46
|
licenses: []
|
|
55
|
-
|
|
47
|
+
metadata: {}
|
|
56
48
|
post_install_message:
|
|
57
49
|
rdoc_options: []
|
|
58
|
-
|
|
59
|
-
require_paths:
|
|
50
|
+
require_paths:
|
|
60
51
|
- lib
|
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
|
-
|
|
63
|
-
requirements:
|
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
64
54
|
- - ">="
|
|
65
|
-
- !ruby/object:Gem::Version
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
version: "0"
|
|
70
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
|
-
none: false
|
|
72
|
-
requirements:
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '0'
|
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
73
59
|
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
|
|
76
|
-
segments:
|
|
77
|
-
- 0
|
|
78
|
-
version: "0"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
79
62
|
requirements: []
|
|
80
|
-
|
|
81
63
|
rubyforge_project:
|
|
82
|
-
rubygems_version:
|
|
64
|
+
rubygems_version: 2.2.2
|
|
83
65
|
signing_key:
|
|
84
|
-
specification_version:
|
|
66
|
+
specification_version: 4
|
|
85
67
|
summary: Synchronizes the different locales represeinted in yaml for I18n
|
|
86
68
|
test_files: []
|
|
87
|
-
|