stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Translation

Open DancingSnow0517 opened this issue 2 years ago • 6 comments

Implement my issue #2461

DancingSnow0517 avatar Oct 15 '22 05:10 DancingSnow0517

Does gradio not supply any support for localization?

If we ever add this, it will have to be in a form that leaves original code with English untouched.

AUTOMATIC1111 avatar Oct 15 '22 07:10 AUTOMATIC1111

I checked their documentation and it seems that there is no localization support

DancingSnow0517 avatar Oct 15 '22 08:10 DancingSnow0517

about original code, use tr(original) is ok ex.

from modules.translate_manage import translate as tr

gr.Button(tr('Save'))

the translate key will be Save

DancingSnow0517 avatar Oct 15 '22 08:10 DancingSnow0517

in other lanuage can use Save as key ex. zh_cn.json

{
  "Save": "保存"
}

DancingSnow0517 avatar Oct 15 '22 08:10 DancingSnow0517

感谢您的贡献。请注意,此存储库中的资源不是在开源许可证下提供的。此存储库中的代码资源不保证包含其各自的原始作者许可条款。#2059 https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/CODEOWNERS

got it

DancingSnow0517 avatar Oct 15 '22 13:10 DancingSnow0517

I have a new idea, use the original English language in the code, just add the tr function? in other languages use original as key, it can achieve the same effect

DancingSnow0517 avatar Oct 16 '22 08:10 DancingSnow0517