Lazarus
Programming => Widgetset => QT => Topic started by: Ocye on September 15, 2012, 01:12:39 pm
-
A simple ShowMessage('Bär') (->B??r) or ShowMessage('ада') (-> ??????) as well MessageDlg() don't work with Qt on Darwin. Can someone confirm this bug?
Carbon@Darwin and Qt@Linux both are okay, but not Qt@Darwin (always compiled with {$H+}).
Lazarus updates recently from svn, FPC 2.6.0
-
Have you included cwstring unit ?
-
Have you included cwstring unit ?
I didn't before. But it does not help either.
-
I had some problems with mac also, but fixed it by adding LANG variable into macosx startup file.
so:
1.Create directory $HOME/.MacOSX (it's hidden dir - have dot in front of it)
2.Inside $HOME/.MacOSX create file environment.plist (you can do that by mac tool to create plist's ... don't know name atm)
3.Inside that file must be <key>LANG</key> <string>yourlocale_YOURLOCALE.UTF-8</string>
eg. I have <string>hr_HR.UTF-8</string>.
Logout, and then login again so changes are visible to system.
Before you create anything you can test that from terminal.
export LANG=yourlocale_YOURLOCALE.UTF-8
cd YourProject.app/Contents/MacOS
./yourproject <PRESS ENTER>
-
When I export LANG=de_DE.UTF8 the umlaut with ShowMessage() is still not shown, neither with or without cwstring. Carbon works as expected. LC_TYPE is UTF8.
And, last but not least, it would be a problem to set the LANG id for users.
PS: Maybe it's an interesting fact that "with CreateMessageDialog('Bär',mtConfirmation],[mbOk]) do ShowModal" is okay.
-
It's not de_DE.UTF8 but de_DE.UTF-8
-
PS: Maybe it's an interesting fact that "with CreateMessageDialog('Bär',mtConfirmation],[mbOk]) do ShowModal" is okay.
CreateMessageDialog() doesn't use native dialog, it is a plain TForm that displays the message and the buttons, like any other LCL widget.
It is used as a fallback for widgetsets that do not provide a native dialog (like on win9x/winxp).
MessageDlg() probably calls native QT dialog, hence the difference.
Bart
-
But native dialog uses same strings translation like any other control afaik. eg.
QMessageDialog_setTitle(GetUTF8String(MyString)) is called.
-
It's not de_DE.UTF8 but de_DE.UTF-8
No success. I feel stupid %)
BTW: Lazarus itself does no show umlauts. Probably I have to blame my configuration.
-
It's really strange, I don't have such problems on mac using LANG=hr_HR.UTF-8 ...
-
Memo.Lines is affected as well. If I add strings at the designer, like Bär, it is shown as B??r. And after reopening property editor for lines that memo contains B??r. So I must get converted by Lazarus.
-
Please open an issue about it and attach example with your strings inside.