# sd-webui-bilingual-localization **Repository Path**: czmmiao/sd-webui-bilingual-localization ## Basic Information - **Project Name**: sd-webui-bilingual-localization - **Description**: Stable Diffusion web UI 双语对照翻译插件 Snipaste_2023-03-30_01-05-45 功能 全新实现的双语对照翻译功能,不必再担心切换翻译后找不到原始功能 兼容原生语言包扩展,无需重新导入多语言语料 支持动态title提示的翻译 额外支持作用域和正则表达式替换,翻译更加灵活 安装 以下方式选择其一,需要使用支持扩展功能的 webui (2023年之后的版本 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-04-12 - **Last Updated**: 2023-04-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [中文文档](README_ZH.md) / [日本語](README_JA.md)

sd-webui-bilingual-localization

# sd-webui-bilingual-localization [Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) bilingual localization extensions. ![Snipaste_2023-03-30_01-05-45](https://user-images.githubusercontent.com/16256221/228617304-3107244b-ce13-4b96-b665-1d13090d24a7.png) ## 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. ![Snipaste_2023-02-28_00-27-48](https://user-images.githubusercontent.com/16256221/221625310-a6ef0b4c-a1e0-46bb-be9c-6d88cd0ad684.png) After that, switch to the Installed panel and click the Apply and restart UI button. ![Snipaste_2023-02-28_00-29-14](https://user-images.githubusercontent.com/16256221/221625345-9e656f25-89dd-4361-8ee5-f4ab39d18ca4.png) #### Method 2 Clone to your extension directory manually. ```bash 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 to `None` 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. ![Snipaste_2023-02-28_00-04-21](https://user-images.githubusercontent.com/16256221/221625729-73519629-8c1f-4eb5-99db-a1d3f4b58a87.png) ## Scoped Localization supports scoped to prevent global impact. The syntax rule is `####`. Scoped text is effective only when the ID of the ancestor element of the node matches the specified scope. ```json { ... "##tab_ti##Normal": "正态", // only `Normal` under the element with id="tab_ti" will be translated to `正态`. "##tab_threedopenpose##Normal": "法线图", // only `Normal` under the element with id="tab_threedopenpose" will be translated to `法线图`. ... } ``` ## RegExp pattern Localization support RegExp pattern, syntax rule is `@@`, capturing group is `$n`, doc: [String.prototype.replace()](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replace) ```json { ... "@@/^(\\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](#usage) section of this article.