Searched hist:"1 a25f39dd1d18f916e99909728ff71c0ba821969" (Results 1 – 2 of 2) sorted by relevance
| /plugin/usersettings/ |
| H A D | action.php | 1a25f39dd1d18f916e99909728ff71c0ba821969 Wed Jun 03 10:22:21 UTC 2026 tracker-user <82045103+tracker-user@users.noreply.github.com> Fix per-user language not applying to the JavaScript bundle
js.php runs with NOSESSION, so it has no REMOTE_USER and the JS_SCRIPT_LIST handler (which keyed off REMOTE_USER) could never resolve the user's language -- LANG/LANG.plugins.* always shipped in the site default. The page UI followed the user's choice while all JS strings stayed English.
Carry the language through the js.php <script> URL instead of the session: - TPL_METAHEADER_OUTPUT appends &uslang=<code> to the js.php src during the authenticated page request; this also caches the bundle per language so a stale English bundle is not reused after a switch. - JS_SCRIPT_LIST reads $INPUT->str('uslang') (survives NOSESSION), validates it to a real inc/lang/ dir, switches $conf['lang'], and keeps the datepicker cache-key rewrite. - Capture the pre-override site default so the URL builder can compare against it after applyUserLang has already switched $conf['lang']. - Factor language validation into isValidLangCode(); the param is now user-controllable so it is checked against [a-z0-9-] + an existing dir.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
| H A D | plugin.info.txt | 1a25f39dd1d18f916e99909728ff71c0ba821969 Wed Jun 03 10:22:21 UTC 2026 tracker-user <82045103+tracker-user@users.noreply.github.com> Fix per-user language not applying to the JavaScript bundle
js.php runs with NOSESSION, so it has no REMOTE_USER and the JS_SCRIPT_LIST handler (which keyed off REMOTE_USER) could never resolve the user's language -- LANG/LANG.plugins.* always shipped in the site default. The page UI followed the user's choice while all JS strings stayed English.
Carry the language through the js.php <script> URL instead of the session: - TPL_METAHEADER_OUTPUT appends &uslang=<code> to the js.php src during the authenticated page request; this also caches the bundle per language so a stale English bundle is not reused after a switch. - JS_SCRIPT_LIST reads $INPUT->str('uslang') (survives NOSESSION), validates it to a real inc/lang/ dir, switches $conf['lang'], and keeps the datepicker cache-key rewrite. - Capture the pre-override site default so the URL builder can compare against it after applyUserLang has already switched $conf['lang']. - Factor language validation into isValidLangCode(); the param is now user-controllable so it is checked against [a-z0-9-] + an existing dir.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|