struct Gettext::POBackend
- Gettext::POBackend
- Gettext::Backend
- Struct
- Value
- Object
Overview
The backend for Gettext's PO files. This class contains methods to parse and interact with them.
Defined in:
backend/gettext/po/backend.crConstructors
-
.new(locale_directory_path : String)
Create a new PO backend instance that reads from the given locale directory path
Instance Method Summary
-
#create : Hash(String, Catalogue)
Create message catalogue from the loaded locale files
-
#parse : Hash(String, Catalogue)
Parse tokens into message catalogues
Instance methods inherited from struct Gettext::Backend
parse
parse
Constructor methods inherited from struct Gettext::Backend
new
new
Constructor Detail
Create a new PO backend instance that reads from the given locale directory path
Gettext::POBackend.new("locales")
Instance Method Detail
Create message catalogue from the loaded locale files
This is returned as a mapping of the language code to the catalogue
in which the language code is taken from the Language
header. If
none can be found then the po file name is used as a fallback.
As of v0.2 this is equivalent to #parse
backend = Gettext::POBackend.new("locales")
backend.create # => Hash(String, Catalogue)
Parse tokens into message catalogues
This is returned as a mapping of the language code to the catalogue
in which the language code is taken from the Language
header. If
none can be found then the po file name is used as a fallback.
backend = Gettext::POBackend.new("locales")
backend.parse # => Hash(String, Catalogue)