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

Localize Text #914

Closed
titis14 opened this issue Aug 17, 2020 · 59 comments · Fixed by #1610
Closed

Localize Text #914

titis14 opened this issue Aug 17, 2020 · 59 comments · Fixed by #1610
Assignees
Labels
enhancement New feature or request
Projects

Comments

@titis14
Copy link

titis14 commented Aug 17, 2020

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

@titis14 titis14 added the enhancement New feature or request label Aug 17, 2020
@UnchartedBull
Copy link
Owner

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?

@UnchartedBull UnchartedBull changed the title French translation Localize Text Aug 18, 2020
@UnchartedBull UnchartedBull self-assigned this Aug 18, 2020
@titis14
Copy link
Author

titis14 commented Aug 19, 2020

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

@UnchartedBull UnchartedBull added this to To do in v3 Release Aug 19, 2020
@Der-WU
Copy link

Der-WU commented Sep 1, 2020

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

@Protoncek
Copy link

I can translate to Slovenian...

@Zero-Grav
Copy link

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

@TroisSix
Copy link

Also interested to help traduct in french :)

@UnchartedBull UnchartedBull removed this from To do in v3 Release Mar 18, 2021
@UnchartedBull UnchartedBull added this to To do in v4 Release via automation Mar 18, 2021
@pciavald
Copy link
Contributor

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
Copy link
Contributor

pciavald commented Mar 22, 2021

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
Copy link
Owner

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:

  • Handle untranslated content (i.e. adding a new feature with no translation available yet)
  • Should work in serve mode (at least in english)
  • Don't dramatically increase build times

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

@pciavald
Copy link
Contributor

pciavald commented Mar 23, 2021

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

about the difference between ngx-translate and native i18n: ngx-translate/core#495

@pciavald
Copy link
Contributor

Mostly done, will PR tomorrow

@UnchartedBull
Copy link
Owner

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
Copy link

Max3155 commented Aug 2, 2021

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
Copy link

Max3155 commented Aug 2, 2021

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

@jneilliii
Copy link
Contributor

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

@Max3155
Copy link

Max3155 commented Aug 2, 2021

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

@jneilliii
Copy link
Contributor

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

@Max3155
Copy link

Max3155 commented Aug 2, 2021

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

@jneilliii
Copy link
Contributor

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
Copy link
Contributor

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

@Max3155
Copy link

Max3155 commented Aug 2, 2021

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

@Max3155
Copy link

Max3155 commented Aug 2, 2021

okay thank you very much

@Max3155
Copy link

Max3155 commented Aug 2, 2021

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

locale_DE.zip

@Max3155
Copy link

Max3155 commented Aug 2, 2021

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

@jneilliii
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Owner

@jneilliii updated that in the linked branch already.

@UnchartedBull
Copy link
Owner

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

@Max3155
Copy link

Max3155 commented Aug 2, 2021

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

@Max3155
Copy link

Max3155 commented Aug 2, 2021

what do I have to do now?

Unbenannt

@Max3155
Copy link

Max3155 commented Aug 2, 2021

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

@jneilliii
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

Max3155 commented Aug 2, 2021

Okay and how i can start octodash now?

@Max3155
Copy link

Max3155 commented Aug 2, 2021

Unbenannt
memory access failure

@jneilliii
Copy link
Contributor

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
Copy link

Max3155 commented Aug 3, 2021

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

@Max3155
Copy link

Max3155 commented Aug 3, 2021

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

@jneilliii
Copy link
Contributor

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
Copy link
Contributor

@Max3155
Copy link

Max3155 commented Aug 3, 2021

npm run pack always creates a .tgz file for me

@jneilliii
Copy link
Contributor

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

@Max3155
Copy link

Max3155 commented Aug 3, 2021

Yes I know, but I need a .deb file

@Max3155
Copy link

Max3155 commented Aug 3, 2021

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

I will create this deb file

@jneilliii
Copy link
Contributor

once you extract the tgz is there no deb file inside?

@Max3155
Copy link

Max3155 commented Aug 3, 2021

yes unfortunately no deb file
Unbenannt

@jneilliii
Copy link
Contributor

what's in the build folder?

@Max3155
Copy link

Max3155 commented Aug 3, 2021

icon.png

@Max3155
Copy link

Max3155 commented Aug 4, 2021

Do you know the control file for the deb creator?

@UnchartedBull
Copy link
Owner

The package.json file controls the deb creation. It should create a deb archive when running npm run pack though. Did the command return any errors? It's also not advised to run the deb file creation on the Pi itself, because it's not powerful enough and can run out of memory during the build proces.

Also please either open a new issue or continue this on the discord. We're pinging other people here for a completely unrelated issue. Thanks.

@Max3155
Copy link

Max3155 commented Aug 4, 2021

Okay I create a new issue or should we chat with private chat?

@UnchartedBull
Copy link
Owner

Discord dev or support channel probably is your best bet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

10 participants