您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically redirects URLs to their preferred language equivalents
Automatically redirects URLs to their preferred language equivalents.
LANGUAGE_CONFIG
object/es/
→ /ca/
)es.site.com
→ ca.site.com
)/page
→ /ca/page
)site.com
→ ca.site.com
)?lang=ca
, ?hl=ca
)Edit the LANGUAGE_CONFIG
object to set your preferred languages:
const LANGUAGE_CONFIG = {
targetLang: "ca", // Primary target language (ISO code)
altLang: "va" // Alternative target language (optional)
};
With default Catalan configuration:
Original: https://example.com/es/products
Redirected to: https://example.com/ca/products
Original: https://en.wikipedia.org/wiki/Barcelona
Redirected to: https://ca.wikipedia.org/wiki/Barcelona
For other languages, just change the configuration:
// French configuration
const LANGUAGE_CONFIG = {
targetLang: "fr",
altLang: null
};
AGPL-3.0-or-later License