I18n – Automatic lookup of translations without translation_key #4187
Timmitry
started this conversation in
Feature requests
Replies: 1 comment
-
|
This makes sense. I wonder if there are any use cases where this behavior is not desired. Each field should check whether |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When building an
Avo::BaseResourceand defining fields, I need to specify thetranslation_keyfor each field individually, e.g.:This is tedious and feels unneccessary, especially since Rails is very good at doing this automatically (e.g. when building a form, I just use
form.label :street, and it will infer the correct translation).Would it be possible to add an automatic lookup of translation for attributes? Translations for attributes can be looked up with
Location.human_attribute_name(:street). This will look in various places, for exampleattributes.streetandactiverecord.attributes.location.street.It could be neccessary to specify the activerecord model that is described (Location in this example) in the avo resource for that.
Beta Was this translation helpful? Give feedback.
All reactions