Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
I have two languages (fr, en). I translate atom action links (Edit, View, Delete) for both languages. I empty caches and display atom library list, titles are well translated. I switch to other language and titles's translation correspond to the other language...
In case of multilingual site, defining the title translation of atom action links in hook_scald_actions leads to this problem. Because result of hook_scald_actions is stored in cache.
I propose to call t() during action links build in scald_atom_user_build_actions_links.
Thanks,
Comment | File | Size | Author |
---|---|---|---|
#6 | scald-2088245-locale-6-test-only-will-fail.patch | 2.55 KB | jcisio |
#6 | scald-2088245-locale-6-all.patch | 5.01 KB | jcisio |
#5 | scald-2088245-locale-5.patch | 2.46 KB | jcisio |
#1 | 2088245_unexpected_atom_action_links_title_translation.patch | 2.37 KB | dDoak |
Comments
Comment #1
dDoak CreditAttribution: dDoak commentedsee attached patch
Comment #2
jcisio CreditAttribution: jcisio commentedComment #3
jcisio CreditAttribution: jcisio commentedAlso I think we might want to add some tests here.
Comment #5
jcisio CreditAttribution: jcisio commentedFailed because patch was created with svn (and against an old version). Reformat patch #1 for git. I'm trying with a test, too.
Comment #6
jcisio CreditAttribution: jcisio commentedThe first patch is test only. It should fail. The second is test + fix, it should (hopefully) pass.
Comment #7
jcisio CreditAttribution: jcisio commentedAlso I think while it is simpler to add langcode into cache key, it makes more sense to use non translated text in the info hook. The drawback is we don't have those strings available at localize.drupal.org. But let's see if tests pass.
Comment #9
jcisio CreditAttribution: jcisio commentedFailed because of trailing new line, I think. It failed locally too, because not every place are replaced with t(). However I figured that the bug is bigger as it affects also context name/description, player name/description etc. So the easiest way is to add langcode into cache key. Committed 5553834 and pushed. Tests pass on local.
Thanks for reporting.
Comment #10
jcisio CreditAttribution: jcisio commentedI should have done a full test before committing it. Two tests in ScaldBaseTest that I didn't run failed. Fixed with 2841703 now.