Project Overview: sd-webui-bilingual-localization
The "sd-webui-bilingual-localization" project serves as a bilingual localization extension for the Stable Diffusion web UI. This extension focuses on providing translation capabilities to enhance user experience by bridging language barriers within the application's interface.
Features
The extension boasts several notable features that make it highly useful for users who prefer bilingual interfaces:
- Bilingual Translation: Users can seamlessly translate the UI into two languages, making it easier to understand and use various functions without struggling to find the original button or feature they need.
- Language Pack Compatibility: There is no need to re-import existing language packs when using this extension, ensuring a smooth transition for users already utilizing language extensions.
- Dynamic Translation of Title Hints: It dynamically translates title hints, offering instant understanding of UI elements.
- Scoped and RegExp Pattern Support: These features provide flexible translation options, allowing specific and pattern-based translations for more precise language customization.
Installation
The installation of this extension is straightforward, with two main methods for setup:
Method 1: Install from URL
- Navigate to the Extensions section of the Stable Diffusion web UI.
- Select Install from URL.
- Enter the following URL into the text box:
https://github.com/journey-ad/sd-webui-bilingual-localization
. - Click the Install button.
- Once installed, switch to the Installed panel and hit the Apply and restart UI button to activate the changes.
Method 2: Manual Cloning
For those who prefer a manual approach:
git clone https://github.com/journey-ad/sd-webui-bilingual-localization extensions/sd-webui-bilingual-localization
Place the cloned directory into your extensions folder, and the extension will be ready for use.
Usage
To effectively use the bilingual localization feature:
- Navigate to Settings - User interface in the web UI and ensure Localization is set to
None
. - In the Bilingual Localization panel, choose the localization file you want to apply.
- Click Apply settings and then Reload UI to see the changes take effect.
Scoped Localization
The extension offers scoped localization to target specific UI elements without affecting the entire interface. This prevents global changes and allows for targeted translations.
- Syntax: Use
##<SCOPE ID>##<TEXT>
; the translation only applies when the ancestor element matches the scope ID. - Selector Usage: Utilize
##@<SELECTOR>##<TEXT>
to apply to specific CSS selector elements.
Example JSON configuration:
{
"##tab_ti##Normal": "正态",
"##tab_threedopenpose##Normal": "法线图",
"##@.extra-networks .tab-nav button##Lora": "Lora模型"
}
RegExp Pattern Localization
This feature allows the use of Regular Expressions for text translation:
- Syntax:
@@<REGEXP>
, with capture groups denoted by$n
.
Example JSON configuration:
{
"@@/^(\\d+) images in this directory, divided into (\\d+) pages$/": "目录中有$1张图片,共$2页",
"@@/^Favorites path from settings: (.*)$/": "设置的收藏夹目录:$1"
}
Obtaining Localization Files
Localization files are managed separately and are not included directly with the plugin. Users are encouraged to download third-party language extensions and follow the setup instructions as outlined in the usage section for seamless integration.