virolea / rosetta

Unobstrusive Internationalization solution for Rails applications.
MIT License
53 stars 1 forks source link

Context API #6

Open virolea opened 3 weeks ago

virolea commented 3 weeks ago

Words can mean different things depending on their context.

For instance, file can both be a noun and a verb in english. However they translate differently in French:

I can see an API loooking like:

Rosetta.translate("File", locale: :fr, context: "Verb")
# =>  Classer

And having a dedicated key linked to the main translation key.