govuk_app_config 2.8.4 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -0
- data/lib/govuk_app_config.rb +1 -0
- data/lib/govuk_app_config/govuk_i18n.rb +38 -0
- data/lib/govuk_app_config/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 106a5c63b04c2882b7715da357f9c2e6d69dd87c20f7ceccefdb8b1b7a27e0b7
|
4
|
+
data.tar.gz: 0035b7c017727795f9dcc2f99c883be9b0f8c0f77992ffd14f9373a16f890e31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e80717eb6c207a69f25019806a2085c93ea595126d665314a54acc3679a4053db88a7062efb3b711b4368b5937dadc784af50532e3c9be30ab2310878842a44
|
7
|
+
data.tar.gz: 568071152636585876ece594c91884ebbce3d5a284ed4df8d9e268af05836e95872f7cc84e9f6ed73b672f61a6e20284274c7fe4fb45114728efc05a15b1ebba
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -162,6 +162,10 @@ app with the following content:
|
|
162
162
|
GovukContentSecurityPolicy.configure
|
163
163
|
```
|
164
164
|
|
165
|
+
## i18n rules
|
166
|
+
|
167
|
+
Some frontend apps support languages that are not defined in the i18n gem. This provides them with our own custom rules for these languages.
|
168
|
+
|
165
169
|
## License
|
166
170
|
|
167
171
|
[MIT License](LICENSE.md)
|
data/lib/govuk_app_config.rb
CHANGED
@@ -3,6 +3,7 @@ require "govuk_app_config/govuk_statsd"
|
|
3
3
|
require "govuk_app_config/govuk_error"
|
4
4
|
require "govuk_app_config/govuk_error/configure"
|
5
5
|
require "govuk_app_config/govuk_healthcheck"
|
6
|
+
require "govuk_app_config/govuk_i18n"
|
6
7
|
# This require is deprecated and should be removed on next major version bump
|
7
8
|
# and should be required by applications directly.
|
8
9
|
require "govuk_app_config/govuk_unicorn"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module GovukI18n
|
2
|
+
def plurals
|
3
|
+
{
|
4
|
+
# Dari - this isn't an iso code. Probably should be 'prs' as per ISO 639-3.
|
5
|
+
dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
6
|
+
# Latin America and Caribbean Spanish
|
7
|
+
"es-419": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
8
|
+
# Scottish Gaelic
|
9
|
+
gd: { i18n: { plural: { keys: %i[one two few other],
|
10
|
+
rule:
|
11
|
+
lambda do |n|
|
12
|
+
if [1, 11].include?(n)
|
13
|
+
:one
|
14
|
+
elsif [2, 12].include?(n)
|
15
|
+
:two
|
16
|
+
elsif [3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19].include?(n)
|
17
|
+
:few
|
18
|
+
else
|
19
|
+
:other
|
20
|
+
end
|
21
|
+
end } } },
|
22
|
+
# Armenian
|
23
|
+
hy: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
24
|
+
# Kazakh
|
25
|
+
kk: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
26
|
+
# Punjabi Shahmukhi
|
27
|
+
"pa-pk": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
28
|
+
# Sinhalese
|
29
|
+
si: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
30
|
+
# Uzbek
|
31
|
+
uz: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
32
|
+
# Chinese Hong Kong
|
33
|
+
"zh-hk" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
34
|
+
# Chinese Taiwan
|
35
|
+
"zh-tw" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
|
36
|
+
}
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_app_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstasher
|
@@ -242,6 +242,7 @@ files:
|
|
242
242
|
- lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
|
243
243
|
- lib/govuk_app_config/govuk_healthcheck/sidekiq_retry_size_check.rb
|
244
244
|
- lib/govuk_app_config/govuk_healthcheck/threshold_check.rb
|
245
|
+
- lib/govuk_app_config/govuk_i18n.rb
|
245
246
|
- lib/govuk_app_config/govuk_logging.rb
|
246
247
|
- lib/govuk_app_config/govuk_statsd.rb
|
247
248
|
- lib/govuk_app_config/govuk_unicorn.rb
|