poeditor-pull 1.0.6 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 541147dfd209df96724b219ddaad87e709f72761c4f22810e3fb3e6d8d2dc3c2
4
- data.tar.gz: 8d6373131f7af400e7775f6cbdd03bdb6eccc70a2cce64d416326bda51426573
2
+ SHA1:
3
+ metadata.gz: f119b411e825228e445bf82f10dc89618d852dd7
4
+ data.tar.gz: db30beee41758a4b77d1c7d370e5bf90191b33d8
5
5
  SHA512:
6
- metadata.gz: 34df5117bc1be2f7bbee7fc8341c4c3be5733c08211113455c35a16bdab9cd2dcb358354f7bf21f17bab6d1049bcb3d5da689e5352ffcc7da9af88c8a2e42bbb
7
- data.tar.gz: db0ff9efba09e3f5273b319b1f9ea7118746e2264dd6d79baaa16a7609bc5f647a6d100e60bf8ca4ceadb4c45b9ec35db68bd5067e06a66e17cf545d18da214f
6
+ metadata.gz: 148be41e4e961aee83ecfb98d165f0788105673a8301227631553df252ed5c77bc149be46f045d6ea48243b258ff4f95f9e8042c037dbea4c13c0645468b7728
7
+ data.tar.gz: '0157686d65a35a74e76872fdda899b4576f003b80bc7537ce0ff0c1e2133a199329ce0ebb0c97bc1339470e3d26f589ceaa2b6f421a3b4979d58c88cde1a50da'
data/CHANGELOG CHANGED
@@ -9,4 +9,5 @@ List of changes introduced to source codebase:
9
9
  5. Added: formatting paths with target/flavor name based on {TARGET_NAME} as parameter.
10
10
  6. Implemented language-region combination support [Android] and Chinese language coding support
11
11
  7. Implemented additional `path_copy` (next to default `path_replace`) strategy to support having both Base and source-base language `.strings` files project simultaneously [since 1.0.4, iOS specific].
12
- 8. Change '...' into elipsis symbol '…' to conform with Android Lint.
12
+ 8. Change '...' into elipsis symbol '…' to conform with Android Lint.
13
+ 9. Added: support for BCP-47 tags on Android translations as described here: https://developer.android.com/guide/topics/resources/providing-resources.html#LocaleQualifier.
File without changes
@@ -47,7 +47,11 @@ module POEditor
47
47
  @path_replace = path_replace || {}
48
48
  @path_copy = path_copy || {}
49
49
  if @path_replace.any? and @path_copy.any?
50
- raise POEditor::Exception.new "'path_replace' and 'path_copy' are different strategies of one functionality and thus cannot be in use simultaneously."
50
+ @path_replace.each { |language_key, v|
51
+ if @path_copy.key?(language_key)
52
+ raise POEditor::Exception.new "'path_replace' and 'path_copy' are different strategies of one functionality and thus cannot be in use simultaneously for same language."
53
+ end
54
+ }
51
55
  end
52
56
  end
53
57
 
@@ -127,10 +127,12 @@ module POEditor
127
127
 
128
128
  def paths_for_language(language)
129
129
  if @configuration.path_copy[language]
130
+ language = convert_to_android_bcp_47(@configuration.path_copy[language], language)
130
131
  [@configuration.path_copy[language], @configuration.path.gsub("{LANGUAGE}", language)]
131
132
  elsif @configuration.path_replace[language]
132
133
  [@configuration.path_replace[language]]
133
134
  else
135
+ language = convert_to_android_bcp_47(@configuration.path, language)
134
136
  [@configuration.path.gsub("{LANGUAGE}", language)]
135
137
  end
136
138
  end
@@ -146,5 +148,14 @@ module POEditor
146
148
  File.write(path, content)
147
149
  UI.puts " #{"\xe2\x9c\x93".green} Saved at '#{path}'"
148
150
  end
151
+
152
+ def convert_to_android_bcp_47(translation_path, language)
153
+ # added to follow b+ convention of BCP-47 on Android
154
+ if translation_path.include? "b+"
155
+ return language.gsub("-", "+")
156
+ end
157
+ return language
158
+ end
159
+
149
160
  end
150
161
  end
@@ -1,3 +1,3 @@
1
1
  module POEditor
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poeditor-pull
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suyeol Jeon
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-09-23 00:00:00.000000000 Z
13
+ date: 2019-11-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: colorize
@@ -62,7 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.0.3
65
+ rubyforge_project:
66
+ rubygems_version: 2.5.2.3
66
67
  signing_key:
67
68
  specification_version: 4
68
69
  summary: POEditor Pull CLI