rails_translation_manager 1.6.3 → 1.7.0

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: b22e022079868b0d53fef06e6ff5b01dcaead0581e83717129bdcd7390b052c9
4
- data.tar.gz: 88132ad55d9464db0d5ada804264839d7229f47d30e2960ced17a16e198be63d
3
+ metadata.gz: 35e6ce2ef271522ff8d6d774923858bbd86682b5cb9cf5943c7e437346e5dd72
4
+ data.tar.gz: 054d264a3955fd7030b4ae7a786f487607c5d1665fb3fb711155226ed5552a99
5
5
  SHA512:
6
- metadata.gz: d3ee1b5e7edfbbb85e954d76670eb11fef58c78e364fff488802cf2adbcaec9be9712cf28751025cfb57dbd3f82f71d84cdd0a015080ecd2d4fdaec0226a6dc9
7
- data.tar.gz: c3436392abd8892303c3708ffc9bd54e140f1bd7d461b62bca4a12a6722781341458ce7257f4457d234633dc785e3185da23eef57fefeff9d43c65334db2dd66
6
+ metadata.gz: 3d8427543085ed1c6da6934ba5222666493e92e7f6ef7428aeb63190eaa5e52c207f80bed995447b87d2871b1a1713759be95fa48692051655c01c6a65403529
7
+ data.tar.gz: 407c5222bbe5de884bf9e079dd460e86b7bb3cd667ef6ed6d2b181fb2a0e69d1296ac8e8ae889916308f8f047f225a88b39e686c591def63c9ee97eb6f7511d9
@@ -1,16 +1,25 @@
1
1
  on: [push, pull_request]
2
2
 
3
3
  jobs:
4
+ codeql-sast:
5
+ name: CodeQL SAST scan
6
+ uses: alphagov/govuk-infrastructure/.github/workflows/codeql-analysis.yml@main
7
+ permissions:
8
+ security-events: write
9
+
10
+ dependency-review:
11
+ name: Dependency Review scan
12
+ uses: alphagov/govuk-infrastructure/.github/workflows/dependency-review.yml@main
13
+
4
14
  # This matrix job runs the test suite against multiple Ruby versions
5
15
  test_matrix:
6
16
  strategy:
7
17
  fail-fast: false
8
18
  matrix:
9
- # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
10
- ruby: [ 2.7, '3.0', 3.1 ]
19
+ ruby: [3.1, 3.2]
11
20
  runs-on: ubuntu-latest
12
21
  steps:
13
- - uses: actions/checkout@v3
22
+ - uses: actions/checkout@v4
14
23
  - uses: ruby/setup-ruby@v1
15
24
  with:
16
25
  ruby-version: ${{ matrix.ruby }}
@@ -31,6 +40,6 @@ jobs:
31
40
  if: ${{ github.ref == 'refs/heads/main' }}
32
41
  permissions:
33
42
  contents: write
34
- uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yaml@main
43
+ uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yml@main
35
44
  secrets:
36
45
  GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.6
1
+ 3.1.5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.7.0
2
+
3
+ * Drop support for Ruby 3.0
4
+
1
5
  # 1.6.3
2
6
 
3
7
  * Use proc for single plural languages https://github.com/alphagov/rails_translation_manager/pull/62
data/README.md CHANGED
@@ -63,4 +63,4 @@ Read [why we architected RTM in this way](https://docs.google.com/document/d/1ba
63
63
 
64
64
  ## Licence
65
65
 
66
- [MIT License](LICENSE.txt)
66
+ [MIT License](LICENCE)
@@ -1,25 +1,24 @@
1
1
  # Adding a language's plural form
2
2
 
3
- We maintain our own [plurals.rb](https://github.com/alphagov/rails_translation_manager/blob/master/config/locales/plurals.rb) configuration file. If adding a language to Rails Translation Manager, that doesn't exist in [rails-i18n](https://github.com/svenfuchs/rails-i18n), you may need to edit this file.
3
+ We maintain our own [plurals.rb][1] configuration file. This is used for plural
4
+ rules that don't exist in [rails-i18n][2].
4
5
 
5
- This config is needed to correctly distinguish the [plural rules](https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html) for locales not included in `rails-i18n`, as it is needed for plural validation checks.
6
-
7
- Note that there is currently a [duplicate list in `govuk_app_config](https://github.com/alphagov/govuk_app_config/blob/main/lib/govuk_app_config/govuk_i18n.rb). The intention is for this to be removed and for the Rails Translation Manager version to be the sole version.
6
+ If there is a missing plural rule (fails plural validator) then we can add the
7
+ rule to our [plurals.rb][1] file. Plural rules for most languages can be found
8
+ on the [unicode website][3] (cardinal type).
8
9
 
9
10
  ## Editing plural forms
10
11
 
11
12
  Keys with incorrect plural forms are more complex to adjust. If there are keys with additional unnecessary plural forms, they can be deleted:
12
13
 
13
14
  ```
14
- sed -i '' '/^ \+one:/d' config/locales/xx.yml
15
+ sed -i '' '/^ *one:/d' config/locales/xx.yml
15
16
  ```
16
17
 
17
- This commonly occurs for e.g. Chinese and Vietnamese which are expected to have only an `:other` and not a `:one` form.
18
-
19
18
  Keys which need a plural form added can be automated with caution. If every key of a specific translation needs the new plural added, it can be done by adding a blank key before every `other:` key:
20
19
 
21
20
  ```
22
- perl -0777 -p -i -e 's/\n(\s+)other:/\n\1nmany:\n\1other:/g' config/locales/xx.yml
21
+ perl -0777 -p -i -e 's/\n(\s+)other:/\n\1many:\n\1other:/g' config/locales/xx.yml
23
22
  ```
24
23
 
25
24
  Or if only a specific key needs the plural added:
@@ -28,4 +27,6 @@ Or if only a specific key needs the plural added:
28
27
  perl -0777 -p -i -e 's/(key_with_missing_plural:\n)(\s+)/\1\2zero:\n\2/g' config/locales/xx.yml
29
28
  ```
30
29
 
31
- This commonly occurs for Slavic languages and Arabic, for example, which have plural forms other than just `:one` and `:other`.
30
+ [1]: https://github.com/alphagov/rails_translation_manager/blob/main/config/locales/plurals.rb
31
+ [2]: https://github.com/svenfuchs/rails-i18n
32
+ [3]: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html
@@ -42,11 +42,21 @@ rake translation:normalize
42
42
 
43
43
  Remove keys that are not used anywhere in your application:
44
44
 
45
+ **Warning**:
46
+ > Removing unused keys may remove keys that actually _are_ used by your
47
+ application. This happens when RTM fails to scan certain keys in the
48
+ codebase, e.g when the keys are referenced dynamically. You can make RTM
49
+ ignore these keys by creating a `/config/i18n-tasks.yml` file with an
50
+ `ignore_unused` key.
51
+
52
+ A safer way to remove known unused keys is to use the [Delete keys](https://github.com/glebm/i18n-tasks#delete-keys)
53
+ command.
54
+
45
55
  ```
46
56
  rake translation:remove_unused
47
57
  ```
48
58
 
49
- Sometimes RTM might remove keys that actually _are_ used by your application. This happens when the keys are referenced dynamically. You can make RTM ignore these keys by creating a `/config/i18n-tasks.yml` file with an `ignore_unused` key. For example:
59
+ Example `ignore_unused` config:
50
60
 
51
61
  ```yaml
52
62
  ignore_unused:
@@ -73,7 +73,7 @@ class RailsTranslationManager::Importer
73
73
  group_csv_by_file(csv).each do |group|
74
74
  language_dir = File.join(import_directory, locale)
75
75
 
76
- Dir.mkdir(language_dir) unless Dir.exists?(language_dir)
76
+ Dir.mkdir(language_dir) unless Dir.exist?(language_dir)
77
77
 
78
78
  import_yml_path = File.join(import_directory, locale, "#{group[0]}.yml")
79
79
  import_csv(group[1], import_yml_path)
@@ -1,3 +1,3 @@
1
1
  module RailsTranslationManager
2
- VERSION = "1.6.3"
2
+ VERSION = "1.7.0"
3
3
  end
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
16
+ spec.required_ruby_version = ">= 3.1"
16
17
  spec.files = `git ls-files -z`.split("\x0")
17
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_translation_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-07 00:00:00.000000000 Z
11
+ date: 2024-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -163,7 +163,7 @@ files:
163
163
  - ".ruby-version"
164
164
  - CHANGELOG.md
165
165
  - Gemfile
166
- - LICENSE.txt
166
+ - LICENCE
167
167
  - README.md
168
168
  - Rakefile
169
169
  - config/locales/plurals.rb
@@ -229,14 +229,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
229
229
  requirements:
230
230
  - - ">="
231
231
  - !ruby/object:Gem::Version
232
- version: '0'
232
+ version: '3.1'
233
233
  required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  requirements:
235
235
  - - ">="
236
236
  - !ruby/object:Gem::Version
237
237
  version: '0'
238
238
  requirements: []
239
- rubygems_version: 3.3.26
239
+ rubygems_version: 3.5.11
240
240
  signing_key:
241
241
  specification_version: 4
242
242
  summary: Tasks to manage translation files
File without changes