pseudolocalization 0.9.0 → 0.9.1

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: ca597fc6e2ea40f05915ef289dc48d3deb1c95872aec4a8b69474caeabfc8b39
4
- data.tar.gz: 7485fd957362b90aeedd711c4197c96b8629d641896fa65e77f016a613a486b6
3
+ metadata.gz: 953fc8645d51046e0ea9f3cf943d07d297f0e69894aea97ae986ea3793949eff
4
+ data.tar.gz: f2c5c2ff02cb1c8491794a0c48ccc7e045a95880d10a67b889e7a7ac1dd4592d
5
5
  SHA512:
6
- metadata.gz: 6d238815d07f095314e6fbbca25a71ea44543e8a8d57a1b4c3fc2f7d55a5e76b56d75cd7a8f308ed89757ee3710fd4e5e0dcfd4d5ce3968ca065535a4e01a824
7
- data.tar.gz: 35e98480b647dc3203e2c09248db82dd060d08d77032c410cfc76492eaa4775e214a07fe9582429a57025a1da7e641bde3cb95cf4ef9f9029777abd61fb350bf
6
+ metadata.gz: 21a1bc280d86b3f1c666f48c69fee633e047eae3cfc662c2bcde713acc2554575749557e01dce83c5629605db15a252d724dc4dc2560b45409ce0b0bb73c830e
7
+ data.tar.gz: f5324b187dc3c3113e486f90a89f9e1e2979286f732c5402fac5ac624e138eb2172bb4afa3a70d185912889a1c445deb6176af9fd4a8a39a0b4f9b67b66a0f07
@@ -0,0 +1,14 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: weekly
8
+ time: "10:00"
9
+ timezone: America/Toronto
10
+ open-pull-requests-limit: 99
11
+ reviewers:
12
+ - Shopify/intl-languages
13
+ registries:
14
+ - rubygems-server-pkgs-shopify-io
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
@@ -17,11 +17,11 @@ jobs:
17
17
  strategy:
18
18
  matrix:
19
19
  version:
20
- - 2.4
21
- - 2.5
22
- - 2.6
23
20
  - 2.7
24
21
  - 3.0
22
+ - 3.1
23
+ - 3.2
24
+ - 3.3
25
25
  gemfile:
26
26
  - Gemfile
27
27
  steps:
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.5
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
  ## Unreleased
7
7
  Nil.
8
8
 
9
+ ## [0.9.1] - 2024-06-27
10
+ ### Added
11
+ - Added support for pseudolocalized translations [#82](https://github.com/Shopify/pseudolocalization/pull/82)
12
+
9
13
  ## [0.9.0] - 2021-02-17
10
14
  ### Added
11
15
  - Added support for ignoring specific translation keys [#59](https://github.com/Shopify/pseudolocalization/pull/59)
@@ -52,7 +56,8 @@ Nil.
52
56
 
53
57
  Please refer to [GitHub releases](https://github.com/Shopify/pseudolocalization/releases) for releases prior to [0.8.0].
54
58
 
55
- [Unreleased]: https://github.com/Shopify/pseudolocalization/compare/0.9.0...HEAD
59
+ [Unreleased]: https://github.com/Shopify/pseudolocalization/compare/0.9.1...HEAD
60
+ [0.9.1]: https://github.com/Shopify/pseudolocalization/compare/0.9.0...0.9.1
56
61
  [0.9.0]: https://github.com/Shopify/pseudolocalization/compare/0.8.4...0.9.0
57
62
  [0.8.4]: https://github.com/Shopify/pseudolocalization/compare/0.8.3...0.8.4
58
63
  [0.8.3]: https://github.com/Shopify/pseudolocalization/compare/0.8.2...0.8.3
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pseudolocalization (0.9.0)
4
+ pseudolocalization (0.9.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- minitest (5.14.3)
9
+ minitest (5.14.4)
10
10
  rake (13.0.3)
11
11
 
12
12
  PLATFORMS
@@ -18,4 +18,4 @@ DEPENDENCIES
18
18
  rake (~> 13.0)
19
19
 
20
20
  BUNDLED WITH
21
- 2.2.4
21
+ 2.2.22
data/dev.yml CHANGED
@@ -3,7 +3,7 @@ name: pseudolocalization
3
3
  type: ruby
4
4
 
5
5
  up:
6
- - ruby: 2.7.2
6
+ - ruby
7
7
  - bundler
8
8
 
9
9
  commands:
@@ -1,3 +1,3 @@
1
1
  module Pseudolocalization
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -31,6 +31,13 @@ module Pseudolocalization
31
31
  ::Pseudolocalization::I18n::Pseudolocalizer.pseudolocalize(original_backend.translate(locale, key, options))
32
32
  end
33
33
 
34
+ def translations
35
+ original = original_backend.translations
36
+ original.transform_values do |locale_translations|
37
+ pseudolocalize_node(locale_translations)
38
+ end
39
+ end
40
+
34
41
  private
35
42
 
36
43
  def key_ignored?(key)
@@ -48,6 +55,22 @@ module Pseudolocalization
48
55
  end
49
56
  end
50
57
  end
58
+
59
+ def pseudolocalize_node(node, scope = [])
60
+ if node.is_a?(Hash)
61
+ node.each_with_object({}) do |(key, value), memo|
62
+ memo[key] = pseudolocalize_node(value, scope + [key])
63
+ end
64
+ elsif !key_ignored?(scope.join('.'))
65
+ ::Pseudolocalization::I18n::Pseudolocalizer.pseudolocalize(node)
66
+ else
67
+ node
68
+ end
69
+ end
70
+
71
+ def init_translations
72
+ original_backend.send(:init_translations)
73
+ end
51
74
  end
52
75
  end
53
76
  end
@@ -10,6 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["christ.blais@gmail.com"]
11
11
  spec.licenses = ['MIT']
12
12
 
13
+ spec.required_ruby_version = ">= 2.7"
14
+
13
15
  spec.summary = %q{Internationalization development tool}
14
16
  spec.description = %q{Internationalization development tool to help identify missing translations}
15
17
  spec.homepage = "https://github.com/Shopify/pseudolocalization"
data/service.yml CHANGED
@@ -1,7 +1 @@
1
- org_line: Build
2
- owners:
3
- - Shopify/intl-languages
4
- slack_channels:
5
- - help-i18n-and-translation
6
- classification: library
7
- ci_url: https://github.com/Shopify/pseudolocalization/workflows/CI
1
+ --- {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pseudolocalization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Blais
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2024-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -45,10 +45,11 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - ".dependabot/config.yml"
49
- - ".github/probots.yml"
48
+ - ".github/dependabot.yml"
49
+ - ".github/workflows/cla.yml"
50
50
  - ".github/workflows/ruby-ci.yml"
51
51
  - ".gitignore"
52
+ - ".ruby-version"
52
53
  - CHANGELOG.md
53
54
  - Gemfile
54
55
  - Gemfile.lock
@@ -77,14 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
78
  requirements:
78
79
  - - ">="
79
80
  - !ruby/object:Gem::Version
80
- version: '0'
81
+ version: '2.7'
81
82
  required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  requirements:
83
84
  - - ">="
84
85
  - !ruby/object:Gem::Version
85
86
  version: '0'
86
87
  requirements: []
87
- rubygems_version: 3.0.3
88
+ rubygems_version: 3.5.13
88
89
  signing_key:
89
90
  specification_version: 4
90
91
  summary: Internationalization development tool
@@ -1,12 +0,0 @@
1
- version: 1
2
- update_configs:
3
- - package_manager: "ruby:bundler"
4
- directory: "/"
5
- update_schedule: "weekly"
6
- automerged_updates:
7
- - match:
8
- dependency_type: "all"
9
- update_type: "all"
10
- version_requirement_updates: "auto"
11
- default_reviewers:
12
- - Shopify/intl-languages
data/.github/probots.yml DELETED
@@ -1,3 +0,0 @@
1
- # .github/probots.yml
2
- enabled:
3
- - cla