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

Harcoded name for first new document and imported doc(without translation) #124

Open
Kuzma30 opened this issue Apr 30, 2022 · 14 comments
Open

Comments

@Kuzma30
Copy link

Kuzma30 commented Apr 30, 2022

I think this is a problem (small).
When you create first new document its name hard-coded to "Unnamed". Second new document name is localized (For example in Ukrainian it will be "Без Назви1".
I found place where it's harcoded

getUniqueDocumentName

Знімок екрана з 2022-04-30 16-26-38

@Kuzma30 Kuzma30 changed the title Harcoded name for onle first new document (without translation) Harcoded name for only first new document (without translation) Apr 30, 2022
@kaktusus
Copy link
Contributor

confirm


OS: Debian GNU/Linux bookworm/sid (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28751 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 660655e)
Hash: 660655e54c97b5017ff0ac1e030059308cd4e3f5
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Polish/Poland (pl_PL)
Installed mods: 
...

obraz

@Kuzma30
Copy link
Author

Kuzma30 commented Apr 30, 2022

Simular situation for import .step files. It imported to "Unnamed" for first, "Unnamed1' for second.

Harcoded here (for .step)

https://github.com/FreeCAD/FreeCAD/blob/d2253c7be4db12dbf9b89a53abfacff87692d216/src/Mod/Part/App/AppPartPy.cpp#L640

and for .iges
https://github.com/FreeCAD/FreeCAD/blob/d2253c7be4db12dbf9b89a53abfacff87692d216/src/Mod/Part/App/AppPartPy.cpp#L651

Знімок екрана з 2022-04-30 17-03-59

OS: Ubuntu 22.04 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.28804 (Git)
Build type: Release
Branch: master
Hash: 219f2e3cf38725cc574a75a40e4213b3641a05c3
Python 3.10.4, Qt 5.15.3, Coin 4.0.0, OCC 7.7.0.dev
Locale: Ukrainian/Ukraine (uk_UA)

@Kuzma30 Kuzma30 changed the title Harcoded name for only first new document (without translation) Harcoded name for first new document and imported doc(without translation) Apr 30, 2022
Kuzma30 pushed a commit to Kuzma30/FreeCAD that referenced this issue May 1, 2022
Kuzma30 pushed a commit to Kuzma30/FreeCAD that referenced this issue May 1, 2022
Harcoded name for first new document and imported doc(without translation)
FreeCAD/FreeCAD-translations#124
Kuzma30 pushed a commit to Kuzma30/FreeCAD that referenced this issue May 1, 2022
Kuzma30 pushed a commit to Kuzma30/FreeCAD that referenced this issue May 1, 2022
Harcoded name for first new document and imported doc(without translation)
FreeCAD/FreeCAD-translations#124
Kuzma30 pushed a commit to Kuzma30/FreeCAD that referenced this issue May 1, 2022
Kuzma30 pushed a commit to Kuzma30/FreeCAD that referenced this issue May 1, 2022
Harcoded name for first new document and imported doc(without translation)
FreeCAD/FreeCAD-translations#124
Kuzma30 added a commit to Kuzma30/FreeCAD that referenced this issue May 1, 2022
This solve such things

1.    If you create new document, it show "Unnamed" name without translations. Solved.
    If you open .step file create new document with "Unnamed" name without translations. Solved.
    If you open .iges file create new document with "Unnamed" name without translations. Solved.
    Add similar translation ability to AppFemPy, AppMeshPy and AppPartPy.

After commit please run updatets.py script
@Kuzma30
Copy link
Author

Kuzma30 commented May 1, 2022

Final version (all in one) Kuzma30/FreeCAD@d140634
The reason of creating Resources/tranlations for src/App - we have "Unnamed" text for creating new document.
The second string in ts file created automatic when run lupdate in current directory.
May be there are more texts that we can add to .ts later.

@Kuzma30
Copy link
Author

Kuzma30 commented May 2, 2022

@wwmayer @luzpaz Can I create pull-request in such form (prev comment with link)?
I also can create separate pull-request if need.

@luzpaz
Copy link
Collaborator

luzpaz commented May 2, 2022

I would encourage you to leave the lupdate compilation work for yorik. Just add the code that is significant to the issue you're fixing

@Kuzma30
Copy link
Author

Kuzma30 commented May 2, 2022

To solve part of described problem we need create in new place .tm files. Or I need create separate commit for such operation?

@luzpaz
Copy link
Collaborator

luzpaz commented May 2, 2022

Why not just revert all the .qm and .ts files and submit the source code changes by themselves?

Kuzma30 added a commit to Kuzma30/FreeCAD that referenced this issue May 3, 2022
This solve such things

1.  If you create new document, it show "Unnamed" name without translations. Solved.
2.  If you open .step file create new document with "Unnamed" name without translations. Solved.
3.  If you open .iges file create new document with "Unnamed" name without translations. Solved.
4.  Add similar translation ability to AppFemPy, AppMeshPy and AppPartPy.
Kuzma30 added a commit to Kuzma30/FreeCAD that referenced this issue May 3, 2022
This solve such things

1.  If you create new document, it show "Unnamed" name without translations. Solved.
2.  If you open .step file create new document with "Unnamed" name without translations. Solved.
3.  If you open .iges file create new document with "Unnamed" name without translations. Solved.
4.  Add similar translation ability to AppFemPy, AppMeshPy and AppPartPy.
Kuzma30 added a commit to Kuzma30/FreeCAD that referenced this issue May 3, 2022
Fix FreeCAD/FreeCAD-translations#124 (#25)

This solve such things

1.  If you create new document, it show "Unnamed" name without translations. Solved.
2.  If you open .step file create new document with "Unnamed" name without translations. Solved.
3.  If you open .iges file create new document with "Unnamed" name without translations. Solved.
4.  Add similar translation ability to AppFemPy, AppMeshPy and AppPartPy.
@Kuzma30
Copy link
Author

Kuzma30 commented May 10, 2022

Please mark as "for 0.21v"

@ronnystandtke
Copy link

We can't provide L10n for the "Unnamed" string because the App.ts file is still missing in Crowdin.
Someone more familiar with the details should add it to the src/Tools/updatecrowdin.py script and run it.

See FreeCAD/FreeCAD#9275 for more details.

@luzpaz
Copy link
Collaborator

luzpaz commented Apr 16, 2023

@yorikvanhavre any issue with adding App.ts to crowdin ?

@yorikvanhavre
Copy link
Member

I just pushed it manually to crowdin, and see FreeCAD/FreeCAD#9314 for the script update

@luzpaz luzpaz added the pending label Apr 19, 2023
@chennes
Copy link
Member

chennes commented Apr 22, 2023

A search of our code for "Unnamed" still seems to yield a few untranslated strings, and several different contexts used for what appear to be the same basic usage. I'm seeing instances in Application, Document, DocumentRecovery, and Spreadsheet.

@ronnystandtke
Copy link

I just noticed that in the current release and also in the current git version this issue is still there.

It seems that despite having i18n in the header and source files, complete translations in crowdin and *.ts files, updates of all *.qm files, NOT A SINGLE translation from src/App/Resources/translations/App_* is picked up when running FreeCAD.
I would be glad if someone more familiar with the source code and the i18n/L10n infrastructure of FreeCAD could take a look at it.

@kaktusus
Copy link
Contributor

there are three ways to open a new project file

  • Main menu
  • Toolbar
  • Start page

at the moment all three give failure previously it was not so bad.

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

No branches or pull requests

6 participants