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.
It would be very nice to have a possibility to set the custom button label on the pop-up window asking whether the user would like to continue his/her session.
By default it's Yes/No, and it is becoming an issue when localizing.
right now i didn't find any better way that just hard code the new values.
Comments
Comment #1
turtletrail CreditAttribution: turtletrail commentedlikewise the pop-up title name
Comment #2
joekersIt would be nice to have this functionality, but for now you can use hook_js_alter to implement your own code without touching the module code.
Comment #3
johnennew CreditAttribution: johnennew commentedMessage and title are already translatable arn't they (?)
Translations for the Yes and No buttons were added to 7.x-4.x on: http://drupal.org/node/1979550
Marking as a duplicate and closing - reopen if you think it needs to be.
Comment #4
Teastwood CreditAttribution: Teastwood commentedHello,
It seems that "title" is ok, but "message" is not translatable this way.
When calling
@msg is replaced by "my message in English", but without being translated, whatever the current language is.
But on the documentation page for function t(), they say "You should never use t() to translate variables, such as calling
t($text);".
So I guess the right way would be to declare the "message" variable in hook_variable_info() (module: Variable) :
and to replace the previous
by
which will automatically return the translated value for the variable, if i18n_variable (module: Variable translation from the Internationalization package) is enabled and if "autologout_message" is set to be translatable in i18n_variable configuration.
Does this seem ok?
Comment #5
johnennew CreditAttribution: johnennew commentedHi @Leela,
Thanks for your comment. I had a look at the docs you linked to and I think you are right. I thought I might have to add a dependency on variable module but looks like its optional so this is great.
Comment #6
johnennew CreditAttribution: johnennew commentedDev branch is doing this right now which also solves the problem, though not necessarily the right way to do it ...
https://www.drupal.org/node/2088169
Not sure we should change it now.
Comment #7
DeaOm CreditAttribution: DeaOm at Agiledrop - Your Trusted Drupal Teammates commented