lib/isodoc/function/cleanup.rb in isodoc-1.1.4 vs lib/isodoc/function/cleanup.rb in isodoc-1.2.0

- old
+ new

@@ -5,24 +5,25 @@ end def termref_cleanup(docxml) docxml. gsub(%r{\s*\[/TERMREF\]\s*</p>\s*<p>\s*\[TERMREF\]}, "; "). - gsub(/\[TERMREF\]\s*/, l10n("[#{@source_lbl}: ")). - gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/, l10n(", #{@modified_lbl} [/TERMREF]")). + gsub(/\[TERMREF\]\s*/, l10n("[#{@i18n.source}: ")). + gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/, l10n(", #{@i18n.modified} [/TERMREF]")). gsub(%r{\s*\[\/TERMREF\]\s*}, l10n("]")). - gsub(/\s*\[MODIFICATION\]/, l10n(", #{@modified_lbl} &mdash; ")) + gsub(/\s*\[MODIFICATION\]/, l10n(", #{@i18n.modified} &mdash; ")) end def passthrough_cleanup(docxml) docxml.split(%r{(<passthrough>|</passthrough>)}).each_slice(4).map do |a| a.size > 2 and a[2] = HTMLEntities.new.decode(a[2]) [a[0], a[2]] end.join end def cleanup(docxml) + @i18n ||= i18n_init(@lang, @script) comment_cleanup(docxml) footnote_cleanup(docxml) inline_header_cleanup(docxml) figure_cleanup(docxml) table_cleanup(docxml) @@ -78,10 +79,10 @@ end def figure_get_or_make_dl(t) dl = t.at(".//dl") if dl.nil? - t.add_child("<p><b>#{@key_lbl}</b></p><dl></dl>") + t.add_child("<p><b>#{@i18n.key}</b></p><dl></dl>") dl = t.at(".//dl") end dl end