module

Rosetta::Translatable

Include this module in any class where you need to translate many keys.

Macros

r(key, default = nil)

Finds the translation for the given key. If the given key starts with a ".", a prefix based on the current class name will be used. Unless a Rosetta::Translatable::Config annotation is defined with a value for prefix, which will then be used instead.

@[Rosetta::Translatable::Config(prefix: "user")] class Person include Rosetta::Translatable

def greeting r(".welcome_message").t # => key resolves to "user.welcome_message" end end

Source

Nested types