Skip to content

Commit 709593d

Browse files
committed
refactor i18n yaml to prevent overwriting parent non-English YAML with local English file: metanorma/isodoc#549
1 parent 7dc87cd commit 709593d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/isodoc/iso/i18n.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def load_file(fname)
88

99
def load_yaml1(lang, script)
1010
y = load_file("i18n-#{yaml_lang(lang, script)}.yaml")
11-
super.deep_merge(y)
11+
y.empty? ? load_file("i18n-en.yaml").merge(super) : super.deep_merge(y)
1212
end
1313
end
1414
end

spec/isodoc/i18n_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,12 @@
549549
<bibdata>
550550
<status>
551551
<stage abbreviation='IS' language=''>60</stage>
552+
<stage abbreviation="IS" language="tlh">International Standard</stage>
552553
</status>
553554
<language current='true'>tlh</language>
554555
<ext>
555556
<doctype language=''>international-standard</doctype>
557+
<doctype language="tlh">International Standard</doctype>
556558
</ext>
557559
</bibdata>
558560
<preface>

0 commit comments

Comments
 (0)