Open braindeaf opened 1 year ago
Adapters are responsible for (de)serialization but the keys themselves are routed to files by a Router
There are a couple of built-in routers: https://github.com/glebm/i18n-tasks/tree/main/lib/i18n/tasks/data/router
conservative_router
tries to keep the keys in the files where they were found.\
pattern_router
routes the keys to files based on the a list of patterns.
You may want to write a custom Router that deals with the keys found in .rb
files in some special way, and falls back to your preferred router for other keys.
The router can be configured in i18n-tasks.yml
(https://github.com/glebm/i18n-tasks/tree/a0300907c9b34f2010ba89a8e06d958d8cbd6060#multiple-locale-files).
Hi, I've just realised the project I'm working on uses i18n-tasks and for the most part things are working fine. I have recently added a few things into an
en.rb
file. It's not that exciting.But it does mean that we can do things like
t(".title", namespace: :demo)
without much fuss. However, i18n-tasks doesn't support this out of the box for obvious reasons there are missing translations. We could add an additional adapter for this. But while you can read in the translations. when normalising locales it inserts the keys into the en.yml and with a marhalled Proc object which isn't quite what we're after.Is there a way to get this to work, I'd be happy to do a PR given a little guidance.