[Bug] script names in the script-list do not match the local configuration language
I have the English version, but the script languages are still in their original language; it would be good if they were changed to the local language. Of course, the scripts I have installed have the title in English within the code.
Can you please specify the browser & version, and ScriptCat version for our references? Thanks.
WebLibre Alpha 0.20 Scriptcat Stable Version 0.16.15
@CodFrm any idea for this bug?
I cannot reproduce this in Helium. Might be only for mobile?
Thanks for the details.
Could you please confirm whether the affected script has localized metadata like this?
// @name Original name
// @name:en English name
Also, please confirm that ScriptCat Options → Settings → Language is set to English.
If ScriptCat is set to English, the script has @name:en, and the script list still shows the default @name, then this matches the fallback issue we are checking.
@cyfung1031 This might be MV2-specific. On main, i18nName() already falls back from the exact locale key to the language-only key:
export function i18nName(script: { name: string; metadata: SCMetadata }) {
const lang = i18nLang();
let m = script.metadata[`name:${lang}`];
if (!m) {
// Try matching only the language prefix.
const langPrefix = lang.split("-")[0];
m = script.metadata[`name:${langPrefix}`];
}
return m ? m[0] : script.name;
}
But MV2 currently seems to check only the exact locale key:
export function i18nName(script: { name: string; metadata: SCMetadata }) {
const m = script.metadata[`name:${i18n.language.toLowerCase()}`];
return m ? m[0] : script.name;
}
So scripts with only @name:en may still show the default @name on MV2 when the UI language is en-US.
Ah yeah. the version is 0.16.15. I always mix up.
@RENBOWS Firefox MV3 version is published. Please update Firefox to latest version and install the extension.
https://addons.mozilla.org/firefox/addon/scriptcat-pre/