i18n-cli 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/i18n-cli/i18n-cli.rb +12 -6
- data/lib/i18n-cli/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 492de4c62d7f8086ea5c757c5e6bca0573d87d76c8f5c192c65571e7476a9e87
|
4
|
+
data.tar.gz: 8c76f2b04d4008390e61ed1822dec6b99b7af6786e5e1e49c364ae0783835c98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29b266f09542aff6a34fa6d45eb9d1bbf8d53d6d397e3277a5027dc9c652838173db0f932806b35151f868f2f1e43dc89b1aedba140275306cdfc4c90a002e2e
|
7
|
+
data.tar.gz: 537d650df6a5c8e4d13a36a46e06138ab6a2d7d1b6c8b3075437047165eb0ab695532081a8a134f86627c23012ba9bdaf1d84d72ae65f8511acf6060bbaad9a4
|
data/lib/i18n-cli/i18n-cli.rb
CHANGED
@@ -60,26 +60,32 @@ module I18n
|
|
60
60
|
|
61
61
|
def commit
|
62
62
|
localization_hash = JSON.parse(File.open(LOCALIZATION_FILE, &:read))
|
63
|
+
localization_lock_hash = JSON.parse(File.open(LOCALIZATION_LOCK_FILE, &:read))
|
64
|
+
|
65
|
+
if localization_hash['version'] < localization_lock_hash['metadata']['version']
|
66
|
+
apply
|
67
|
+
return
|
68
|
+
end
|
69
|
+
|
63
70
|
keys_hash = localization_hash['strings']
|
64
|
-
localization_keys = keys_hash.keys
|
71
|
+
localization_keys = keys_hash.keys.sort
|
65
72
|
languages = keys_hash[localization_keys[0]].keys
|
66
73
|
|
67
74
|
data = Hash[languages.map{ |l| [l, Hash[localization_keys.map{ |k| [k, keys_hash[k][l]] }]] }]
|
68
75
|
|
69
|
-
|
70
|
-
version = old_localization_lock_hash['metadata']['version']
|
76
|
+
version = localization_hash['version']
|
71
77
|
version_split = version.split('.')
|
72
78
|
|
73
|
-
|
79
|
+
new_localization_lock_hash = {
|
74
80
|
data: data,
|
75
81
|
metadata: {
|
76
82
|
cliVersion: VERSION,
|
77
|
-
projectName:
|
83
|
+
projectName: localization_lock_hash['metadata']['projectName'],
|
78
84
|
version: "#{version_split[0]}.#{version_split[1].to_i + 1}"
|
79
85
|
}
|
80
86
|
}
|
81
87
|
|
82
|
-
file_content = JSON.pretty_generate(
|
88
|
+
file_content = JSON.pretty_generate(new_localization_lock_hash)
|
83
89
|
File.write(LOCALIZATION_LOCK_FILE, file_content)
|
84
90
|
end
|
85
91
|
|
data/lib/i18n-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Prestes Cavalcanti
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,7 +81,7 @@ homepage: https://gitlab.com/LucianoPC/i18n-cli
|
|
81
81
|
licenses:
|
82
82
|
- Expat
|
83
83
|
metadata: {}
|
84
|
-
post_install_message:
|
84
|
+
post_install_message:
|
85
85
|
rdoc_options: []
|
86
86
|
require_paths:
|
87
87
|
- lib
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubygems_version: 3.4.10
|
100
|
-
signing_key:
|
100
|
+
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: A program that manage localization keys
|
103
103
|
test_files: []
|