View Issue Details

IDProjectCategoryView StatusLast Update
0000654FreeCADBugpublic2012-03-28 10:58
ReporternormandcAssigned Toyorik 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version0.13 
Summary0000654: FreeCAD Start Center dynamic links not working on some translations
DescriptionThe Start Center has dynamic links in separate text blocks. Under "Start a new project", hovering the mouse cursor over the "PartDesign" link shows content-specific text and image to the far right, as shown in attached screen capture.

The problem is with translations. In French, these dynamic links don't work in the "Stark a new project" block, and only one works in the "On the web" block. But they work in the "Recent files" block.

Other translations where the dynamic links do not work:
- Italian

Other translations where the dynamic links do work:
- Chinese
- Croatian
- Dutch
- Portuguese
- Russian (incomplete translation, some English remains)
- Swedish

Other languages not listed do not have translations for these text strings, English is used and appears correctly.
Additional InformationSteps to reproduce
- Go to Edit --> Preferences/General/General
- Set Auto load module at start up to Start
- Change the language
- Restart FreeCAD

FreeCAD 0.13-git201203231848~oneiric1 (but all FreeCAD versions since v0.12 are affected)
TagsNo tags attached.

Activities

2012-03-25 21:25

 

FCStartCenter-en.jpg (Attachment missing)

2012-03-25 21:25

 

FCStartCenter-fr.jpg (Attachment missing)

yorik

2012-03-25 22:32

administrator   ~0001815

Oh, good that you remembered this one, as always, I had totally forgotten. I suspect some problem with quotes...

wmayer

2012-03-26 18:22

administrator   ~0001819

I assume it's a problem with Unicode strings.

In the StartPage.py script there is the function show() and this fails if theText contains e.g. accents.

yorik

2012-03-26 18:24

administrator   ~0001820

Aah, that must be it. I'll see how to fix. Thanks for looking Werner!

wmayer

2012-03-27 10:36

administrator   ~0001821

No, Unicode is not the problem. I checked various examples with umlauts and other non-ASCII characters. The actual problem is an apostrophe because it seems that JS interprets this as end of string and thus may have some parsing trouble.

The trick is to mark an apostrophe with a special escape sequence. Here is the modified translate() function:


def translate(context,text):
        "convenience function for the Qt translator"
        u = QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8).toUtf8()
        s = cStringIO.StringIO()
        for i in u:
            if ord(i) == 39:
                s.write("\\'")
            else:
                s.write(i)
        t = s.getvalue()
        s.close()
        return t

yorik

2012-03-27 13:38

administrator   ~0001822

Okay I think it's fixed now (commit 54f8375). I'll wait for Normand to test before closing...

normandc

2012-03-28 02:21

manager   ~0001823

I confirm that it's fixed in the latest PPA (0.13-git201203272322~oneiric1). Thanks Yorik!

yorik

2012-03-28 10:57

administrator   ~0001824

Hurray, one more bug closed! Thanks for the solution Werner!

Issue History

Date Modified Username Field Change
2012-03-25 21:24 normandc New Issue
2012-03-25 21:25 normandc File Added: FCStartCenter-en.jpg
2012-03-25 21:25 normandc File Added: FCStartCenter-fr.jpg
2012-03-25 22:32 yorik Note Added: 0001815
2012-03-25 22:32 yorik Status new => assigned
2012-03-25 22:32 yorik Assigned To => yorik
2012-03-26 18:22 wmayer Note Added: 0001819
2012-03-26 18:24 yorik Note Added: 0001820
2012-03-27 10:36 wmayer Note Added: 0001821
2012-03-27 13:38 yorik Note Added: 0001822
2012-03-28 02:21 normandc Note Added: 0001823
2012-03-28 10:57 yorik Note Added: 0001824
2012-03-28 10:58 yorik Status assigned => closed
2012-03-28 10:58 yorik Resolution open => fixed
2012-03-28 10:58 yorik Fixed in Version => 0.13