Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
The "translations" directory is very cool. The way it works is that when you switch on the module, Drupal looks to see if there are any translation files available for languages configured in the database, then it automatically loads them.
By the way, since I was adding some messages to the module I reran the translation extractor and got this error:
The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At t(DISCUSSTHIS_DEFAULT_NODE_MESSAGE) in discussthis.admin.inc on line 54. Read more at http://drupal.org/node/322732
The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At t(DISCUSSTHIS_DEFAULT_NODE_MESSAGE) in discussthis.module on line 649. Read more at http://drupal.org/node/322732
I propose to correct this in the files for which I create a patch. Since this is actually a parameter which will probably be changed anyway rather than a message displayed by the module, I think the simplest solution is not to translate it at all.
I removed the t() for now. I guess the best fix would be to use a function that returns the translated message. On the other hand, you can use the admin settings to translate for your site. The main problem, and that's for all modules, you cannot really have one message per language...
I think to do that you might have to be compatible with i18n module but I have not looked at that for a long time. I have multiple languages, but each language has its own site - otherwise it got too complicated!
You bet! I tried i18n and it was just not for me. Most modules do not implement support and it generates enormous everything (times x for each node, menu item, block...)
Comments
Comment #1
AlexisWilke commentedI added the POT in the translation sub-folder that should be present in the next -dev.
You can post the translations here as they become available. There is also a translation repository on Drupal now... I do not know how that works.
Thank you.
Alexis Wilke
Comment #2
joel_guesclin commentedThe "translations" directory is very cool. The way it works is that when you switch on the module, Drupal looks to see if there are any translation files available for languages configured in the database, then it automatically loads them.
By the way, since I was adding some messages to the module I reran the translation extractor and got this error:
I propose to correct this in the files for which I create a patch. Since this is actually a parameter which will probably be changed anyway rather than a message displayed by the module, I think the simplest solution is not to translate it at all.
Comment #3
AlexisWilke commentedIndeed... Oops 8-)
I removed the t() for now. I guess the best fix would be to use a function that returns the translated message. On the other hand, you can use the admin settings to translate for your site. The main problem, and that's for all modules, you cannot really have one message per language...
Thank you.
Alexis Wilke
Comment #4
joel_guesclin commentedI think to do that you might have to be compatible with i18n module but I have not looked at that for a long time. I have multiple languages, but each language has its own site - otherwise it got too complicated!
Comment #5
AlexisWilke commentedJoel,
You bet! I tried i18n and it was just not for me. Most modules do not implement support and it generates enormous everything (times x for each node, menu item, block...)
Alexis