txgh 6.2.0 → 6.2.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
  SHA1:
3
- metadata.gz: 9f67657fcaf74a8cd7c8b7adc0d8bdafc8cbb8f2
4
- data.tar.gz: 0e77e64bea84f5b6632e4211858b63174ac58851
3
+ metadata.gz: 489ac4e3bc92e1b84207c831c966a268a948c76c
4
+ data.tar.gz: d131ab0a2d4280a5183719bec782e38220a7de20
5
5
  SHA512:
6
- metadata.gz: 6a2840a7996fe0bff65b448c04663074922a46698d8eb9d24c54e850b0834eaf201dcbd5cf6fdfe55c876b16d1f0a3acb59fd36c645b0ad1679ed241c498d321
7
- data.tar.gz: 9d3c1bccbc54b4459ac6687d282b53c9ed06818cc486f23dff0853931cef59170763cd20ea7517a17b6c66ea369122891cafd0dcd6391198770e2fe619956bf9
6
+ metadata.gz: c46275dd6f305e225dcacedeed5663dff4f0b045936af210e0b5c353a805bfb5cfd4d311df2b034958cc9b74ef9b9c8b523b3452607b91bfc44544b9a57ac37d
7
+ data.tar.gz: d105c4bcc2a8c5288ee5a229a7b0182b4790493466a6ebe21ce710db95c4a6538c373d783028c0f86c7eee90b71b1754fd033b93deddf171b1f88924babe4780
@@ -82,7 +82,7 @@ module Txgh
82
82
  def download_each
83
83
  each_resource do |resource|
84
84
  each_language do |language_code|
85
- file_name = resource.translation_path(resource.lang_map(language_code))
85
+ file_name = resource.translation_path(language_code)
86
86
  yield resource, language_code, file_name
87
87
  end
88
88
  end
@@ -32,7 +32,7 @@ module Txgh
32
32
  end
33
33
 
34
34
  def translation_path(language)
35
- translation_file.gsub('<lang>', language)
35
+ translation_file.gsub('<lang>', lang_map(language))
36
36
  end
37
37
 
38
38
  def slugs
data/lib/txgh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Txgh
2
- VERSION = '6.2.0'
2
+ VERSION = '6.2.1'
3
3
  end
@@ -6,7 +6,7 @@ describe TxResource do
6
6
  let(:resource) do
7
7
  TxResource.new(
8
8
  'project_slug', 'resource_slug', 'type',
9
- 'source_lang', 'source_file', 'ko-KR:ko', 'translation_file'
9
+ 'source_lang', 'source_file', 'ko-KR:ko', 'translation_file/<lang>.foo'
10
10
  )
11
11
  end
12
12
 
@@ -26,6 +26,16 @@ describe TxResource do
26
26
  end
27
27
  end
28
28
 
29
+ describe '#translation_path' do
30
+ it 'interpolates the given locale' do
31
+ expect(resource.translation_path('de')).to eq('translation_file/de.foo')
32
+ end
33
+
34
+ it 'interpolates using the converted locale if a mapping exists for it' do
35
+ expect(resource.translation_path('ko-KR')).to eq('translation_file/ko.foo')
36
+ end
37
+ end
38
+
29
39
  describe '#to_h' do
30
40
  it 'converts the resource into a hash' do
31
41
  expect(resource.to_h).to eq(
@@ -34,7 +44,7 @@ describe TxResource do
34
44
  type: 'type',
35
45
  source_lang: 'source_lang',
36
46
  source_file: 'source_file',
37
- translation_file: 'translation_file'
47
+ translation_file: 'translation_file/<lang>.foo'
38
48
  )
39
49
  end
40
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txgh
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Jackowski
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-14 00:00:00.000000000 Z
12
+ date: 2016-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: abroad