translation 1.24 → 1.26

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
2
  SHA256:
3
- metadata.gz: 8082495585677aa8e3ca187a4c4a443d3064e479010b4f7519d2ae7318ae5f66
4
- data.tar.gz: 5e0f671d44c5aaa4436b4cff506444886a3f817f670f99eabb97b8a7534b7a5f
3
+ metadata.gz: 62e2f60b79bd08f6fc2a85ebda36669c059f9014388ba27446a6d04f25ba8533
4
+ data.tar.gz: 654efcbe79ed6771f99eb2464b0df6b810d6da7a469a77131e26b42199c12225
5
5
  SHA512:
6
- metadata.gz: 1407033d3f2b08b6429d4bbc10ce6997f2b7f72a8a24832a4b58cb018817a983059b3871cdd91d37fcaf44f9fc7127699ec4920108ac7944bce41e8a3355c62c
7
- data.tar.gz: 71c9607dc017aeb3d3843eb462138c372636a752033216ae4211008ba013272e44f84c388ddae8dbbfb24d5679f87124d404e0b09b98262f4645fe3c9bb23b3d
6
+ metadata.gz: d6a24b78b2dcd46883516b35c674262a966312ac60977a6a4130e26d68a91079ea5cf0572387d9ffe9be42de57c1749e1968550382f6d88a48eafe81a2e6b667
7
+ data.tar.gz: 29c8893a9d189f746063c74358f1e339bc6058b9993f4dfd45e91b0f02b3acf95f26eab3b44cbc22daf0725f91ab3df9ba576be96d15f9f030b8a79b4cc4831f
@@ -35,7 +35,9 @@ module TranslationIO
35
35
  YamlEntry.from_locale?(key, target_locale) && !YamlEntry.ignored?(key)
36
36
  end
37
37
 
38
- yaml_data = YAMLConversion.get_yaml_data_from_flat_translations(target_flat_special_translations)
38
+ yaml_data = YAMLConversion.get_yaml_data_from_flat_translations(target_flat_special_translations, **{
39
+ :force_keep_empty_keys => true # We want to keep empty keys from localization.xx.yml files (sometimes needed for delimiters!)
40
+ })
39
41
 
40
42
  params["yaml_data_#{target_locale}"] = yaml_data
41
43
 
@@ -35,9 +35,14 @@ module TranslationIO
35
35
  end
36
36
  end
37
37
 
38
- def get_yaml_data_from_flat_translations(flat_translations)
39
- remove_empty_keys = TranslationIO.config.yaml_remove_empty_keys
40
- translations = FlatHash.to_hash(flat_translations, remove_empty_keys)
38
+ def get_yaml_data_from_flat_translations(flat_translations, force_keep_empty_keys: false)
39
+ if force_keep_empty_keys
40
+ remove_empty_keys = false
41
+ else
42
+ remove_empty_keys = TranslationIO.config.yaml_remove_empty_keys
43
+ end
44
+
45
+ translations = FlatHash.to_hash(flat_translations, remove_empty_keys)
41
46
 
42
47
  if TranslationIO.config.yaml_line_width
43
48
  data = translations.to_yaml(:line_width => TranslationIO.config.yaml_line_width)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translation
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.24'
4
+ version: '1.26'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hoste
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-15 00:00:00.000000000 Z
12
+ date: 2021-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gettext