Coder Social home page Coder Social logo

all-amazing / sd-webui-bilingual-localization Goto Github PK

View Code? Open in Web Editor NEW

This project forked from journey-ad/sd-webui-bilingual-localization

0.0 0.0 0.0 187 KB

Stable Diffusion web UI bilingual localization extensions. SD WebUI双语对照翻译插件

License: MIT License

JavaScript 90.42% Python 9.58%

sd-webui-bilingual-localization's Introduction

中文文档 / 日本語

sd-webui-bilingual-localization

sd-webui-bilingual-localization

Stable Diffusion web UI bilingual localization extensions.

Snipaste_2023-03-30_01-05-45

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

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

Snipaste_2023-02-28_00-29-14

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 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

Scoped

Localization supports scoped to prevent global impact. The syntax rule is ##<SCOPE ID>##<TEXT>.
Scoped text is effective only when the ID of the ancestor element of the node matches the specified scope.

{
  ...
  "##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 @@<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.

sd-webui-bilingual-localization's People

Contributors

journey-ad avatar rokurolize avatar l4ph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.