nitc :: StringFinder
nitc :: StringFinder :: _domain
Domain of the strings to internationalizenitc :: StringFinder :: _languages_location
Location of the languages filenitc :: StringFinder :: _toolcontext
Context for the visitor, used only for the parse_exprnitc :: StringFinder :: add_string
Adds a String to the list of strings of the modulenitc :: StringFinder :: amodule=
The module we are working onnitc :: StringFinder :: defaultinit
nitc :: StringFinder :: domain=
Domain of the strings to internationalizenitc :: StringFinder :: languages_location
Location of the languages filenitc :: StringFinder :: languages_location=
Location of the languages filenitc :: StringFinder :: toolcontext
Context for the visitor, used only for the parse_exprnitc :: StringFinder :: toolcontext=
Context for the visitor, used only for the parse_exprnitc $ StringFinder :: SELF
Type of this instance, automatically specialized in every classnitc $ StringFinder :: enter_visit
Ask the visitor to visit a given node.nitc :: StringFinder :: _domain
Domain of the strings to internationalizenitc :: StringFinder :: _languages_location
Location of the languages filenitc :: StringFinder :: _toolcontext
Context for the visitor, used only for the parse_exprnitc :: StringFinder :: add_string
Adds a String to the list of strings of the modulenitc :: StringFinder :: amodule=
The module we are working oncore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: Visitor :: current_node=
The current visited nodenitc :: Visitor :: defaultinit
core :: Object :: defaultinit
nitc :: StringFinder :: defaultinit
nitc :: StringFinder :: domain=
Domain of the strings to internationalizenitc :: Visitor :: enter_visit
Ask the visitor to visit a given node.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.
nitc :: StringFinder :: languages_location
Location of the languages filenitc :: StringFinder :: languages_location=
Location of the languages filecore :: 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 :: StringFinder :: toolcontext
Context for the visitor, used only for the parse_exprnitc :: StringFinder :: toolcontext=
Context for the visitor, used only for the parse_expr
private class StringFinder
super Visitor
# Strings in the file, used to generate .pot and .po files
var strings = new HashMap[String, PObject]
# Domain of the strings to internationalize
var domain: String
# Location of the languages file
var languages_location: String
# Context for the visitor, used only for the parse_expr
var toolcontext: ToolContext
# The module we are working on
var amodule: AModule
redef fun visit(n)
do
n.accept_string_finder(self)
n.visit_all(self)
end
redef fun enter_visit(e) do
if e isa AAnnotation then return
super
end
# Adds a String to the list of strings of the module
#
# The string needs to be pre-formatted to C standards (escape_to_c)
fun add_string(s: String, loc: Location) do
var locstr = "{amodule.mmodule.mgroup.name}::{amodule.mmodule.name} {loc.line_start}--{loc.column_start}:{loc.column_end}"
if not strings.has_key(s) then
var po = new PObject([locstr], s, "")
strings[s] = po
else
strings[s].locations.push locstr
end
end
end
src/frontend/i18n_phase.nit:83,1--124,3