tolq-parsers-xliff 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xliff/parser.rb +5 -3
- data/lib/xliff/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e08463663182e35b84d2765d9ab48d321bbefe68
|
4
|
+
data.tar.gz: d910566af4d15b8a28b646356ecaf9da2f46fb6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c1ed7451147cc820d4579a36ddbd29035c04b4e7cb4481ac52c9397439567b890c2366f7df459aeb340ab4e6a6ab717e2e0500fdf55d4bc5bef533b4c5e4646
|
7
|
+
data.tar.gz: 2e5604abde0d51c14b896160973d4856d67df0d30dbd1aef251ef7ee4e777bd27e8b423cee44144336e4df20afe55eabee0ffd3ab0bf50491946d25e539a7fcb
|
data/lib/xliff/parser.rb
CHANGED
@@ -5,8 +5,10 @@ module Tolq::Parsers::Xliff
|
|
5
5
|
#
|
6
6
|
# @param quality [Symbol] the Tolq quality to order in, one of `:basic`, `:standard`, `:professional` or `:expert`
|
7
7
|
# @return [Tolq::Parsers::Xliff::Parser] a parser ready to parse an xliff text
|
8
|
-
def initialize(quality:)
|
8
|
+
def initialize(quality:, source_language_code: nil, target_language_code: nil)
|
9
9
|
@quality = quality
|
10
|
+
@source_language_code = source_language_code
|
11
|
+
@target_language_code = target_language_code
|
10
12
|
end
|
11
13
|
|
12
14
|
# Parses an Xliff text
|
@@ -20,8 +22,8 @@ module Tolq::Parsers::Xliff
|
|
20
22
|
|
21
23
|
{
|
22
24
|
"request" => request_data,
|
23
|
-
"source_language_code" => strip_region_language(file.source_language),
|
24
|
-
"target_language_code" => strip_region_language(file.target_language),
|
25
|
+
"source_language_code" => @source_language_code || strip_region_language(file.source_language),
|
26
|
+
"target_language_code" => @target_language_code || strip_region_language(file.target_language),
|
25
27
|
"quality" => @quality.to_s
|
26
28
|
}
|
27
29
|
end
|
data/lib/xliff/version.rb
CHANGED