Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
['r4032login_display_denied_message'] default_value not translatable
Comment | File | Size | Author |
---|---|---|---|
#10 | i18n_r4032login-1138562-10.patch | 943 bytes | mgifford |
#9 | i18n_r4032login-1138562-2.patch | 942 bytes | dshields |
#7 | i18n_r4032login-1138562.patch | 870 bytes | dshields |
#1 | [1138562]-[1].patch | 1.43 KB | Thomas_Zahreddin |
Comments
Comment #1
Thomas_Zahreddin CreditAttribution: Thomas_Zahreddin commentedhere's the patch
Comment #2
lotyrin CreditAttribution: lotyrin commentedThis doesn't make any more sense than these variables do already. Such a strategy would only work with a single site language.
What needs to happen here is either:
Document that if these strings are to be translated, the user needs to have i18n's variable translation working, and ensure that r4032login supports it's variables to be translated by i18n.
OR make these strings static and the user uses normal string translation UI to translate (or override) these strings.
I lean toward the latter, but the former is closer to what we're already doing, so I'll look into making sure that it works.
Comment #3
Thomas_Zahreddin CreditAttribution: Thomas_Zahreddin commentedi don't understand what is wrong to have the default string translateable.
if the default string is not changed, then it can be translated for each language the site uses, with no additional modules.
In the moment only one language is possible for the strings, since the variable can store only one value and is not passed throug t().
And using the default value with the default translation also saves one extra configuration step.
Comment #4
lotyrin CreditAttribution: lotyrin commentedI guess I hadn't thought that through.
I've just committed adding t() to these. Integration with i18n_variable remains open.
Comment #5
f0ns CreditAttribution: f0ns commentedDid not integrate this with i18n variable, I just made the config form hidden under website information and changed this in function r4032login_redirect():
Now I can easily translate the error message with translate interface.
Comment #6
NWOM CreditAttribution: NWOM commentedHas there been any work done on this for Drupal 7? Thanks in advanced.
Comment #7
dshields CreditAttribution: dshields commentedThis patch seems to get the job done. Save your string in Site Information, visit a page as an anonymous user that you should not have access to, then add the translation via the translate interface.
Comment #8
mgifford@dshields - Thanks! This will definitely work.
Would be better though to go with the i18n_string() approach defined in this blog post. I think this would look like:
But I haven't actually done this yet.
Comment #9
dshields CreditAttribution: dshields commentedThanks for the tip, mgifford and mparker17 for the blog post. How does this look?
Comment #10
mgiffordThat patch was failing here:
http://simplytest.me/project/r4032login/7.x-1.8?patch[]=https://www.drup...
I applied it against the git repo and got "patch unexpectedly ends in middle of line" so just rerolled it. It works here:
http://simplytest.me/project/r4032login/7.x-1.8?patch[]=https://www.drup...
Comment #11
mgiffordI see Site name & Slogan as clearly "This is a multilingual variable." but not for the User login 'access denied' message here:
/admin/config/system/site-information%3Fvariable_realm_key_language%3Daf
I applied the patch, set up the i18n & Variable modules. Not sure what the problem is.
Do I need to set up anything else to enable this?
Comment #12
mgiffordThis looks like it is working.
Comment #13
lotyrin CreditAttribution: lotyrin commentedNo, integration with i18n_string isn't what we want here. The default value is a UI string, should be translated with t(). The variable is a variable, so we'll make it translate as via i18n_variable.
Comment #14
lotyrin CreditAttribution: lotyrin commentedJust verified but, this already works. Has for a long time.
Here's the howto: https://www.drupal.org/node/1113374
Comment #15
dshields CreditAttribution: dshields commentedWhile I see that i18_string translation is not the approach we're going for here, i do not see how "this already works"