Using I18n sidecar assets outside the component #1648
Unanswered
coorasse
asked this question in
Show and tell
Replies: 1 comment 6 replies
-
@coorasse I'm not sure if this is exactly what would work, but perhaps we could do something like |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently refactored my ViewComponents to use sidecar YML files for translations.
This helped us keep our components more organised and tidy, without polluting the main YML file.
The main issue we faced was in system tests. Our system tests need to use such translations to "click_on" stuff.
Our code looked like:
Now that
button_text
is defined within a sidecar YML file, this is not possible anymore.We wrote a small function to add these translations when needed:
we can now execute
load_component_translations('my_component')
and we have the key we are looking for.Is this a great idea or we are just missing something?
Beta Was this translation helpful? Give feedback.
All reactions