3

Drupal is written in English. We have created some custom modules where the strings in the module are written in French. These are passed through the t() so can be translated.

I am a little confused how I can show my site in both French and English when the default site language English is in both language. Please could you point me in the correct direction?

2

When you pass string through t() without specifying a langcode, then it will default back to English. So, if string is a French word, it will be handled as an English word.

Two options:

  • It's probably worth saying that the implication of this is that every call to t() in the custom modules needs to be recoded to change the text string to English. Once that's done you can create a fr.po file for the module, with trasnslations for all the strings into French. – Alfred Armstrong Oct 31 '13 at 14:35
0

I'm not sure from your question whether you have successfully got your site working in both English & French, just in case, have you reviewed everything at https://localize.drupal.org/translate/languages/fr

It is normal practice that if you're writing custom modules which will be used across multiple languages, the strings in the module are written in English, as you point out that Drupal is written in English, then provide a translation using po files

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.