Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Following the Ubercart multilingual-variables for user inputs (like the "Add to Chart" button text) this feature should be also in Userpoints
Simply add this function into userpoints.module :)
/**
* Implements hook_init().
*/
function userpoints_init() {
global $conf;
$conf['i18n_variables'][] = USERPOINTS_TRANS_UCPOINTS;
$conf['i18n_variables'][] = USERPOINTS_TRANS_LCPOINTS;
$conf['i18n_variables'][] = USERPOINTS_TRANS_UCPOINT;
$conf['i18n_variables'][] = USERPOINTS_TRANS_LCPOINT;
$conf['i18n_variables'][] = USERPOINTS_TRANS_UNCAT;
}
Comment | File | Size | Author |
---|---|---|---|
#10 | userpoints-mutilingual-variable-for-branding-1270768-9.patch | 2.09 KB | akalam |
#9 | userpoints-mutilingual-variable-for-branding-1270768-9.patch | 2.27 KB | akalam |
Comments
Comment #1
funature CreditAttribution: funature commentedthe words still can not be translated.
Comment #2
funature CreditAttribution: funature commentedi have the same problem, i just see the string like !Points in translation UI, after a look at the code, i noticed that, the value of userpoints_translation function can not be sent to the string, like the title of a menu item.
@kbahey you use the 'title arguments' to insert the value, it seem not working. i see you also use the strtr function, so i made a little change, it works for now. I hope you can find a better way, i'm not a coder anyway.
Comment #3
funature CreditAttribution: funature commentedi must say, what i did is useless. i hope someone to solve this issue.
ps. the menu item can not be translated also.
Comment #4
Berdirhook_menu() is correct as it is, there's no need nor point in changing that, it doesn't help.
Instead, what's necessary for 6.x is the code in the initial post and for 7.x-1.x, hook_variable_info() needs to be implemented, see http://api.worldempire.ch/api/simplenews/simplenews.module/function/simp... for an example.
Comment #5
BerdirComment #6
funature CreditAttribution: funature commentedany improve yet?
Comment #7
joelrosen CreditAttribution: joelrosen commentedSo... how can I translate points branding into other languages? It is possible, right?
Comment #8
joelrosen CreditAttribution: joelrosen commentedIt seems this project is not being well maintained as of late, so I won't bother with a patch. Here is the code I added in my custom module to work around this:
Then go to Configuration > Multilingual settings > Variables and enable translation.
Comment #9
akalam CreditAttribution: akalam at Atenea tech commentedThanks for the aproach, joelrosen. Patch attached!
Comment #10
akalam CreditAttribution: akalam at Atenea tech commentedThis Patch y better
Comment #11
quotesBro CreditAttribution: quotesBro commented