lib/isodoc/function/i18n.rb in isodoc-0.8.8 vs lib/isodoc/function/i18n.rb in isodoc-0.8.9
- old
+ new
@@ -67,23 +67,23 @@
@labels["language"] = @lang
@labels["script"] = @script
end
# TODO: move to localization file
- def eref_localities1_zh(type, from, to)
+ def eref_localities1_zh(target, type, from, to)
ret = ", 第#{from.text}" if from
ret += "–#{to}" if to
- ret += (@locality[type] || type.sub(/^locality:/, "").capitalize )
+ loc = (@locality[type] || type.sub(/^locality:/, "").capitalize )
+ ret += " #{loc}"
ret
end
# TODO: move to localization file
- def eref_localities1(type, from, to, lang = "en")
- subsection = from&.text&.match(/\./)
- return l10n(eref_localities1_zh(type, from, to)) if lang == "zh"
+ def eref_localities1(target, type, from, to, lang = "en")
+ return l10n(eref_localities1_zh(target, type, from, to)) if lang == "zh"
ret = ","
loc = @locality[type] || type.sub(/^locality:/, "").capitalize
- ret += " #{loc}" unless subsection && type == "clause"
+ ret += " #{loc}"
ret += " #{from.text}" if from
ret += "–#{to.text}" if to
l10n(ret)
end