Problem/Motivation

#1273200: Day of the week and month not translated allows the day of the week and month names within Agenda blocks to be translatable. On multilingual sites, however, the block's information will be cached with whatever language the user is visiting. A user then visiting the same block in another language could be served the wrong language.

Steps to reproduce:

  1. Install Drupal 7 with Agenda 7.x-2.x and Internationalization (i18n) installed and enabled.
  2. Navigate to admin/config/regional/language and add a language (ex. Spanish).
  3. Navigate to admin/config/regional/language/configure and enable URL detection.
  4. Navigate to admin/config/regional/translate/translate and translate the name of a day or month that will appear in your block.
  5. Visit a page with an agenda block under the URL of one language (ex. en/*). Use the contextual link to clear that block's cache. You should now see the translation from the above step in that block's content.
  6. Visit a page with an agenda block under the URL of a second language (ex. es/*). You'll see the block's contents in the first language.

The result of #6 isn't right. Clear that block's cache and it'll now be in the right language, but when you return to the first language, it's still the second.

This is because the entire block contents are cached, post-translation.

Proposed resolution

The best approach would probably be to cache the Google response data before the block is rendered rather than the rendered block.

Remaining tasks

Create a patch for the proposed resolution (or another approach), review, test, commit.