Skip to content

Commit 1148843

Browse files
committed
refactor i18n yaml to prevent overwriting parent non-English YAML with local English file: metanorma/isodoc#549
1 parent 9e33f14 commit 1148843

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

Gemfile.devel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "main"
1+
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/i18n-yaml-inheritance"

lib/isodoc/iso/i18n.rb

+1-11
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,8 @@ def load_file(fname)
66
{}
77
end
88

9-
# all gems inheriting from ISO need to be represented here,
10-
# even if the file is empty
11-
# e.g. JA for metanorma-jis
129
def load_yaml1(lang, script)
13-
y = if lang == "en" then load_file("i18n-en.yaml")
14-
elsif lang == "fr" then load_file("i18n-fr.yaml")
15-
elsif lang == "ru" then load_file("i18n-ru.yaml")
16-
elsif lang == "ja" then load_file("i18n-ja.yaml")
17-
elsif lang == "zh" && script == "Hans"
18-
load_file("i18n-zh-Hans.yaml")
19-
else load_file("i18n-en.yaml")
20-
end
10+
y = load_file("i18n-#{yaml_lang(lang, script)}.yaml")
2111
super.deep_merge(y)
2212
end
2313
end

0 commit comments

Comments
 (0)