Updated Developing extensions (markdown)

AUTOMATIC1111 2022-11-06 10:30:23 +03:00
parent 4ed7cf353e
commit ed03b2b6ff

@ -16,13 +16,18 @@ For how to develop custom scripts, which usually will do most of extension's wor
The preferred way to do localizations for the project is via making an extension. The basic file structure for the extension should be:
```
๐Ÿ“ localization-la_LA
โ”—โ”โ” ๐Ÿ“ localization
โ”—โ”โ” ๐Ÿ“„ la_LA.json
๐Ÿ“ webui root directory
โ”—โ”โ” ๐Ÿ“ extensions
โ”—โ”โ” ๐Ÿ“ webui-localization-la_LA <----- name of extension
โ”—โ”โ” ๐Ÿ“ localization <----- the single directory inside the extension
โ”—โ”โ” ๐Ÿ“„ la_LA.json <----- actual file with translations
```
Create a github repository with this file structure and ask any of people listed in collaborators section to add your extension to wiki.
If your language needs javascript/css or even python support, you can add that to the extension too.
## install.py
`install.py` is the script that is launched by the `launch.py`, the launcher, in a separate process before webui starts, and it's meant to install dependencies of the extension. It must be located in the root directory of the extension, not in the scripts directory. The script is launched with `PYTHONPATH` environment variable set to webui's path, so you can just `import launch` and use its functionality: