Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation capability for branch 0_15 #4274

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Sojourneer
Copy link

Translation capability for WLED. Google translated language files provided for JA, FR, DE. Has been tested on an ESP8266.

The coverage is high but not perfect; manual addition of text is required. A more robust solution using a screen scraper on a running WLED instance is probably a better way to go.

From the introduction to the I18N/tools (see wled00/I18N/tools/I18N.md for the details):

WLED Localization

Localization for WLED provides the ability to switch between display languages dynamically from the UI settings page. This setting is local to the browser, and is effective immediately (no Save or page refresh is required).

The rest of this document explains the process for providing this capability.

In summary, the UISimulator Web Server and a couple of python scripts are used to extract, translate, and test the translations on a static simulation of WLED. The translation files are then committed to Github, from which the L12N script included on each HTML page will access and apply the translation.


@softhack007 softhack007 added enhancement discussion python Pull requests that update Python code javascript Pull requests that update Javascript code labels Nov 11, 2024
@softhack007
Copy link
Collaborator

softhack007 commented Nov 11, 2024

@Sojourneer please clean up you PR - it seems there are lots of copied files and "cached whatever" that look like backups or intermediate files.

I'll mark your PR as draft for the time being.

@softhack007 softhack007 marked this pull request as draft November 11, 2024 15:24
@@ -0,0 +1,2 @@
cd wled00
sudo python3 UISimulator/main.py "$@"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo should not be needed in a public repository.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what that means. For example, is it permissible in documentation in a public repository?

Copy link
Collaborator

@softhack007 softhack007 Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it means that i don't want to have scripts that use sudo. If possible, change to python3 UISimulator/main.py "$@" .

Running programs with root permissions is only permissible when there is a very good justification.

@softhack007
Copy link
Collaborator

The rest of this document explains the process for providing this capability.

Where is this document?

@Sojourneer
Copy link
Author

@Sojourneer please clean up you PR - it seems there are lots of copied files and "cached whatever" that look like backups or intermediate files.

I'll mark your PR as draft for the time being.

There are no files that are purely generated from something else.

@Sojourneer
Copy link
Author

From the introduction to the I18N/tools (see wled00/I18N/tools/I18N.md for the details):

@softhack007
Copy link
Collaborator

softhack007 commented Dec 1, 2024

I'll mark your PR as draft for the time being.

There are no files that are purely generated from something else.

Maybe i should be a bit clearer about what I want.

A/ New directories you added --> please move I18N, UIsimulator, and scripts out of wled00. What will be included into the firmware itself, should be subfolders inside data. UIsimulator, and scripts could be placed into "tools"

image

B/ There are many sub-folders inside I18N/data and their purpose is unclear - in fact these looks like cached files. Please check if they can be removed and auto-generated by script. As a rule of thumb, any file that can be regenerated by a build script should not be added to the github repository.

image

C/ Translation files are appearing in several directories. Actually, it might be better to put them into a new lang directory on the top level, next to wled00/.
image

After this first cleanup, other maintainers might be able to review your work, ask questions and suggest improvements.

@netmindz netmindz changed the base branch from 0_15 to main December 16, 2024 13:26
@Sojourneer
Copy link
Author

Sojourneer commented Dec 20, 2024

I'll mark your PR as draft for the time being.

There are no files that are purely generated from something else.

Maybe i should be a bit clearer about what I want.

A/ New directories you added --> please move I18N, UIsimulator, and scripts out of wled00. What will be included into the firmware itself, should be subfolders inside data. UIsimulator, and scripts could be placed into "tools"

After this first cleanup, other maintainers might be able to review your work, ask questions and suggest improvements.

Sorry, I missed your message.

I decided a few weeks back to move all the work to a new repository https://github.com/Sojourneer/WLED-Translators-Pack, so all the ugly stuff is elsewhere and it is largely independent of the main repository. The Translator's Pack also includes a proxy server instead of the UI Simulator, in order to get better coverage of the application. The proxy server stuff is new to me and has me tearing my hair out, so the translation stuff has been bumped by other Christmas projects. (Although I have been using it personally).

I will get back to this after New Years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement javascript Pull requests that update Javascript code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants