sd-webui-bilingual-localization
sd-webui-bilingual-localization copied to clipboard
Stable Diffusion web UI bilingual localization extensions. SD WebUI双语对照翻译插件
中文文档 / 日本語
sd-webui-bilingual-localization
Stable Diffusion web UI bilingual localization extensions.

Features
- Bilingual translation, no need to worry about how to find the original button.
- Compatible with language pack extensions, no need to re-import.
- Support dynamic translation of title hints.
- Additional support Scoped and RegExp pattern, more flexible translation.
Installation
Choose one of the following methods, Need to use webui with extension support (Versions after 2023)
Method 1
Use the Install from URL provided by webui to install
Click in order Extensions - Install from URL
Then fill in the first text box with https://github.com/journey-ad/sd-webui-bilingual-localization, click the Install button.

After that, switch to the Installed panel and click the Apply and restart UI button.

Method 2
Clone to your extension directory manually.
git clone https://github.com/journey-ad/sd-webui-bilingual-localization extensions/sd-webui-bilingual-localization
Usage
⚠️Important⚠️
Make sure Settings - User interface - Localization is set toNone
In Settings - Bilingual Localization panel, select the localization file you want to enable and click on the Apply settings and Reload UI buttons in turn.

Scoped
Localization supports scoped to prevent global polluting. The syntax rules are as follows:
##<SCOPE ID>##<TEXT>Scoped text will only take effect when the ancestor element ID matches the specified scope.##@<SELECTOR>##<TEXT>Scoped text will only take effect when the ancestor element matches the specified CSS selector.
{
...
"##tab_ti##Normal": "正态", // only the text `Normal` under the element with id="tab_ti" will be translated to `正态`.
"##tab_threedopenpose##Normal": "法线图", // only the text `Normal` under the element with id="tab_threedopenpose" will be translated to `法线图`.
"##@.extra-networks .tab-nav button##Lora": "Lora模型", // only the text `Lora` under the element with class=".extra-networks .tab-nav button" will be translated to `Lora模型`.
...
}
RegExp pattern
Localization support RegExp pattern, syntax rule is @@<REGEXP>, capturing group is $n, doc: String.prototype.replace()
{
...
"@@/^(\\d+) images in this directory, divided into (\\d+) pages$/": "目录中有$1张图片,共$2页",
"@@/^Favorites path from settings: (.*)$/": "设置的收藏夹目录:$1",
...
}
How to get localization file
Localization files are no longer provided with the plugin, please install a third-party language extensions and set-up as described in the Usage section of this article.