Tpl = <<"111"
"{#Translators: btrans comment #}{%blocktrans%}btrns{%endblocktrans%}"
"{%comment%} TRANSLATORS: trans comment {%endcomment%}222{%trans 'trns'%}"
"333">>,
Phrases = sources_parser:parse_content("filename.dtl", Tpl),
Msgids = [sources_parser:phrase_info(msgid, P) || P <- Phrases].
%% -> ["btrns", "trns"]
InOldFormat = [begin
[Str, File, Line, Col] = sources_parser:phrase_info([msgid, file, line, col], P),
{Str, {File, Line, Col}}
end || P <- Phrases].
%% -> [{"btrns", {"filename.dtl", 1, 47}}, {"trns", {"filename.dtl", 1, 135}]
Tpl = <<"111"
"{#Translators: btrans comment #}{%blocktrans%}btrns{%endblocktrans%}"
"{%comment%} TRANSLATORS: trans comment {%endcomment%}222{%trans 'trns'%}"
"333">>,
Phrases = sources_parser:parse_content("filename.dtl", Tpl),
Msgids = [sources_parser:phrase_info(msgid, P) || P <- Phrases].
%% -> ["btrns", "trns"]
InOldFormat = [begin
[Str, File, Line, Col] = sources_parser:phrase_info([msgid, file, line, col], P),
{Str, {File, Line, Col}}
end || P <- Phrases].
%% -> [{"btrns", {"filename.dtl", 1, 47}}, {"trns", {"filename.dtl", 1, 135}]
compat_phrase() = {string(), {string(), non_neg_integer(), non_neg_integer()}}
field() = msgid | msgid_plural | context | comment | file | line | col
abstract datatype: phrase()
| parse/0 | |
| parse/1 | |
| parse_content/2 | extract phrases from string / binary. |
| parse_file/1 | extract phrases from single file. |
| parse_pattern/1 | list files, using wildcard and extract phrases from them. |
| phrase_info/2 | extract info about phrase. |
| process_content/2 |
parse() -> any()
parse(Pattern) -> any()
parse_content(Path::string(), Content::binary()) -> [phrase()]
extract phrases from string / binary
parse_file(Path) -> any()
extract phrases from single file
parse_pattern(Pattern::[string()]) -> [phrase()]
list files, using wildcard and extract phrases from them
phrase_info(Fields::[field()] | field(), Phrase::phrase()) -> [Info] | Info
Info = non_neg_integer() | string() | undefined
extract info about phrase.
See field() type for list of available info field names.
process_content(Path, Content) -> any()
Generated by EDoc