PointClickEngine::Localization::LocalizationManager
Inherits YAML::Serializable < Reference < Object
Manages translations and localization
Constructors
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Sourcenew(current_locale : Locale = Locale::En_US, fallback_locale : Locale = Locale::En_US)
Sourcenew(event_bus : Core::Events::EventBus, current_locale : Locale = Locale::En_US, fallback_locale : Locale = Locale::En_US)
Sourcenew(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
SourceInstance methods
add_plural_translation(key : String, locale : Locale, forms : Hash(String, String))
Add plural forms programmatically
add_translation(key : String, locale : Locale, value : String)
Add a single translation programmatically
current_locale
Sourcecurrent_locale=(current_locale : Locale)
Sourceevent_bus
Sourceevent_bus=(event_bus : Core::Events::EventBus | Nil)
Sourcefallback_locale
Sourcefallback_locale=(fallback_locale : Locale)
Sourcetranslations
Sourcetranslations=(translations : Hash(String, Translation))
Source