UnchartedBull / OctoDash

OctoDash is a simple, but beautiful dashboard for OctoPrint.
https://unchartedbull.github.io/OctoDash/index.html
Apache License 2.0
1.02k stars 225 forks source link

Localize Text #914

Closed titis14 closed 3 years ago

titis14 commented 4 years ago

Hello I installed octodash on my pi with a 7 inch screen in 1024x800 I am delighted with this application. I would like to know if the French translation is possible? I would like to contribute to translate the application. Is this easily done from a language file or is everything hard in the code? Thank you

UnchartedBull commented 4 years ago

Currently everything is hardcoded unfortunately. But having an i18n translation file is definitely on the list of improvements now. I'm changing the issues title and would come back to you for a french translation once this is done. Would this work for you?

titis14 commented 4 years ago

Hello, Ok great I'm waiting for your return to be able to do the translation :)

Der-WU commented 4 years ago

Hi there. I can translate it to German if it rdy. :)

Protoncek commented 4 years ago

I can translate to Slovenian...

Zero-Grav commented 4 years ago

Hi Could you please give me a language translation tutorial?!

TroisSix commented 3 years ago

Also interested to help traduct in french :)

pciavald commented 3 years ago

I have located and translated all hard-coded strings of the app to french, i can implement this feature if the correct structure is implemented, or at least advised (long time since i worked on an angular app, i would not be the right person to choose the plugins and file architecture).

pciavald commented 3 years ago

If no indication is given, i will start tomorrow. We have just rebased our branch to your latest main, and most changes are in conflict so i'll be faster implementing it correctly than fixing the merge :)

If you have any indication to which plugin to use, that would be helpful.

UnchartedBull commented 3 years ago

Didn't had a thorough look at the possibilities yet, but ngx-translate seems promising, but I'm open to other libraries / the default i18n localisation as well. It should be able to:

If you find something let me know and I can have a look at that :)

pciavald commented 3 years ago

I'm following this at the moment: https://angular.io/guide/i18n

about the difference between ngx-translate and native i18n: https://github.com/ngx-translate/core/issues/495

pciavald commented 3 years ago

Mostly done, will PR tomorrow

UnchartedBull commented 3 years ago

Thanks to @pciavald this has been implemented and a french translation is also available. If anyone of you want to add another translation please feel free to do so. A how-to is available in the CONTRIBUTING file. Thanks :)

Max3155 commented 3 years ago

Hi there. I can translate it to German if it rdy. :)

Hi @Der-WU , can you help me with the translation to germany? I need this for a projekt in a few days.

Max3155 commented 3 years ago

Or can someone else help me who is familiar with it?

jneilliii commented 3 years ago

Are you having issues with these instructions? https://github.com/UnchartedBull/OctoDash/blob/main/CONTRIBUTING.md#add-a-new-language

Max3155 commented 3 years ago

Yes I can't follow the instructions properly somehow. Is there a video or something?

jneilliii commented 3 years ago

none that I'm aware of. Have you at least got to the point where you have a german xlf file?

Max3155 commented 3 years ago

No, unfortunately not. The npm somehow doesn't work either. No matter what command I enter nothing comes back

jneilliii commented 3 years ago

you can just copy this file and fill in the "target" sections for the german equivalent. https://raw.githubusercontent.com/UnchartedBull/OctoDash/main/src/locale/messages.fr.xlf

jneilliii commented 3 years ago

once you have that I might be able to build you a version tonight that will work.

Max3155 commented 3 years ago

Okay I understand that. How do I go on then?

Max3155 commented 3 years ago

okay thank you very much

Max3155 commented 3 years ago

Can you then show me how it works?

jneilliii commented 3 years ago

I've never done it, so would have to figure that part out, but have a local development setup of OctoDash at home. Pretty sure it's just a bunch of copying/pasting of source files in OctoDash to add the language.

Max3155 commented 3 years ago

okay, I'll translate it now

jneilliii commented 3 years ago

Just a heads-up, I won't be home for about 6 hours, but can definitely try the process for you then. I'll keep screenshots and such to document the process for others.

Max3155 commented 3 years ago

Okay, Thank you

Max3155 commented 3 years ago

Okay, I'm ready with the file.

UnchartedBull commented 3 years ago

Please share the file here (just drag&drop) or create a PR

Max3155 commented 3 years ago

Okay it's not perfect yet, but i will optimize it when it works

locale_DE.zip

Max3155 commented 3 years ago

Could you send me a short video recording in which you translate it with the file?

jneilliii commented 3 years ago

I think the line needs to be updated.

<file original="ng2.template" datatype="plaintext" source-language="en" target-language="fr">

to

<file original="ng2.template" datatype="plaintext" source-language="en" target-language="de">
UnchartedBull commented 3 years ago

https://github.com/UnchartedBull/OctoDash/tree/feature/german-translation I created this branch. Everything is working there. You just need to execute ng serve --configuration=de & npm run electron:serve:big to get the development server up and running. I'll attach a deb file once the build is through.

On a site note: The translation do need a bit of work, not a huge fan of "Sie" and I think "Du" might be better suited for something like OctoDash, plus some texts are fairly long, so they might not fit in their designated spots.

Screenshot 2021-08-02 at 19 38 46
UnchartedBull commented 3 years ago

@jneilliii updated that in the linked branch already.

UnchartedBull commented 3 years ago

https://drive.google.com/file/d/1ZEMsNEkgBzbXCeqP38lXdsOoH-Gs44Ys/view?usp=sharing here is the deb with the included german translation

Max3155 commented 3 years ago

Okay, thank you very much, I'll test it out and then improve the translations again.

Max3155 commented 3 years ago

what do I have to do now?

Unbenannt

Max3155 commented 3 years ago

How can I actually create such a .deb? and then how do i use it?

jneilliii commented 3 years ago

I have github actions on my fork of OctoDash that will build the deb files. It's part of the packaging process. Once you have the deb file, you transfer it to your pi and use the command sudo dpkg -i ./octodash.deb from the folder you saved to via SSH or the terminal.

jneilliii commented 3 years ago

npm run pack will package into a deb file. not sure if you have to pass additional parameters for a different language or not to that command.

Max3155 commented 3 years ago

Okay and how i can start octodash now?

Max3155 commented 3 years ago

Unbenannt memory access failure

jneilliii commented 3 years ago

did you run through the standard install script first? I would do that and then install over the version it installs with the de one. then run sudo service getty@tty1 restart to have it restart.

Max3155 commented 3 years ago

Yes now it worked. Many Thanks. Can I actually personalize the symbols?

Max3155 commented 3 years ago

Can one of you show me how I can create the .deb?

jneilliii commented 3 years ago

Like I mentioned before, npm run pack from the folder where the code is will compile the code into a deb file. I do not know if you have to pass any parameters to that for specific language or not.

jneilliii commented 3 years ago

https://github.com/UnchartedBull/OctoDash/blob/main/CONTRIBUTING.md#setup

Max3155 commented 3 years ago

npm run pack always creates a .tgz file for me

jneilliii commented 3 years ago

that's a compressed file. should be able to be extracted. on windows I use 7 zip.

Max3155 commented 3 years ago

Yes I know, but I need a .deb file