nitc :: POFile :: defaultinit
nitc :: POFile :: write_template
Writes the information of the POFile to a .pot template filenitc $ POFile :: write_to_file
Likewrite_to
but take care of creating the file
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: POFile :: defaultinit
core :: Object :: defaultinit
core :: Writable :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: POFile :: write_template
Writes the information of the POFile to a .pot template filecore :: Writable :: write_to_bytes
Likewrite_to
but return a new Bytes (may be quite large)
core :: Writable :: write_to_file
Likewrite_to
but take care of creating the file
core :: Writable :: write_to_string
Likewrite_to
but return a new String (may be quite large).
# A GNU gettext .po/.pot file
class POFile
super Writable
# Map of the strings's `msgid` and `msgstr`
#
# Read from a PO file
var strings: Array[PObject]
redef fun write_to_file(path) do
if not path.has_suffix(".po") then path += ".po"
super path
end
redef fun write_to(ofs) do
for i in strings do
ofs.write("#: {i.locations.join(", ")}\n")
ofs.write("msgid \"{i.msgid}\"\n")
ofs.write("msgstr \"{i.msgstr}\"\n\n")
end
ofs.write("# Generated file, do not modify\n")
end
# Writes the information of the POFile to a .pot template file
fun write_template(path: String) do
if not path.has_suffix(".pot") then path += ".pot"
var f = new FileWriter.open(path)
write_to(f)
f.close
end
end
src/frontend/i18n_phase.nit:186,1--216,3