nitc: update code to use qclassids
[nit.git] / src / frontend / i18n_phase.nit
index dc550af..0550caf 100644 (file)
@@ -58,7 +58,7 @@ private class I18NPhase
 
                var pot_path = locale_dir / module_name
                var arr = vi.strings.values.to_a
-               var po = new POFile.with_strings(arr)
+               var po = new POFile(arr)
                po.write_template(pot_path)
 
                if lang != null then
@@ -131,7 +131,7 @@ redef class AStringExpr
 
        redef fun accept_string_finder(v) do
                var str = value.as(not null).escape_to_gettext
-               var code = "\"{str}\".get_translation(\"{v.domain}\", \"{v.languages_location}\").unescape_nit"
+               var code = "\"{str}\".get_translation(\"{v.domain}\", \"{v.languages_location}\")"
                var parse = v.toolcontext.parse_expr(code)
                replace_with(parse)
                v.add_string(str, location)
@@ -155,7 +155,7 @@ redef class ASuperstringExpr
                end
                fmt = fmt.escape_to_gettext
                v.add_string(fmt, location)
-               var code = "\"{fmt}\".get_translation(\"{v.domain}\", \"{v.languages_location}\").unescape_nit.format()"
+               var code = "\"{fmt}\".get_translation(\"{v.domain}\", \"{v.languages_location}\").format()"
                var parse = v.toolcontext.parse_expr(code)
                if not parse isa ACallExpr then
                        v.toolcontext.error(location, "Fatal error in i18n annotation, the parsed superstring could not be generated properly")
@@ -191,12 +191,6 @@ class POFile
        # Read from a PO file
        var strings: Array[PObject]
 
-       # Creates a PO file with strings built-in
-       init with_strings(sm: Array[PObject])do
-               strings = new Array[PObject].with_capacity(sm.length)
-               strings.add_all sm
-       end
-
        redef fun write_to_file(path) do
                if not path.has_suffix(".po") then path += ".po"
                super path