struct Gettext::PoParser

Defined in:

gettext.cr

Constant Summary

GETTEXT_BNF = ":start ::= entries\nentries ::= entry*\n\nentry ::= comments msgctxt msgids msgstrs action => on_message\ncomments ::= comment*\n\ncomment ::= <translator comment>\n| <extracted comment>\n| reference\n| flag\n| <previous untranslated string>\n| <obselete message>\n\n<extracted comment> ~ /#\\.[^\\n]*/\nreference ~ /#:[^\\n]*/\nflag ~ /#,[^\\n]*/\n<previous untranslated string> ~ /#\\|[^\\n]*/\n<obselete message> ~ /#~[^\\n]*/\n<translator comment> ~ /#[^\\n]*/\n\nmsgctxt ::= 'msgctxt' strings\nmsgctxt ::=\nmsgids ::= msgid msgid_plural\nmsgid ::= 'msgid' strings\nmsgid_plural ::= 'msgid_plural' strings\nmsgid_plural ::=\nmsgstrs ::= msgstr+\nmsgstr ::= 'msgstr' optional_index strings\noptional_index ::= '[' number ']' action => process_index\noptional_index ::=\n\nstrings ::= string+ action => combine_string\nstring ::= /\"([^\"\\\\]|(\\\\[\\d\\D]))*\"/ action => process_string\nnumber ~ [\\d]+\n\n:discard ~ whitespace\nwhitespace ~ [\\s]+"

Constructors

Instance Method Summary

Instance methods inherited from struct Gettext::Locale

catalog : Hash(Msg, String) catalog, catalog=(catalog : Hash(Msg, String)) catalog=, gettext(message) gettext, metadata : Hash(String, String) metadata, metadata=(metadata : Hash(String, String)) metadata=, ngettext(singular : String, n : Int32) : String
ngettext(singular : String, plural : String | Nil = nil, n : Int32 = 1) : String
ngettext
, plural : Proc(Int32, Int32) plural, plural=(plural : Proc(Int32, Int32)) plural=

Constructor methods inherited from struct Gettext::Locale

new new

Constructor Detail

def self.new(io : IO) #

[View source]
def self.new(string : String) #

[View source]

Instance Method Detail

def parse(string, actions = PoActions.new) #

[View source]