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

Continue translation support - tooltips #468

Open
wants to merge 10 commits into
base: development
Choose a base branch
from

Conversation

hasecilu
Copy link
Contributor

@hasecilu hasecilu commented Feb 24, 2024

@hasecilu hasecilu force-pushed the feat/translation_support_2 branch 2 times, most recently from 7bb5ebc to d671749 Compare February 25, 2024 16:28
@hasecilu hasecilu changed the title Continue translation support Continue translation support - tooltips Feb 25, 2024
@hasecilu
Copy link
Contributor Author

Groups

image

@hasecilu
Copy link
Contributor Author

I hope individual commits are easy to review.

@hasecilu hasecilu marked this pull request as ready for review February 25, 2024 18:54
@Zolko-123
Copy link
Owner

Zolko-123 commented Mar 6, 2024

I'd like to merge this, unfortunately I'm not good at git/GitHub to pick only what I like.

For example: the workbench name will not be translated. Non-negotiable.

Or: if I understand correctly, the purpose of the BaseCommand class is to get rid of the function GetRessources(). All other stuff needs to be defined anyway. So that's one layer more for not much gain. Or is there another advantage ?

Also: I insist, but I don't want to translate the command names yet, only the tooltips, that way people can better search for help on Internet. Please, that's very important.

What I mean is that once this is working, everybody will come with translations in German, Italian, Japanese and WhatNot, so it MUST be practical and fast for me. I understand that what I ask is annoying for you, but for me it's make-or-break

@Zolko-123
Copy link
Owner

In short: could you please make 1 PR with the current development branch as starting point, with a minimal set of changes (no white-space clean-ups) to translate the tooltips for the commands gotoDocument() and newAssembly(). Only that. When that works well, we'll add more stuff.

I don't have the time to review and understand all your code, sorry

@hasecilu
Copy link
Contributor Author

hasecilu commented Mar 7, 2024

Or: if I understand correctly, the purpose of the BaseCommand class is to get rid of the function GetRessources(). All other stuff needs to be defined anyway. So that's one layer more for not much gain. Or is there another advantage ?

Yes, to simplify the structure of the code and make it easier to read

Also: I insist, but I don't want to translate the command names yet, only the tooltips, that way people can better search for help on Internet. Please, that's very important.

Could be some residuals from first PR. Have you though on creating pages on the Wiki?

In short: could you please make 1 PR with the current development branch as starting point

Done

@Zolko-123
Copy link
Owner

Hello, I merged your previous code, adapted it to my liking, and made a new version release (v0.50.9) : could you please update and see if that works as you expect-it ?

If it works well, I'll merge this part of your code, thanx

Note : I changed the name of TranslationUtils to Asm4_Translate back

@hasecilu
Copy link
Contributor Author

hasecilu commented Mar 8, 2024

Hi, I tested from the addon manager and the strings that were marked translated are working as expected.

@hasecilu hasecilu force-pushed the feat/translation_support_2 branch 2 times, most recently from 68f58a8 to fca67f0 Compare March 19, 2024 19:30
This class is used to assign the resources from `self.pixmap`,
`self.menutext`, `self.tooltip` instance variables.

Variables are assigned on `__init__()` methods.

The code is more readable than previous dictionary returns.
This commit applies the `translation()` function to more tooltips.

Also make the classes to be child of BaseCommand class to inherit
GetResources() method which facilitates process.
Commands from the 2nd group.
Commands from the 3rd group.
Commands from the 4th group.
Commands from the 5th group.
Commands from the 6th group.
FreeCADGui.addLanguagePath(Asm4_trans)
&
FreeCADGui.updateLocale()

need to be moved over the workbench class
to be able to translate the WB tooltip
The script was updated to enable the update of the `asm4.ts` file every time
any other translation file is created or updated. This is made with the
objective of having this file updated with the most current changes.

If a translator doesn't have access to `pylupdate` command it can start
translating based on the `asm4.ts` file, it's only needed to replace

<TS version="2.1">

for

<TS version="2.1" language="es-AR" sourcelanguage="en">

using their language code (must be supported on FreeCAD).
@hasecilu
Copy link
Contributor Author

@Zolko-123 Would you be interested to join the FreeCAD-addons on the Crowdin platform? Essentially you could create an account there and manage the translations OR let us do that part and you will only need to accept PRs with updates. CC. @kaktusus

From what I have seen on the main FreeCAD Crowdin project almost every day FreeCAD is being translated, on the addons project 6 external WB were officially added last weeks.

The point is that having the same people that translates main FreeCAD translating the addons will help end users by having a level of consistency on the whole FreeCAD environment.

I'm sure doing it will get more attention from translators.

Meanwhile the translation support in the WB is done we can create a test directory to alert translators.

Regarding this PR would you prefer another one without the BaseCommand class I added?

image

@kaktusus
Copy link

We invite you to join the FeeeCAD-addons project on Crowdin.
Basically what we need most is your approval.
If you don't like Crowdin we can manage your translations ourselves. 😉

Current view of the list of external workbenches whose gui can be translated in Crowdin:
obraz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants