rails_translation_manager 1.6.0 → 1.6.2
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 +4 -4
- data/.github/dependabot.yml +4 -0
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/config/locales/plurals.rb +10 -6
- data/lib/rails_translation_manager/railtie.rb +10 -0
- data/lib/rails_translation_manager/version.rb +1 -1
- data/lib/rails_translation_manager.rb +0 -4
- data/rails_translation_manager.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e78d6948f6352a4d8f9d07aca6681aacee4fb98d86c415e07ad44bf0823decd4
|
4
|
+
data.tar.gz: f8c1792ba8534bf288a83169d4becd493fa622f0c3dc8c15f7e990b912f76455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 011a2ff414a52a94b13613fd9d45ecd98ba0c60a363eb1714a997268c68e57e6843afef40a35f56f3bae62a7d5bd6bb02adea90bb2d732e3c456c4f788ebde81
|
7
|
+
data.tar.gz: 787c726abdd03338cf0752add06752b645c699354c468968cd9de0b53ddc040395ac3a1697e1c68392794a6550b13abe3492d4c8588b2d500c57d0a099d7ab92
|
data/.github/dependabot.yml
CHANGED
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# 1.6.2
|
2
|
+
|
3
|
+
* Load plural rules after initialising app https://github.com/alphagov/rails_translation_manager/pull/61
|
4
|
+
|
5
|
+
# 1.6.1
|
6
|
+
|
7
|
+
* Audits plural rules and ensures consistent formatting https://github.com/alphagov/rails_translation_manager/pull/57
|
8
|
+
* Allows all plural rules to be loaded by setting env variable https://github.com/alphagov/rails_translation_manager/pull/58/
|
9
|
+
|
1
10
|
# 1.6.0
|
2
11
|
|
3
12
|
Update plural file loading https://github.com/alphagov/rails_translation_manager/pull/52
|
data/config/locales/plurals.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
{
|
4
|
+
# Azerbaijani
|
5
|
+
az: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
4
6
|
# Welsh
|
5
7
|
cy: { i18n: { plural: { keys: %i[zero one two few many other],
|
6
8
|
rule:
|
@@ -18,6 +20,8 @@
|
|
18
20
|
dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
19
21
|
# Latin America and Caribbean Spanish
|
20
22
|
"es-419": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
23
|
+
# Persian
|
24
|
+
fa: { i18n: { plural: { keys: %i[one other], rule: ->(n) { [0, 1].include?(n) ? :one : :other } } } },
|
21
25
|
# Gujarati
|
22
26
|
gu: { i18n: { plural: { keys: %i[one other], rule: ->(n) { [0, 1].include?(n) ? :one : :other } } } },
|
23
27
|
# Scottish Gaelic
|
@@ -37,7 +41,6 @@
|
|
37
41
|
hy: { i18n: { plural: { keys: %i[one other], rule: ->(n) { [0, 1].include?(n) ? :one : :other } } } },
|
38
42
|
# Kazakh
|
39
43
|
kk: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
40
|
-
# Pashto
|
41
44
|
# Maltese
|
42
45
|
mt: { i18n: { plural: { keys: %i[one few many other],
|
43
46
|
rule:
|
@@ -55,9 +58,10 @@
|
|
55
58
|
:other
|
56
59
|
end
|
57
60
|
end } } },
|
58
|
-
ps: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
59
61
|
# Punjabi Shahmukhi
|
60
62
|
"pa-pk": { i18n: { plural: { keys: %i[one other], rule: ->(n) { [0, 1].include?(n) ? :one : :other } } } },
|
63
|
+
# Pashto
|
64
|
+
ps: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
61
65
|
# Sinhalese
|
62
66
|
si: { i18n: { plural: { keys: %i[one other], rule: ->(n) { [0, 1].include?(n) ? :one : :other } } } },
|
63
67
|
# Somali
|
@@ -73,11 +77,11 @@
|
|
73
77
|
# Uzbek
|
74
78
|
uz: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
75
79
|
# Yiddish
|
76
|
-
yi: { i18n: { plural: { keys: %i[one other], rule: ->(n) {
|
80
|
+
yi: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
77
81
|
# Chinese
|
78
|
-
zh: { i18n: { plural: { keys: %i[other], rule: ->
|
82
|
+
zh: { i18n: { plural: { keys: %i[other], rule: -> { :other } } } },
|
79
83
|
# Chinese Hong Kong
|
80
|
-
|
84
|
+
"zh-hk": { i18n: { plural: { keys: %i[other], rule: -> { :other } } } },
|
81
85
|
# Chinese Taiwan
|
82
|
-
|
86
|
+
"zh-tw": { i18n: { plural: { keys: %i[other], rule: -> { :other } } } }
|
83
87
|
}
|
@@ -5,5 +5,15 @@ module RailsTranslationManager
|
|
5
5
|
rake_tasks do
|
6
6
|
Dir[File.expand_path('../tasks/*.rake', File.dirname(__FILE__))].each { |f| load f }
|
7
7
|
end
|
8
|
+
|
9
|
+
config.after_initialize do
|
10
|
+
if ENV["RAILS_TRANSLATION_MANAGER_LOAD_ALL_PLURAL_RULES"]
|
11
|
+
rails_i18n_path = Gem::Specification.find_by_name("rails-i18n").gem_dir
|
12
|
+
I18n.load_path += Dir["#{rails_i18n_path}/rails/pluralization/*.rb"]
|
13
|
+
end
|
14
|
+
|
15
|
+
rails_translation_manager = Gem::Specification.find_by_name("rails_translation_manager").gem_dir
|
16
|
+
I18n.load_path += ["#{rails_translation_manager}/config/locales/plurals.rb"]
|
17
|
+
end
|
8
18
|
end
|
9
19
|
end
|
@@ -20,10 +20,6 @@ require "rails_translation_manager/exporter"
|
|
20
20
|
require "rails_translation_manager/importer"
|
21
21
|
|
22
22
|
module RailsTranslationManager
|
23
|
-
rails_translation_manager = Gem::Specification.find_by_name("rails_translation_manager").gem_dir
|
24
|
-
|
25
|
-
I18n.load_path += ["#{rails_translation_manager}/config/locales/plurals.rb"]
|
26
|
-
|
27
23
|
def self.locale_root
|
28
24
|
if ENV["RAILS_TRANSLATION_MANAGER_LOCALE_ROOT"]
|
29
25
|
Pathname.new(ENV["RAILS_TRANSLATION_MANAGER_LOCALE_ROOT"])
|
@@ -6,8 +6,8 @@ require 'rails_translation_manager/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "rails_translation_manager"
|
8
8
|
spec.version = RailsTranslationManager::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["GOV.UK Dev"]
|
10
|
+
spec.email = ["govuk-dev@digital.cabinet-office.gov.uk"]
|
11
11
|
spec.summary = %q{Tasks to manage translation files}
|
12
12
|
spec.description = ""
|
13
13
|
spec.homepage = ""
|
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.
|
4
|
+
version: 1.6.2
|
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-
|
11
|
+
date: 2022-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -152,7 +152,7 @@ dependencies:
|
|
152
152
|
version: '0'
|
153
153
|
description: ''
|
154
154
|
email:
|
155
|
-
-
|
155
|
+
- govuk-dev@digital.cabinet-office.gov.uk
|
156
156
|
executables: []
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|