View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001857 | FreeCAD | Bug | public | 2014-12-15 18:24 | 2018-10-01 09:37 |
Reporter | Fedir | Assigned To | wmayer | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | reopened | ||
OS | Ubuntu | ||||
Product Version | 0.14 | ||||
Fixed in Version | 0.18 | ||||
Summary | 0001857: Broken start page in Ukrainian language | ||||
Description | hey folks ;) I got broken start page with Ukrainian language. Please see the attached screenshot. I suppose there is unexpected " in some translation string. But I have no idea how to debug it. I tried change there https://crowdin.com/translate/freecad/7254/en-uk#2594150 (was ") but again, no idea how to test whether I changed a right string. | ||||
Steps To Reproduce | set language to ?????????? (Ukrainian) | ||||
Tags | #lowhangingfruit, translation | ||||
FreeCAD Information | |||||
|
|
|
That's the right string. |
|
IMHO we should escape double quotesindex 34b8ccb..b8385f7 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -40,4 +40,3 @@ def translate(context,text): - if ord(i) == 39: - s.write("\\'") - else: - s.write(i) + if i == '\x22': s.write('"') + elif i == '\x27': s.write(''') + else: s.write(i) |
|
This doesn't really work either because if the translation escapes a string then in the HTML the output won't be: "quoted string" but &x22;quoted string&x22; |
|
The correct quotation tag in HTML is <q> and </q> |
|
I just thought that i it would be a goot idea not to rely on using escaped translated strings. I realized that would mean to escape < > & as well. |
|
thanks for fix, have small question, not really related to current issue, is there a way to test the translation without recompiling the whole app? :) in other apps I just replace the translation file, but for FreeCad seems different :) |
|
Enter this into the Python console: App.ConfigGet("UserAppData")+"translations" which gives you the path where to also load .qm translation files. Copy your modified translation files to the above directory and activate the language. A restart is not needed. Note: You need a 0.15 preview version, 0.14 won't work. |
|
Replacing quotes turned out to be a very strange problem. The current solution with "\\'" works in some cases but leads to a syntax error when used to assign the text to the "show" function. Theoretically the above solution with '"' and ''' (alternatively '&# 034;' and '&# 039;' or & quot; and & apos;) works for HTML but not in this case. The problem seems to be that the escape sequences are already interpreted before the text is assigned. So, this means that this inside the HTML file: onMouseover="show('My 'quoted text')" The ' is interpreted to be ' and later the onMouseover function complains about a missing ")". |
|
The solution is to add a variable in the script block, e.g.: var text01 = "This contains quoted string" And then you can write: onMouseover="show(text07)" |
|
Relevant links: http://www.sitepoint.com/forums/showthread.php?200151-Pass-parameters-from-onmouseover-into-function http://www.millin.de/downloads/3-935922-52-3/src/sonderzeichhtml.htm |
|
|
|
|
|
@wmayer is this still an issue? |
|
The problem by the OP is fixed. However, the system is still a bit fragile because it depends on a syntactical correct translation and if this is not the case it will happen again. Therefore it would be good to separate the functions from the translations. |
|
@wmayer where is the relevant code for this in the source ? |
|
@yorik is this also an issue with other languages as well ? |
|
In any case this startpage will sooner or later be changed by something else, maybe not HTML-based if there are still problems with qt5 and webkit. So I don't think it's worth much fixng this, specially if the original problem is solved already... |
|
The way how the StartPage is built now it's not longer an issue that a broken translation breaks the functionality. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-12-15 18:24 | Fedir | New Issue | |
2014-12-15 18:24 | Fedir | File Added: screen 2014-12-15 19.44.53 836x373.png | |
2014-12-16 09:22 | wmayer | Note Added: 0005389 | |
2014-12-16 09:42 | wmayer | Changeset attached | => FreeCAD Master master 171a8cf8 |
2014-12-16 09:42 | wmayer | Assigned To | => wmayer |
2014-12-16 09:42 | wmayer | Status | new => closed |
2014-12-16 09:42 | wmayer | Resolution | open => fixed |
2014-12-16 13:10 | shoogen | Note Added: 0005391 | |
2014-12-16 13:10 | shoogen | Status | closed => feedback |
2014-12-16 13:10 | shoogen | Resolution | fixed => reopened |
2014-12-16 13:11 | shoogen | Note Edited: 0005391 | |
2014-12-16 14:19 | wmayer | Note Added: 0005393 | |
2014-12-16 14:36 | wmayer | Note Added: 0005394 | |
2014-12-16 15:49 | shoogen | Note Edited: 0005391 | |
2014-12-16 15:52 | shoogen | Note Added: 0005395 | |
2014-12-18 13:13 | Fedir | Note Added: 0005406 | |
2014-12-18 13:13 | Fedir | Status | feedback => assigned |
2014-12-18 17:56 | wmayer | Note Added: 0005407 | |
2014-12-31 15:29 | wmayer | Note Added: 0005474 | |
2014-12-31 15:54 | wmayer | Note Edited: 0005474 | |
2014-12-31 15:59 | wmayer | Note Added: 0005475 | |
2016-01-12 22:27 | wmayer | Note Added: 0006713 | |
2016-01-12 22:27 | wmayer | File Added: freecad-startpage.html | |
2016-01-12 22:28 | wmayer | File Added: freecad-startpage_save.html | |
2017-01-13 16:40 | Kunda1 | Note Added: 0007719 | |
2017-01-13 18:07 | wmayer | Note Added: 0007723 | |
2017-05-31 01:04 | Kunda1 | Tag Attached: translation | |
2017-05-31 01:05 | Kunda1 | Tag Attached: #lowhangingfruit | |
2017-09-26 15:19 | Kunda1 | Note Added: 0010196 | |
2018-01-19 16:45 | Kunda1 | Target Version | => 0.17 |
2018-01-22 21:07 | wmayer | Target Version | 0.17 => |
2018-02-05 16:27 | Kunda1 | Note Added: 0010919 | |
2018-02-05 17:15 | yorik | Note Added: 0010923 | |
2018-10-01 09:37 | wmayer | Status | assigned => closed |
2018-10-01 09:37 | wmayer | Fixed in Version | => 0.18 |
2018-10-01 09:37 | wmayer | Note Added: 0011881 |