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,

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dDoak’s picture

jcisio’s picture

Status: Active » Needs review
jcisio’s picture

Also I think we might want to add some tests here.

Status: Needs review » Needs work

The last submitted patch, 2088245_unexpected_atom_action_links_title_translation.patch, failed testing.

jcisio’s picture

Status: Needs work » Needs review
FileSize
2.46 KB

Failed because patch was created with svn (and against an old version). Reformat patch #1 for git. I'm trying with a test, too.

jcisio’s picture

The first patch is test only. It should fail. The second is test + fix, it should (hopefully) pass.

jcisio’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

Also 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.

Status: Needs review » Needs work

The last submitted patch, scald-2088245-locale-6-all.patch, failed testing.

jcisio’s picture

Title: Unexpected atom action links's title translation » Unexpected action/context/player/... translation
Status: Needs work » Fixed

Failed 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.

jcisio’s picture

I should have done a full test before committing it. Two tests in ScaldBaseTest that I didn't run failed. Fixed with 2841703 now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.