Not sure what's going on, but I am experiencing something weird. Add [% SET xxx = t("foo") %] console.log("[% xxx %]"); inside a js include [% MACRO jsinclude BLOCK %] And you will see "Ms", instead of "foo".
Created attachment 160535 [details] [review] Bug 35701: DO NOT PUSH - to recreate the problem Hit http://localhost:8081/cgi-bin/koha/members/memberentry.pl open the console See "Ms", while we expect "foo"
There's a [% FOREACH t ... %] earlier in the same file. It probably overrides the t function.
erk good catch, I searched for "t = "!
Thanks!
Created attachment 160693 [details] [review] Bug 35701: Do not use t To not interfer with the t from I18N On bug 35329 we are using the I18N TT plugin that is providing the 't' subroutine. This loop is redefining the subroutine, therefore it is not longer accessible. Test plan: Edit a patron and confirm the the "Title" dropdown still contain the different values of syspref BorrowersTitles.
There is one [% t | html %] left (under ELSE)
Created attachment 160708 [details] [review] Bug 35701: Do not use t To not interfer with the t from I18N On bug 35329 we are using the I18N TT plugin that is providing the 't' subroutine. This loop is redefining the subroutine, therefore it is not longer accessible. Test plan: Edit a patron and confirm the the "Title" dropdown still contain the different values of syspref BorrowersTitles. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 160709 [details] [review] Bug 35701: (follow-up) Fix last instance of t variable Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Variable scope in template toolkit definitely leaves a lot to be desired. I've bumped into similar issues with MACROs in email templates as well..
Should probably change this bug title although I don't have a good title immediately in mind...
Created attachment 161094 [details] [review] Bug 35701: Do not use t To not interfer with the t from I18N On bug 35329 we are using the I18N TT plugin that is providing the 't' subroutine. This loop is redefining the subroutine, therefore it is not longer accessible. Test plan: Edit a patron and confirm the the "Title" dropdown still contain the different values of syspref BorrowersTitles. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 161095 [details] [review] Bug 35701: (follow-up) Fix last instance of t variable Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Scoping fix, all working now. Passing QA
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.03
Backported to 23.05.x for upcoming 23.05.09