AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
141.5k stars 26.74k forks source link

Documentation translation #5931

Open ProfaneServitor opened 1 year ago

ProfaneServitor commented 1 year ago

Is there an existing issue for this?

What would your feature do ?

It would greatly decrease entry threshold for non-native English speakers.

Proposed workflow

I already started translating docs on my wiki. Mediawiki has powerful translation module which lets end users translate portions of pages in small batches without too much technical knowledge. Basically, as long as main page is prepared, it can be translated in other languages, and it can be later edited to keep the versions in different languages consistent. An example of page translated into Russian: https://ai-art-wiki.com/wiki/Stable_Diffusion_webui/Extensions/ru

Should there be a certain style for documentation, or is it just "dump whatever into the pile"? For example, are illustrations supposed to take up entire screen?

Is it ok if it will be written in mediawiki markup instead of md? Translation extension doesn't seem to like markdown too much.

Additional information

No response

ClashSAN commented 1 year ago

Our extensions page still is missing pictures (or maybe gifs) for some of the extensions.

are illustrations supposed to take up entire screen

oh, might be a good idea to make them smaller

ProfaneServitor commented 1 year ago

Our extensions page still is missing pictures (or maybe gifs) for some of the extensions.

I noticed that. Also, there is a whole list of untested and undescribed extensions. And there is some overlap between scripts and extensions.

Here's the thing: more content can be added into translations retroactively.

ClashSAN commented 1 year ago

I have a feeling, if we can move the wiki to a separate repository, it will be a superior option. -extensions testing with commit versions -user submitted gifs and images -extension maintainers can update description, release notes -translation -more users to find more extensions -users submit extension additions

this depends entirely on if auto wants.

ProfaneServitor commented 1 year ago

Ok, I think I made something.

Repository: https://github.com/ProfaneServitor/sdwui-docs

Site: https://profaneservitor.github.io/sdwui-docs/

Docs are in _pages/en directory. Translation is done by copying files from there and replacing lang with correct language code. If there is no translation, it defaults to English version. It isn't as easy as on mediawiki and it requires git, but it works on github. Release notes are in separate category, and link rot can be prevented by uploading images into repository.

What do you think?

ClashSAN commented 1 year ago

you put good work into this and it looks good. do you know how to sync (this) to the webui wiki, so that making changes for (this) can change the official wiki?

ProfaneServitor commented 1 year ago

Well, it's possible to clone the entire wiki into /en/ repository (I just copied it) and push from it. Or visa versa

L4Ph commented 1 year ago

https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/6695 I found a nice way to localize the Wiki. Apart from that, here's how to turn the Wiki itself into a web page https://github.com/nelsonjchen/github-wiki-see-rs

@ProfaneServitor @ClashSAN

L4Ph commented 1 year ago

I thought of a couple of additions.

Create a branch for the wiki and a folder /repo(Wiki Branch) or /repo/docs and run a sub-tree of Wiki Repo

The remote will follow on its own, the main branch will not be polluted, and you can create a Page as gh-pages

What do you think?

L4Ph commented 1 year ago

I think you can make a good markdown wiki with this. https://github.com/casualwriter/casual-markdown-page

ClashSAN commented 1 year ago

I thought of a couple of additions.

Create a branch for the wiki and a folder /repo(Wiki Branch) or /repo/docs and run a sub-tree of Wiki Repo

The remote will follow on its own, the main branch will not be polluted, and you can create a Page as gh-pages

What do you think?

Do you know of some auto-translation github workflow tools?

Using a branch as the wiki sounds nice, all contributors would be able to edit wiki like that, I believe.

I have not used gh-pages for websites before.

L4Ph commented 1 year ago

It's not automatic translation, but what about having separate folders for each locale? It may be difficult to follow, but you could make repo/locale/zh-CN and make zh-CN a sub-tree, and have it translated by volunteers.

If you want to manage them all in one place, Crowdin is a safe bet. You can use it for free if you apply for open source status.

ClashSAN commented 1 year ago

This https://github.com/JustArchiNET/ArchiSteamFarm/wiki is a good example, but we just use the repo instead of the actual wiki as then contributors will have access. I think @ProfaneServitor has already seemed to figure out automatic translations on github, he should try this on a webui branch

ClashSAN commented 1 year ago

@Katsuyuki-Karasawa https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/wiki/README.md so here is what you proposed. If you click the icon, you go to the translated page.

L4Ph commented 1 year ago

@ClashSAN That doesn't sound too bad. Now we just need to make it possible to follow this with a sub-tree ( Wiki ), get the wiki branch in order, and figure out how to maintain it, etc.?

https://docs.github.com/en/get-started/using-git/about-git-subtree-merges

I will try to make a few samples when I get home.

ClashSAN commented 1 year ago

hmm I found it is only accessible to directly make changes if you are a collaborator

L4Ph commented 1 year ago

@ClashSAN I checked the ArchiSteamFarm wiki. I found the following As for language changes, it looks like we can put them in _sidebar.md.

image

Example

| [![ja-JP](https://raw.githubusercontent.com/hjnilsson/country-flags/master/png100px/jp.png)](https://github.com/Katsuyuki-Karasawa/stable-diffusion-webui-localization-ja_JP/wiki) | 
| --- | --- | --- | --- |

Would it be better if the collaborators maintain it directly, or if it is distributed to each language and the maintainer works on each repository? Personally, I think it would be better to set up a collaborator in each repository and link to it. That way, there would be no need to add more collaborators to this repository.

ProfaneServitor commented 1 year ago

Now that you mentioned that _sidebar.md is a thing, I think it can be done.

I think it would make sense to keep the editable wiki on separate repository and push it into this one time to time, for starters. As for separate repos for each translation... Seems like overkill, there are, like, 30 pages in the wiki.

Editing the links in localized folders manually would be quite annoying, though.

ProfaneServitor commented 1 year ago

I think @ProfaneServitor has already seemed to figure out automatic translations on github, he should try this on a webui branch

Here's the script

Is Crowdin any good? Can i translate .md files without touching code? I was considering writing a gem just for translation of .md documents.

L4Ph commented 1 year ago

That's true, but for example, I and many others cannot edit the wiki because we don't have collaborator privileges.

Even if I want to clone, I can't go to the trouble of cloning all the languages, pushing, and even sending PRs because Wiki repos are quite specific.

If this were a repository where someone represented each language, it would be relatively easy to handle.

Currently the bottleneck is.

I'll see if I can find another repository that looks good. @ProfaneServitor

ProfaneServitor commented 1 year ago

Are wiki repositories any special? Why not just have two different remotes?

L4Ph commented 1 year ago

What does mean Why not just have two different remotes?

If I remember correctly, there is no such thing as a Pull Request on the GitHub Wiki when git submodule or git subtree are not used. Maybe you can do it with GitHub CLI or something, but in the end it seems too subtle for most people who translate on the GUI.

I personally think it would be preferable to separate translation from this repository as much as possible, as is the case with the current Extensions. If there is a change in the destination repository, I personally thought it would not be too much effort, since we can just send a mentions to the collaborators and change only the URL of _sidebar.md.

ClashSAN commented 1 year ago

@Katsuyuki-Karasawa can show me an example of what you want for new wiki locations?

You were saying earlier to use submodules, like what openoutpaint does - https://github.com/zero01101/openOutpaint-webUI-extension

test that - see if you can make a submodule for the wiki branch of webui..

L4Ph commented 1 year ago

@ClashSAN I had to write a ci, and once I completely erased it from my mind because I had not put together what I had conceived, and I had made a mistake in specifying the submodule.

The mistake was that apparently the submodulated folder would not be read remote. So it seems that it is not possible to make it directly Pages

However, it seems that you can checkout repo.wiki URL with ci, so maybe you can (but I'm not completely sure about the spec yet, so let me hold off on that for a bit). Sorry for changing so many suggestions.

L4Ph commented 1 year ago

It was very simple. It could be done. Now we can push externally while utilising the repo/wiki I'll leave the source, but if you have any questions, just ask! It took me a long time. I'm sorry. The actions will give you some idea.

Just add this to the Actions here https://squidfunk.github.io/mkdocs-material/publishing-your-site/

uses: actions/checkout@v3
with:
  repository: "${{ github.repository }}.wiki"
  path: docs

@ClashSAN https://github.com/Katsuyuki-Karasawa/stable-diffusion-webui.wiki-ja_JP https://katsuyuki-karasawa.github.io/stable-diffusion-webui.wiki-ja_JP/

L4Ph commented 1 year ago

What do you think of this? I'd like to submit a PullRequest along these lines if it's OK. but I'm not a collaborator and can't help with index.md on the wiki or translating the docs, so I'd like to hear your opinions

@ClashSAN @AUTOMATIC1111

ClashSAN commented 1 year ago

@Katsuyuki-Karasawa what would a PR be for? so, you used github actions to grab the wiki, are you able to explain/assist how to setup that for the other translators on their repos?

Do you now start translating wiki to japanese? What happens once you update to a more recent wiki? could you test?