lib/isodoc/iso/base_convert.rb in metanorma-iso-1.3.21 vs lib/isodoc/iso/base_convert.rb in metanorma-iso-1.3.22
- old
+ new
@@ -89,26 +89,26 @@
clause.xpath(ns("./clause | ./references")).each_with_index do |c, i|
annex_names1(c, "#{num}.#{i + 1}", level + 1)
end
end
- def eref_localities1_zh(target, type, from, to)
+ def eref_localities1_zh(target, type, from, to, delim)
subsection = from&.text&.match(/\./)
- ret = type == "list" ? "" : ","
+ ret = (delim == ";") ? ";" : (type == "list") ? "" : delim
ret += " 第#{from.text}" if from
ret += "–#{to}" if to
loc = (@locality[type] || type.sub(/^locality:/, "").capitalize )
ret += " #{loc}" unless subsection && type == "clause" ||
type == "list" || target.match(/^IEV$|^IEC 60050-/)
ret += ")" if type == "list"
ret
end
- def eref_localities1(target, type, from, to, lang = "en")
+ def eref_localities1(target, type, from, to, delim, lang = "en")
subsection = from&.text&.match(/\./)
type = type.downcase
- return l10n(eref_localities1_zh(target, type, from, to)) if lang == "zh"
- ret = type == "list" ? "" : ","
+ return l10n(eref_localities1_zh(target, type, from, to, delim)) if lang == "zh"
+ ret = (delim == ";") ? ";" : (type == "list") ? "" : delim
loc = @locality[type] || type.sub(/^locality:/, "").capitalize
ret += " #{loc}" unless subsection && type == "clause" ||
type == "list" || target.match(/^IEV$|^IEC 60050-/)
ret += " #{from.text}" if from
ret += "–#{to.text}" if to