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

Objects names in Label & Attributes Tree View should be translatable #5547

Open
FreeCAD-Bug-Importer opened this issue Feb 7, 2022 · 23 comments
Assignees
Labels
Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Topic: User Interface Issue related UI/UX Translation Translation and localization related Type: Feature FR for improvements or new features

Comments

@FreeCAD-Bug-Importer
Copy link
Collaborator

Issue imported from https://tracker.freecad.org/view.php?id=494

  • Reporter: normandc
  • Date submitted: 11/27/2011
  • FreeCAD version:
  • Category: Feature
  • Status: assigned
  • Tags: #lowhangingfruit, translation

Original report text

Currently, all the GUI tools can be localized in other languages than English, either in menus or the toolbars. But the names of the objects created with these tools, in the Tree view under Labels & Attributes remain in English.

It would avoid confusion to users and enhance the user experience if those objects' names could be translated as well.

EDIT: So, to be clear, this ticket is about translating default names for items to the local language on object creation. ( ~6953 )
This ticket is not about being able to translate said items post object creation.

Additional information

EDIT: Also, at this time, only Part Primitive labels are translatable. All other FreeCAD objects are missing:
Arch,
Draft,
PartDesign, and so on.

Other bug information

  • Priority: normal
  • Severity: minor
  • Category: Feature
  • Updated: 2/6/2021

Discussion from Mantis ticket

Comment by Jriegel 2011-11-27 17:56

Its perfectly possible to set the Label property with a translated
text in the command which create the object.
But we have to take into account that then its hard to exchange
document with other people... They will see names which means nothing to them...

I would not do it for the 0.12!


Comment by normandc 2011-11-27 18:09

I hadn't thought of that.

I wonder if those object text strings could be translated on the fly like the rest of the GUI? That they would appear in the language set in FreeCAD?

If I recall, that's how Solid Edge works, but I haven't used a French version of the software for a couple of years. I believe that the features names would be translated in the software locale, but I can't be sure.

Still, as it is, the users create features of which names mean nothing to them if they don't have a working knowledge of English.


Comment by ian.rees 2016-04-06 07:01

Just trying to think through how this might work:

  1. French user creates Cylindre and Cylindre001 in a new file, saves it and sends to English user
  2. English user opens file and sees Cylinder and Cylinder001
  3. English user fuses Cylinder and Cylinder001 together, to create Fusion. Re-saves file and sends back to French user.

What does the French user see when they open the document and expand the object in it?

If the French user opens the file from the English user and saves it again without explicitly modifying anything, do we want the file to change?

Another user makes a drawing of an engine, and calls an object in it "Cylinder". Does that object's name get translated when the file is shared in other languages?

One corner case: If I'm using English FreeCAD and make a document with an object named "Cylindre" and another named "Cylinder" and send it to a French user, I think we need to make sure that Cylinder gets translated to Cylindre001. AFAIK object names need to be unique.


Comment by wmayer 2016-04-06 12:50

IMO, it's sufficient to translate the text on object creation and leave it afterwards as is. This means if an English user gets the project of a French user he will get the French text.

Also advanced users usually change the default label to something more meaningful and such text cannot be translated into another language anyway.


Comment by ian.rees 2016-04-06 21:29

OK, so should we close this ticket then? From what I understand, the primitives are now translated on creation, though haven't confirmed myself. http://forum.freecadweb.org/viewtopic.php?f=10&t=10497&start=30


Comment by normandc 2016-04-06 22:09

I agree with wmayer. I will add that even if you were to open a FreeCAD file made by somebody else with labels in a language you don't understand, you always have the icons to tell you the type of object. Back when I wrote this report, it was not the case.

But why close the ticket? At this time, only Part Primitive labels are translatable. All other FreeCAD objects are missing: Arch, Draft, PartDesign, and so on. Therefore most of the job is not even done yet.


Comment by ian.rees 2016-04-06 22:19

Ahh, I got a bit confused by the example in the forum where everything is translated. So, I thought the bug was about translating names after they're created, not about creating things with localised names.

So, to be clear, this ticket is about translating default names for items to the local language.


Comment by normandc 2016-04-06 22:22

Yes, that's it.


Comment by Kunda1 2017-01-17 11:55

I updated the 'Description' and 'Additional Information' of this ticket for more clarity.
What Workbenches are left to be translated? We can keep track of them in the 'Additional Information' field


Comment by normandc 2018-02-13 02:59

As per my 2016-04-06 comment: all of them apart from Part primitives.


Comment by normandc 2018-10-13 20:36

Removed "I don't know if this would be possible for 0.12 release..." from description as this obviously didn't make it. And 7 years later with a boatload of new commands added since 2011, this will be a MUCH BIGGER job.

@FreeCAD-Bug-Importer FreeCAD-Bug-Importer added Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Type: Feature FR for improvements or new features labels Feb 7, 2022
@luzpaz luzpaz added the Translation Translation and localization related label May 9, 2022
@luzpaz
Copy link
Contributor

luzpaz commented May 9, 2022

CC @kaktusus @Kuzma30

@Kuzma30
Copy link
Contributor

Kuzma30 commented May 10, 2022

How do I see the program interface
All names of operations in the tree must be translated.
To identify the operation by users with a different language, either icons or an internal name can be used (as done by RealThunder)

Знімок екрана з 2022-05-10 16-42-15
(screen from LinkDaily branch)

As far as I know, RealThunder changes to solve the topological problem just introduce the concept of an internal name. I hope after version 0.20 we will have code for Label & Attributes Tree View ready for translation.

As a variant we can make switch in parameters like "Use Internal names instead label" In this mode user will see untranslated features, like Pad, Pad001 and other.

@kaktusus
Copy link
Contributor

The presented solution seems to be close to ideal.

We have a saying in our country "I wilk jest syty, i owca cała" (The wolf is full and sheep are whole).
And this solution brought this saying to my mind.
Every user (even the most fierce malcontent) should be satisfied when they receive such a prepared "tool".

@adrianinsaval
Copy link
Member

Some forum discussion about this: https://forum.freecadweb.org/viewtopic.php?f=21&t=68683&p=595170&hilit=5547#p595170
The object names are in theory translatable but if I'm not mistaken only on creation, and most objects don't implement this.
I'm not sure how desirable this really is, I prefer to see the internal name directly when the object doesn't have a meaningful label and it would be a nightmare to open a file created in for example chinese in another unrelated language, even worse if you don't have a font with the characters. So IMO the current solution of translating in the label is not good, displaying internal names in the tree view in the corresponding language would be better.

Also, perhaps kuzma has learned this since then but internal names are a concept as old as freecad I believe, just look at the status bar when selecting an object in the tree view, maybe what realthunder did is to introduce that tooltip mentioning this.

@luzpaz
Copy link
Contributor

luzpaz commented Nov 8, 2022

@kaktusus did someone make a workaround for this?

@kaktusus
Copy link
Contributor

kaktusus commented Nov 8, 2022

it seems to me that nothing was happening on this topic.

@luzpaz
Copy link
Contributor

luzpaz commented Jun 10, 2023

bumping for discussion as we are close to release and this is a translation issue

@kaktusus
Copy link
Contributor

The solution proposed by Aleksandr (@Kuzma30) is very cool and convenient.
I think it is worth implementing it.

@FC-FBXL5
Copy link

I'd like to have a tool to show the name of a tree object, but rather another optional column Name than a tooltip. This would give a quick overview of all object names at once instead of clicking each item separately if you search for a special name.

@yorikvanhavre
Copy link
Member

Default labels like Body, Origin, Pad, Wall, Window, Line, Rectangle... should definitely be translated. I think they are already, almost everywhere. It might be worth having a good look at which are not translated yet. Usually that's because the developer didn't specifically set the label, so by default it is the same as the internal name. But it's an easy fix

@chennes
Copy link
Member

chennes commented Oct 23, 2023

To close this issue we really just need to figure out what it still missing -- any volunteers? @kaktusus is there someone on the translation team who could help identify what's missing?

@kaktusus
Copy link
Contributor

I can take care of it personally. 😉

@kaktusus
Copy link
Contributor

kaktusus commented Oct 23, 2023

obraz

these objects are the action of Draft's workbench tools.

@kaktusus
Copy link
Contributor

obraz

we see the label Sketch
and Tube (Part)

@kaktusus
Copy link
Contributor

obraz
obraz

tools from the Part tools bar

@kaktusus
Copy link
Contributor

Boolean toolbar tools (Part) also produce objects whose labels have no translations.

@kaktusus
Copy link
Contributor

kaktusus commented Oct 24, 2023

Currently, every workbench that creates objects in the view tree is deficient in translating the names of these objects.

@Kuzma30
Copy link
Contributor

Kuzma30 commented Oct 26, 2023

Related to idea described here #5547 (comment)
Kuzma30@3e3f42c
What this commt do:

  1. Add variables for 3 column in TreeViev where is planed to show Internal Name.
  2. Add content menu with checkbox.
    What not complete:
  3. I don't know where in Tree.cpp code I can add QString::fromUtf8(Obj->getNameInDocument();
    Need help.

image
image

@kaktusus
Copy link
Contributor

kaktusus commented Nov 6, 2023

Here someone else pointed out these objects. Maybe in a different context but there is an additional signal of irregularities.

#10519 (comment)

@maxwxyz maxwxyz added the Topic: User Interface Issue related UI/UX label Feb 25, 2024
@Kuzma30
Copy link
Contributor

Kuzma30 commented May 14, 2024

Some progress
Kuzma30@344015f
What works:

  1. You can add "Internal Name" column from context menu and from UI parameters dialog.
  2. Resize of column works
  3. Edit Label and Label2 (by pressing F2). For Internal Name column no Editor

Знімок екрана з 2024-05-14 09-22-28

Not Works:

  1. If you select some Object in Tree, then Internal Name will be hiden
    Знімок екрана з 2024-05-14 09-23-18
  2. If you hide some Object in Tree , then Label2 and Internal Name will shown as normal.
    Знімок екрана з 2024-05-14 09-23-29

In main branch https://github.com/FreeCAD/FreeCAD second problem also present

Знімок екрана з 2024-05-14 11-15-19

OS: Ubuntu 24.04 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37302 (Git)
Build type: Unknown
Branch: (HEAD відʼєднано на 0e24e12)
Hash: 0e24e12
Python 3.12.3, Qt 5.15.13, Coin 4.0.2, Vtk 9.1.0, OCC 7.6.3
Locale: Ukrainian/Ukraine (uk_UA)
Installed mods:

  • fasteners 0.5.20

@Kuzma30
Copy link
Contributor

Kuzma30 commented May 15, 2024

Now this 2 problems are fixed
https://github.com/Kuzma30/FreeCAD/commits/internalnametest/
Kuzma30@f2c2e84
Знімок екрана з 2024-05-15 13-33-09
Знімок екрана з 2024-05-15 13-32-51
@chennes @yorikvanhavre can you review?

@yorikvanhavre
Copy link
Member

I like having the possibility to display a third column with the internal name. That seems a good addition to me!
I suggest you make a PR!

@Kuzma30
Copy link
Contributor

Kuzma30 commented May 18, 2024

@yorikvanhavre Done. #14081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Topic: User Interface Issue related UI/UX Translation Translation and localization related Type: Feature FR for improvements or new features
Projects
None yet
Development

No branches or pull requests

10 participants