i18n-backend-side_by_side 1.2.0 → 1.3.0

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: 60dd5bb5c547d84a8925bf748d4861748be81b26f9b9e024fc4528460e789da5
4
- data.tar.gz: 345003a886a81cc04b89f3ac1e231ac8686063ffe4c3d808d30d30db81b6b5c5
3
+ metadata.gz: 4a7f5433094b30b366c592d1073bc92dd7b6e6d42545c7b3c5d33a2fbaac6f18
4
+ data.tar.gz: 6f1e071a3dda21deee16653b2e006085ea57ea6d2498fde0f41fa4acde4cc401
5
5
  SHA512:
6
- metadata.gz: 006af3c6adae8d1cb959078f0f176b3a4a6b2a6f15c04e09f2cb9a5d48366ab9cdffc9d6fbdba153160d0078a9a05523125fe14d48300fcfee8171bbb5f93561
7
- data.tar.gz: '083505d4a5c15e0ada2d4c49fabef8a579a8df7915a9c603966d3a24efec05f873b961336e2285470a33a90c004e0c94017b97f9f47c58a253251066de5e14a4'
6
+ metadata.gz: d8a6e4ea084637478ca26f05fec5d15cb765fc8f0646e8f97e9dc92f85cd57ef2eadabb72b120370da44a01c41b489191ad5db97188093ed10a08bbf7da25abd
7
+ data.tar.gz: 697d59776e3f6cf1a526c0f4c81f3b13ba20ac55fd8a38d97c778997cdfa9c629343bd601d14c9da87b77b00ba4ec872018ed2c51977bfa40a51a22053877367
@@ -17,19 +17,18 @@ jobs:
17
17
  test:
18
18
 
19
19
  runs-on: ubuntu-latest
20
+
20
21
  strategy:
21
22
  matrix:
22
- ruby-version: ['2.7', '3.0']
23
+ ruby-version: ['3.2', '3.1', '3.0', '2.7']
23
24
 
24
25
  steps:
25
- - uses: actions/checkout@v2
26
- - name: Set up Ruby
27
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
- # uses: ruby/setup-ruby@v1
30
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
31
- with:
32
- ruby-version: ${{ matrix.ruby-version }}
33
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
- - name: Run tests
35
- run: bundle exec rake
26
+ - uses: actions/checkout@v3
27
+ - name: Set up Ruby ${{ matrix.ruby-version }}
28
+ uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby-version }}
31
+ - name: Install dependencies
32
+ run: bundle install
33
+ - name: Run tests
34
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.3.0
4
+
5
+ - Add Ruby 3.1 and 3.2 to CI
6
+ - Support translations keys without specified language #8
7
+
3
8
  ## v1.2.0
4
9
 
5
10
  - Support i18n 1.10.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.3.0
@@ -27,7 +27,13 @@ module I18n
27
27
  private
28
28
 
29
29
  def _process(path, hash)
30
- if _contains_locales?(hash)
30
+ if !hash.is_a?(Hash)
31
+ ### TRANSLATION KEY WITHOUT SPECIFIED LANGUAGE - WILL BE APPLIED TO ALL LANGUAGES
32
+ value = hash
33
+ translations.keys.each do |locale|
34
+ _store([locale] + path, value)
35
+ end
36
+ elsif _contains_locales?(hash)
31
37
  hash.each do |locale, value|
32
38
  _store([_strip_locale_prefix(locale)] + path, value)
33
39
  end
@@ -19,3 +19,4 @@ _:
19
19
  only_en:
20
20
  some_key:
21
21
  _en: 'some value'
22
+ without_language: "Without Language"
data/test/test.rb CHANGED
@@ -32,4 +32,9 @@ class Test < Minitest::Test
32
32
  assert_raises { I18n.t('foo.only_en.some_key', locale: :de, raise: true) }
33
33
  assert_raises { I18n.t('foo.only_en', locale: :de, raise: true) }
34
34
  end
35
+
36
+ def test_without_language
37
+ assert_equal('Without Language', I18n.t('foo.without_language', language: :en))
38
+ assert_equal('Without Language', I18n.t('foo.without_language', language: :de))
39
+ end
35
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-backend-side_by_side
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipe Fatio
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-03-21 00:00:00.000000000 Z
12
+ date: 2023-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubygems_version: 3.1.4
112
+ rubygems_version: 3.3.10
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Tired of jumping between language files when translating keys? Stop jumping