[drupal-devel] [feature] i18n - Support for language-dependent variables

chx drupal-devel at drupal.org
Fri Jul 22 17:51:17 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     feature requests
 Priority:     normal
 Assigned to:  Jose A Reyero
 Reported by:  Jose A Reyero
 Updated by:   chx
 Status:       patch
 Attachment:   http://drupal.org/files/issues/i18n_lang_vars.patch (883 bytes)

Well, the patches have not made it for 4.6, let's see what we can do for
4.7. To begin with, I reroll the patches.


Previous comments:

Mon, 24 Jan 2005 00:48:48 +0000 : Jose A Reyero

Attachment: http://drupal.org/files/issues/i18n_language_variables_01.patch (1.16 KB)

This is a simple patch for bootstrap.inc, which adds a function call for
all the variable functions (variable_get, variable_set, variable_del).

This adds support for language-dependent variables, and does nothing
when i18n.module is disabled.

The idea is to add a language prefix to the variable name, depending on
current language, thus allowing to easily translate some variables to
different languages.


Mon, 24 Jan 2005 06:13:58 +0000 : chx

So simple, so useful. For example theme settings can be an i18n
variable, thus your name, mission etc can be international without any
more code.


Mon, 24 Jan 2005 19:46:28 +0000 : chx

Attachment: http://drupal.org/files/issues/i18n_language_variables.patch (975 bytes)

Following moshe's advice from http://drupal.org/node/16069 here is
another, more readable version.


Mon, 24 Jan 2005 19:54:22 +0000 : chx

Attachment: http://drupal.org/files/issues/i18n_language_variables_0.patch (1.07 KB)

:( Wrong file.


Mon, 24 Jan 2005 22:27:13 +0000 : chx

Forget these and stick to jose's patches. module_invoke is not available
at this point...


Sun, 30 Jan 2005 13:56:34 +0000 : Steven

Not all variables contain text and not all of them should be possible to
change randomly. This whole approach to internationalisation seems a bit
backwards to me: there will always be tables with text that you haven't
translated. Shouldn't we be doing this at the string level? That's the
only thing that should be changed, no?


Sun, 30 Jan 2005 14:03:20 +0000 : Goba

Steven, doing it on the string level is not possible without heavy
Drupal patching. Doing it on the variable level would open up some
doors at least. It would not enable menu translation for example, but
it would enable a lot of stuff to be translated. With a horrible UI by
the way, where you would need to swicth the complete UI language to
translate the user registration mail or the story submission guidelines
to another language... It might not be the best way to go, but it is the
only way to advance right now, or the i18n effort will get stuck until
4.7 comes around.


Sun, 30 Jan 2005 14:43:42 +0000 : Jose A Reyero

The variables to be translated are to be defined in the config file, but
a list of variables 'worth being translated' will be included in i18n
documentation.  Though maybe this is not an optimal approach from the
db point of view -language is stored in the variable name itself-, I
think it is the better one when you balance
functionality/flexibility/patching required.

About the interface, I agree with Goba. But this patch is only about
core support, a specific interface may be added later as a part of i18n


Fri, 04 Feb 2005 06:31:40 +0000 : Anonymous

Attachment: http://drupal.org/files/issues/i18n_language_variables_1.patch (861 bytes)

Update to HEAD


Fri, 04 Feb 2005 06:33:10 +0000 : chx

former post is mine (chx)

More information about the drupal-devel mailing list