Commit 82cda70 1 parent 1c0d92e commit 82cda70 Copy full SHA for 82cda70
File tree 3 files changed +22
-11
lines changed
3 files changed +22
-11
lines changed Original file line number Diff line number Diff line change
1
+ gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/i18n-yaml-inheritance"
2
+ gem "metanorma-iso", git: "https://github.com/metanorma/metanorma-iso", branch: "fix/i18n-yaml-inheritance"
Original file line number Diff line number Diff line change 1
1
module IsoDoc
2
2
module Iec
3
3
class I18n < IsoDoc ::Iso ::I18n
4
+ def load_file ( fname )
5
+ f = File . join ( File . dirname ( __FILE__ ) , fname )
6
+ File . exist? ( f ) ? YAML . load_file ( f ) : { }
7
+ end
8
+
4
9
def load_yaml1 ( lang , script )
5
- y = if lang == "en"
6
- YAML . load_file ( File . join ( File . dirname ( __FILE__ ) , "i18n-en.yaml" ) )
7
- elsif lang == "fr"
8
- YAML . load_file ( File . join ( File . dirname ( __FILE__ ) , "i18n-fr.yaml" ) )
9
- elsif lang == "zh" && script == "Hans"
10
- YAML . load_file ( File . join ( File . dirname ( __FILE__ ) , "i18n-zh-Hans.yaml" ) )
11
- else
12
- YAML . load_file ( File . join ( File . dirname ( __FILE__ ) , "i18n-en.yaml" ) )
13
- end
14
- super . deep_merge ( y )
10
+ y = load_file ( "i18n-#{ yaml_lang ( lang , script ) } .yaml" )
11
+ y . empty? ? load_file ( "i18n-en.yaml" ) . merge ( super ) : super . deep_merge ( y )
15
12
end
16
13
end
17
14
end
18
15
end
19
-
Original file line number Diff line number Diff line change 374
374
<ref name =" image" />
375
375
</element >
376
376
</define >
377
+ <define name =" depiction" >
378
+ <element name =" depiction" >
379
+ <optional >
380
+ <attribute name =" scope" />
381
+ </optional >
382
+ <zeroOrMore >
383
+ <ref name =" image" />
384
+ </zeroOrMore >
385
+ </element >
386
+ </define >
377
387
<define name =" NameWithVariants" >
378
388
<element name =" primary" >
379
389
<ref name =" LocalizedString" />
760
770
<optional >
761
771
<ref name =" validity" />
762
772
</optional >
773
+ <optional >
774
+ <ref name =" depiction" />
775
+ </optional >
763
776
</define >
764
777
<define name =" ReducedBibliographicItem" >
765
778
<optional >
You can’t perform that action at this time.
0 commit comments