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();
CommentFileSizeAuthor
glossary_translation.patch501 bytessuit4

Comments

nancydru’s picture

Status: Needs review » Needs work

You 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.

Translations are ment to be dynamically implemented.

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.

suit4’s picture

This 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

$output .= t(variable_get('glossary_alphabar_instruction', _alphabar_instruction_default()));

would do both our jobs without bypassing the text entered by the admin.

nancydru’s picture

That 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.

nancydru’s picture

Status: Needs work » Postponed (maintainer needs more info)

Any other suggestions? Does i18n provide anything?

udig’s picture

Wondering 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.

nancydru’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)