Qucs / qucs

Qucs Project official mirror
http://qucs.sourceforge.net/
GNU General Public License v2.0
1.15k stars 213 forks source link

(linux) Subcircuits can't be added into a scheme if LANG=ru_RU.utf8 #353

Closed denizzzka closed 9 years ago

denizzzka commented 9 years ago

workaround:

$ LANG=C ~/local/qucs/bin/qucs
ra3xdh commented 9 years ago

I cannot confirm this bug. Could you please provide more detailed step sequence to reproduce it? I have Russian system locale LANG=ru_RU.UTF-8 and perform the following sequence of steps:

  1. Create empty schematic
  2. Place empty subcircuit (File components->Subcircuit)
  3. Go to subcircuit properties, then click Browse button and select appropriate subcircuit
  4. Click Apply
  5. Subcircuit is placed on schematic and simulation works.

Subcircuits in projects are also operational. So, it's need more details on your steps sequence.

denizzzka commented 9 years ago

2) I am try to add subcircuit by click on Content - Schematics - subcircuit_name and move mouse pointer to the sheet

On Russian locale it is do nothing, on LANG=C it is draws subcircuit symbol under mice pointer

ra3xdh commented 9 years ago

Yes, I can reproduce this bug now. But there is one point that is missing from your comment. Qucs interface language should be set to "System default" in Application settings. If interface language is English all is operational. This looks strange. It's need to work on this bug.

ra3xdh commented 9 years ago

I understood the reason of this bug. The problem is in projectView.h lines 31 -- 40. ProjectView tree labels lost their translations and could not be updated, because they are now wrapped in macros. But tr("Schematic") in line 2272 of qucs.cpp still have proper translation. It results in wrong if operator condition. It's need to think how to fix it.

guitorri commented 9 years ago

Can you try to cherry-pick this commit: https://github.com/guitorri/qucs/commit/da71cefe5f1d859cc0a07e3a6095b23043c31aa6

Those tr() as a define cannot be. This will break lupdate for the translations.

ra3xdh commented 9 years ago

@guitorri , Yes, this commit helps, but it's need also to update all *.ts files. I have taken whole your tx branch and then updated again all *.ts files in it. There is also problem in translations/Makefile.am line 38. There is no backslash on end of this line.

It seems all is already done on your tx branch. Can this tx branch be prepared for merge? What is need to do? As alternative we can backport individual commits from this branch in master.

guitorri commented 9 years ago

I was working yesterday to update the tx branch. It is almost ready. I will try to PR it later today.

guitorri commented 9 years ago

@ra3xdh can you please take a look at https://github.com/Qucs/qucs/pull/357.

guitorri commented 9 years ago

Seems to be fixed.

ldpgh commented 7 years ago

I'm running into the same issue using the release Version 0.0.19 (9d924ca) @ Win7Pro, German

guitorri commented 7 years ago

First, your issue seems different from the one reported here. Please open another ticked if that is the case.

Second, I cannot reproduce. I just tested switching languages with the -rc3 and it seems fine. Which branch are you using? The latest is release-0.0.19.

Please give it try with the portable version: https://sourceforge.net/projects/qucs/files/qucs-binary/0.0.19-snapshots/qucs-0.0.19-rc3-win32-mingw482-asco-freehdl-adms.zip

ldpgh commented 7 years ago

Have checked the portable version ... behaves the same as reported. It means language has to be changed to "English (en)" to work properly.

What OS are you using?

guitorri commented 7 years ago

Just to be clear, you cannot add sub-circuits if you set the language to German. Right? Your Windows is in German, right?

I can add sub-circuits with German set, but my windows is in English... Still trying to reproduce.

ldpgh commented 7 years ago

You got the right impression.

In the meanwhile have tested the mobile Version on my old laptop running WinXP + German. It works for all 3 mentioned conditions.

One remarkable point is the application language setting in case of German.

It's not what I would expect ... a partial translation of the string with a dependency to the OS.

When the mouse hoovers over the language-icon in the Windows taskbar both OS (Win7Pro & WinXP) return "Deutsch (Deutschland)" as local setting.

ldpgh commented 7 years ago

Mobile Version ...

For this reason it looks to me like the same root cause and the workaround works as well. Anyway there is no issue for me to create a new ticket if you ask for it.

in3otd commented 7 years ago

uhm, quite strange. Also here, with Windows with English system language and Qucs language set to German it works fine. I'll need to try to switch the system language to German, not sure if it's possible. When you wrote

Win7Pro ... "Deutsch (de)" ... issue WinXP ... "German (de)" ... OK

you mean that in both cases the Qucs messages are shown in German, right? Just to be sure the application is selecting the right language in both cases.

guitorri commented 7 years ago

Just to say, there is no Deutsch string in the repository... so I don't understand.

Edit: Deutsch

ldpgh commented 7 years ago

Screenshot Application Setting @ Win7Pro qucs_app_lang_setting

guitorri commented 7 years ago

Something is wrong: image

I set it to German and restarted. Parts of the UI are in German parts are in English (as my Windows)

guitorri commented 7 years ago

I thing there is a bit mess up in the translation files, they are not translated anymore... :angry: https://github.com/Qucs/qucs/blob/release-0.0.19/qucs/translations/qucs_de.ts#L12647-L12648

ldpgh commented 7 years ago

@guitorri ... New ticket or do you reopen this one?

in3otd commented 7 years ago

uhm, it seems that many German translation strings were already lost here... https://github.com/Qucs/qucs/commit/36abe569f763740be8a2c484389be4544d280b7c#diff-3863895ef601ae42db826aa712bbb23c

@ldpgh , do you have an "old" version of Qucs installed on one of the Windows machines but not on the other? I think the new version may be using the translated strings of an older installed version (may happen if there is a QUCSDIR environment variable set, I think)

in3otd commented 7 years ago

...my wild guess:

ldpgh commented 7 years ago

Hello Sherlock Holmes, your guess is exceptional good description of my setup.

All your assumptions are true. Though the WinXP machine have seen old Qucs installations, all were de-installed recently. And yes QUCSDIR is set on the Win7Pro machine.

Thx for your quick support. No further work should go in this topic and my focus returns to PR for #386.

guitorri commented 7 years ago

So, (re)setting QUCSDIR fixes the sub-circuit issue?

We still have two issues. The lost translations and comparison done on translated strings...

guitorri commented 7 years ago

I did a bisect on the German word Englisch. Something like find . -name qucs_de.ts | xargs grep Englisch A bunch of German translations were lost before 0.0.17, in this commit 6663635cf

@ldpgh please confirm that the sub-circuit issue is fixed if QUCSDIR is correctly set.

in3otd commented 7 years ago

We still have two issues. The lost translations and comparison done on translated strings...

yep... I'll add a third one: the portable Qucs uses QUCSDIR unconditionally. It is/will be a common situation that a Windows user, which has previously installed Qucs, uses the portable version without uninstalling the old version first. The result will be that some/many things will be taken from the old version, as seen above. IMHO, the portable version should have a qucs.bat file in the base directory that unsets QUCSDIR and then launches Qucs. And/or even better a startup message that inform the user that QUCSDIR is set and this should not normally be.

I didn't look at the installer but I think it should make sure that QUCSDIR is either not set (best) or set to the newest Qucs (but this may break the old install).

ldpgh commented 7 years ago

QUCSDIR (both settings (user & system)) removed.

Set application language = "system language"

Changed again application language = "German (de)" ... ("Deutsch (de)" is gone)

ldpgh commented 7 years ago

Adding on the long-term a startup-wrapper script (e.g. qucs.bat) is a good idea ... and not just for windows. IMHO it's the right way for CAD software running on many platforms and systems with old versions installed. Btw. any kind of wrapper need to be very fast if invoked multiple times by others (e.g. test suite).

guitorri commented 7 years ago

Thank you @ldpgh for the update. There are now tickets open to track the individual issues.