lokalise_manager 3.1.0 → 3.2.0

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
  SHA256:
3
- metadata.gz: 71731c95118ae4f31be9e82b256aa2cc17094a0ab64b5a186b95cb37843fec52
4
- data.tar.gz: d8cbbfd4d60926f2f62323e0908addacf218425fc7e2b579d2f748d0e9acdf93
3
+ metadata.gz: 62f150fda293c97544a2595165d42dd74c59b8e21bed613943d422321ade498f
4
+ data.tar.gz: a4b01a90a1fe15f7ee7dd8d657ffd2433a5fdbcfb5785b2090b608530cec23f5
5
5
  SHA512:
6
- metadata.gz: d457a5a7e4f703b80c3780e1a35e75278671c78f9caa0464bb0488352fa2772500e9f4f921446f8a3b51e9240fd229b1935705ba5b86263cb9e20bd27eab274d
7
- data.tar.gz: 7053cf881bee4814dd67f17238557f7e19a0f6dc96109cf88700845018110c083612477eb15b49643d2459332d7e6abbd705cfe9322d36aa4735d7e73bcf887c
6
+ metadata.gz: 9c65ddeb0a5c671cc6bfdca8e01dbadb8f3ef7dd43d5c870694a243f8dd8e58893571185a01bb07c6c363b1b301b127f2cf7375f67b7c35675c24e6b7a60406d
7
+ data.tar.gz: 4a43096baca8264d52c7a11ce91a08b73aaa87a3b1b16056f539746753926c6a23ad77f29e5d942d427633b0623031e488c8c66c6e5f466f0085fc721b57b9dc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.2.0 (26-Aug-22)
4
+
5
+ * Fixed an issue when `\n` inside translations was imported as `\\n`. The default value for the `translations_converter` is now `->(raw_data) { YAML.dump(raw_data).gsub(/\\\\n/, '\n') }`.
6
+
3
7
  ## 3.1.0 (17-Aug-22)
4
8
 
5
9
  * The default format is now `ruby_yaml` (it used to be `yaml`)
data/README.md CHANGED
@@ -201,7 +201,7 @@ If your translation files are not in YAML format, you will need to adjust the fo
201
201
 
202
202
  * `file_ext_regexp` (`regexp`) — regular expression applied to file extensions to determine which files should be imported and exported. Defaults to `/\.ya?ml\z/i` (YAML files).
203
203
  * `translations_loader` (`lambda` or `proc`) — loads translations data and makes sure they are valid before saving them to a translation file. Defaults to `->(raw_data) { YAML.safe_load raw_data }`. In the simplest case you may just return the data back, for example `-> (raw_data) { raw_data }`.
204
- * `translations_converter` (`lambda` or `proc`) — converts translations data to a proper format before saving them to a translation file. Defaults to `->(raw_data) { raw_data.to_yaml }`. In the simplest case you may just return the data back, for example `-> (raw_data) { raw_data }`.
204
+ * `translations_converter` (`lambda` or `proc`) — converts translations data to a proper format before saving them to a translation file. Defaults to `->(raw_data) { YAML.dump(raw_data).gsub(/\\\\n/, '\n') }`. In the simplest case you may just return the data back, for example `-> (raw_data) { raw_data }`.
205
205
  * `lang_iso_inferer` (`lambda` or `proc`) — infers language ISO code based on the translation file data before uploading it to Lokalise. Defaults to `->(data) { YAML.safe_load(data)&.keys&.first }`.
206
206
 
207
207
  ### Customizing JSON parser and network adapter
@@ -95,7 +95,7 @@ module LokaliseManager
95
95
 
96
96
  # Converts translations data to the proper format
97
97
  def translations_converter
98
- @translations_converter || ->(raw_data) { raw_data.to_yaml }
98
+ @translations_converter || ->(raw_data) { YAML.dump(raw_data).gsub(/\\\\n/, '\n') }
99
99
  end
100
100
 
101
101
  # Infers lang ISO for the given translation file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LokaliseManager
4
- VERSION = '3.1.0'
4
+ VERSION = '3.2.0'
5
5
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'zeitwerk'
4
4
  require 'yaml'
5
+ require 'psych'
5
6
 
6
7
  loader = Zeitwerk::Loader.for_gem
7
8
  loader.setup
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lokalise_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krukowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-17 00:00:00.000000000 Z
11
+ date: 2022-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-lokalise-api
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
- rubygems_version: 3.3.19
227
+ rubygems_version: 3.3.21
228
228
  signing_key:
229
229
  specification_version: 4
230
230
  summary: Lokalise integration for Ruby