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.
Hello,
is there already a way to translate the body and subject text? I looked into it but it seems that the module is not implementing hook_variable_info() to use variable translation.
Does the module use a differen translation method or could translation be integrated?
Thank you!
Comments
Comment #1
Rechi CreditAttribution: Rechi commentedI made a dirty fix to implement variable_info(), you have to use the variable admin module to set the body and subject text. I hope this may be a start for someone with more experience.
Comment #2
ptmkenny CreditAttribution: ptmkenny commentedComment #3
GiorgosKit would be great to implement this
Comment #4
sysosmaster CreditAttribution: sysosmaster at 040lab commentedPrevious patch was not working, I rewrote a patch that utilizes the i18n_variable and retrieves this when the module is active.
Comment #5
sysosmaster CreditAttribution: sysosmaster at 040lab commentedre factored patch to no longer use custom code but make use of the i18n_variable and the variable_info hook.
To enable the new i18n variable after patching go to /admin/config/regional/i18n/variable and enable them in the 'Other' tab.
Comment #6
sysosmaster CreditAttribution: sysosmaster at 040lab commentedFixed: sending the one time login mail in the user preferred language.
Comment #7
florisg CreditAttribution: florisg as a volunteer commentedVerified that patch #6 works.
Also against 7.x-2.9 of login_one_time
Be sure to clear cache.
Then go to /admin/config/regional/i18n/variable and enable translation under the 'Other' tab
Now you can translate under /admin/config/people/accounts. (note the 'This is a multilingual variable.' label under the fields
Finally one time login messages are in the user's preferred language :)
Comment #9
Maedi CreditAttribution: Maedi commentedA patch becomes a feature, thanks. Reopen if any issues.
Comment #11
AgentJay CreditAttribution: AgentJay commentedThis isn't working for me, I'm getting this error:
Trying to get property of non-object in login_one_time_mail_text() (line 630 of /srv/www/biopama/sites/all/modules/login_one_time/login_one_time.module)
Comment #12
AgentJay CreditAttribution: AgentJay commentedComment #13
sysosmaster CreditAttribution: sysosmaster at 040lab commented@Agentjay Just posting "this does not work" does not qualify as a useful comment.
Please Supply a proper Bug report if you expect any sort of assistance.
Things to check for:
And to further deepen your reply, consider making a NEW issue instead of reopening one from 8 months ago.
Comment #14
xelat CreditAttribution: xelat as a volunteer commented@Agentjay and @sysosmaster, I can replicate this with 2.10 (line 630) and dev (line 646).
In the first line above, the
$language
is just a string and does not have the 'language' property and thus generating the warning.Comment #15
sysosmaster CreditAttribution: sysosmaster at 040lab commentedcode Snippet (bigger to see what is going on);
Line 1~596
Line 644
So if you use an i18n Replacement all works as intended. If you have a Admin setting set it works as intended. but if you trust the default it can work diffrently. (the test for object shouuld be included there again)