Due to the way, the alphabar instructions are implemented, they will never translate in localisation mode.
Currently, line 579 in glossary.module reads
$output .= variable_get('glossary_alphabar_instruction', _alphabar_instruction_default());
As far as the alphabar instruction is not translated when installing the module, the gloabl variable 'glossary_alphabar_instruction' is filled with the default english value.
Translations are ment to be dynamically implemented. Pushing the translation into the global variables makes this value static.
Due to the functionality of variable_get(), a value is returned from the global variables, if it is already set. As it *is* already filled with the default value, there is no way to get the translated value ....
... except using my patch, which makes line 579 read
$output .= _alphabar_instruction_default();
| Comment | File | Size | Author |
|---|---|---|---|
| glossary_translation.patch | 501 bytes | suit4 |
Comments
Comment #1
nancydruYou can set whatever you want on the settings page - and it can be any language. You are correct that this value will not be translated after it is entered.
I suppose this is a matter of semantics. The "t()" function will only translate a string that was defined in the translation template. I would not consider this to be dynamic.
Your patch bypasses the text as entered by the admin. I cannot apply that as this feature was requested by another user some time ago.
Comment #2
suit4 commentedThis indeed seems to be a matter of semantics.
In my case, the Glossary module is used on a multilingual page, so I have to consider that value as dynamic.
So, maybe something like
would do both our jobs without bypassing the text entered by the admin.
Comment #3
nancydruThat would be considered an incorrect use of t(). It has to be something like
t('a !type to translate', array('!type' => $type)). And even with that whatever the value of "$type" is will not be translated.Comment #4
nancydruAny other suggestions? Does i18n provide anything?
Comment #5
udig commentedWondering if someone found an elegant solution to this issue. Actually in my case it's the 'glossary_alphabet' variable but functionally it's the same thing.
Comment #6
nancydru