New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation for schema keys #52
Comments
I was also wondering whether there was a good way to do this. I have monkey patched myself a solution for now, but would rather have a supported solution if possible. |
@cmcolinh would you share that? this is mind-boggling. |
Monkey patch this in (I put in in config/initializers/)
Where AppDef was written in YAML with an example of
I see no reason why the i18n file could'nt be used instead.
It's customized for my specific needs of course(to create newline delimited errors that I can raise as is, it's also flattening the error keys as well, which you may not want), but you can probably change this to fit your needs as well. |
this will get me going. thank you.
|
I'm also interested in this. Any inbuild solution to that? |
i was poking around the code yesterday and tonme it looks like there‘s supposed to be built-in support for that. but the kay path lookup fails for the i18n adapter.
i‘ll try have a look at the test suite and wether i can put sth together.
|
* Use `rule_lookup_path` and move rule name translations to the root. Otherwise it would be in conflict with predicate names * Fix handling of `locale` in YAML and I18n when fetching rule name Closes #52
Maybe this is a dumb question but I really didn't find it anywhere in the documentation.
How can I translate a Schema field name? Example:
When I want the full messages i got the message translated correctly, but not the field name.
age obrigatório(a)
. I didn't find the translation key for 'age', which should be 'idade' of the translated name.Maybe the yml file should have something like this?
Sorry about my english. To be clearer I want to know the translation key to be able to translate the Schema fields. If I have
required(:name).filled
I want to setup my i18n yml file to have 'name' translated in the full messages validations.Thanks for everything and congratulations for the excelent lib! 👍
The text was updated successfully, but these errors were encountered: