Closed (fixed)
Project:
Internationalization
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2009 at 15:24 UTC
Updated:
25 Sep 2009 at 12:19 UTC
Since I maintain a bunch of modules with a lot of variables that need to be translated, I figured it would be a good idea to set $conf['i18n_variables'] in hook_init() instead of making all of my users put them in their settings.php every time.
However, if i18n_variable_init() can't find a value for a variable, it sets it to the empty string. This isn't good for variables that have non-empty defaults, especially when those defaults are translated with t(). Certainly, the defaults of all these variables should be translated with t().
Patch uses NULL instead of '' when variables are not set yet. This lets variable_get() use the default like it's supposed to.
| Comment | File | Size | Author |
|---|---|---|---|
| unset_variables.patch | 576 bytes | Island Usurper |
Comments
Comment #1
jose reyero commentedLooks good, committed, thanks
Comment #3
Island Usurper commentedI hate to ask, but when do you think you'll make a 1.2 release? I'm kind of waiting on that before I put all of the code into hook_init() for my modules. I'm just worried that most people won't get the dev version of i18n and then find that they can't see a bunch strings in English.
Comment #4
wimh commentedThis issue is giving problems in the latest Ubercart (6.x-2.0-rc7, see #587750: Address field labels empty since rc7). I think a release with this patch would please a lot of people... ;-)