1

I've got a TwitterBlock on my website. It works fine but all texts are in english. Even if I change t('') function with my language (french) desired, it's still in english.

ex:ln422 twitter_block.module

'#title' => t('Tweets by @username', array('@username' => $config['username'])),

to

'#title' => 'Tweets par @me',

It still display 'Tweets by @username' in my page. The language input seems to be ignored to in admin/structure/block/manage/twitter_block/1 when I wrote 'fr' in it.

I hope that my problem is a minor oversight on my part. All tips are good (even the simplest).

Thanks in advance.

PS: when I try to do a dsm($block) in twitter_block.module or dsm($content) in my override block I get all my values in french.

0
  1. Do you have French language on you site?
  2. You should not change code of contrib modules. You can override, extend it in your custom module.
  3. If you have fr language on site , back t() with EN labels, go to admin/config/regional/translate/translate try to search EN labels and translate them.

Another way to get translations, use module l10n_update, it can get translation if they available on Localization servers.

  • 1. yes I have. 2. I know but it's to show how strange is my prob. 3. I translated them from your URL but nothing change. I tried l10n_update, there are missing translations for 2 projects but not TwitterBlock... :/ – guish Mar 24 '16 at 20:06
  • ok, you translated strings, did you switch to French version of the site? clear cache? – smile Mar 24 '16 at 21:00
  • Yes, default language is French and cache has been clear. New fact, when I reload page, I just see the sentence "Tweets par @username" as a link but nothing else, and after, my block appears and is display in english. – guish Mar 24 '16 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.