Problem/Motivation
View more link in recipe cards is not fully translated. The bundle is always in English because we are using the bundle machine name.
Proposed resolution
Use the type label() for rendering the translated type name.
Remaining tasks
Patch
User interface changes
None (in English), but will make this translatable.
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 2999908-view-more-bundle-translatable-13.patch | 1.36 KB | penyaskito |
Comments
Comment #2
penyaskitoChanged twig templates for taking the translated bundle name.
Comment #3
penyaskitoScreenshots
Before:
After:
Comment #4
markconroy commentedThis is a very clever and simple patch. Thanks so much for taking the time to make Out of the Box even better @penyaskito.
Tested with default language (English) and also Irish. Marking as RTBC.
Comment #5
mpp commentedIndeed RTBC.
Comment #6
lauriiiDo you think it would make sense to add test coverage for this type of bugs?
Comment #7
mpp commented@lauriii, there should already be a test that checks if
label()returns the proper translation.Adding tests to see whether all strings used in templates are translated or not doesn't seem to make sense to me (we'd have to add thousands of tests).
Comment #8
borisson_I agree with this.
Comment #10
penyaskitoThat was a testbot failure.
Comment #11
lauriiiThe label should be rendered through a placeholder in the translation string to make sure we are compatible with all languages.
Comment #12
gábor hojtsyAgreed. Some languages need the verb and the label swapped in order which is not possible this way.
Comment #13
penyaskitoFixed with {% trans %}.
Comment #14
webflo commentedLooks great, i wrote the exact same patch a few minutes ago. I should have searched the issue first. @penyaskito++
Comment #16
lauriiiCommitted 24773d8 and pushed to 8.7.x. Also cherry-picked to 8.6.x. Thanks!
Comment #18
penyaskitoThanks! Tagging for tracking.