Active
Project:
Buddylist
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Apr 2008 at 08:44 UTC
Updated:
23 Apr 2008 at 08:44 UTC
In Buddylist there is a set of constants
define('BUDDYLIST_ADD_SUBJECT', variable_get('buddylist_add_subject', "[%site] You are %adder_name's newest buddy"));
define('BUDDYLIST_REMOVE_SUBJECT', variable_get('buddylist_remove_subject', "[%site] You have been removed from %adder_name's buddy list"));
define('BUDDYLIST_REQUEST_SUBJECT', variable_get('buddylist_request_subject', "[%site] %adder_name has requested to add you to his/her %buddy list"));
define('BUDDYLIST_APPROVAL_SUBJECT', variable_get('buddylist_approval_subject', "[%site] %addee_name has approved your %buddy list add request"));
Why are these set? While all other code is consistent these four constants standout. It is totally unecessary.
When constants are set they and immutable and cannot be changed at runtime. So what is the result? Well, i18n is runtime active and so cannot see variable_get() which is contained in the constant contruct. Thus they become non-translatable at runtime. This can be tested by setting two languages, setting the i18n array in setting.php and then trying to create translations for the content of the four variable_get() calls. They sit at the first language defined.