Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: How to change the language of dialog boxes?



Permlink Replies: 7 - Last Post: Mar 21, 2017 11:00 AM Last Post By: aidan levy Threads: [ Previous | Next ]
Gledston Olivei...

Posts: 4
Registered: 4/27/07
How to change the language of dialog boxes?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 5:47 AM
How to change the language of dialog boxes?

Hello everyone, how do I change the buttons in the dialogs? I'm using the ansicrono method.

_di_TInputCloseDialogProc ACloseDialogProc = new TCloseDialogHandler ();

   FormMain-> Msg-> MessageDialogAsync (L "Do you really want to delete?", TMsgDlgType :: mtInformation,
TMsgDlgButtons () << TMsgDlgBtn :: mbYes << TMsgDlgBtn :: mbNo,
TMsgDlgBtn :: mbNo, 0, ACloseDialogProc);

However, it is not easy to change the language of the mbNo buttons to germany ou portuguese or other language. How to do this? Thanks!

Edited by: Gledston Oliveira Reis on Feb 24, 2017 5:50 AM
Remy Lebeau (Te...


Posts: 8,722
Registered: 12/23/01
Re: How to change the language of dialog boxes? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 11:20 AM   in response to: Gledston Olivei... in response to: Gledston Olivei...
Gledston wrote:

How to change the language of dialog boxes?
how do I change the buttons in the dialogs?

Unfortunately, you can't, unless you are willing to modify FMX source code.
Localization has not been implemented in the dialogs yet. There are open
tickets in QualityPortal for this issue, feel free to vote on them. For
instance:

RSP-15970
MessageDialog: need to translate at runtime the caption of the button
https://quality.embarcadero.com/browse/RSP-15970

--
Remy Lebeau (TeamB)
Gledston Olivei...

Posts: 4
Registered: 4/27/07
Re: How to change the language of dialog boxes? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 11:28 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Gledston wrote:

How to change the language of dialog boxes?
how do I change the buttons in the dialogs?

Unfortunately, you can't, unless you are willing to modify FMX source code.
Localization has not been implemented in the dialogs yet. There are open
tickets in QualityPortal for this issue, feel free to vote on them. For
instance:

RSP-15970
MessageDialog: need to translate at runtime the caption of the button
https://quality.embarcadero.com/browse/RSP-15970

--
Remy Lebeau (TeamB)

Thank you. In this case I will create a frame for this, I think it would be the best solution.

aidan levy

Posts: 31
Registered: 7/6/16
Re: How to change the language of dialog boxes? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 2:34 PM   in response to: Gledston Olivei... in response to: Gledston Olivei...
What about ShowMessage("Проверка текста"); ?
If exist any possibility to use in mobile platforms other than English languages ?
Remy Lebeau (Te...


Posts: 8,722
Registered: 12/23/01
Re: How to change the language of dialog boxes? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 3:01 PM   in response to: aidan levy in response to: aidan levy
aidan wrote:

What about ShowMessage("Проверка текста"); ?

What about it? You can display whatever text you want. Though, in the above
example, you need to pass the string as a WIDE string, not a NARROW string:

ShowMessage(L"Проверка текста");


Or, in C++11:

ShowMessage(u"Проверка текста");


The real issue is the BUTTONS on such a dialog. Those are not currently
localizable.

--
Remy Lebeau (TeamB)
aidan levy

Posts: 31
Registered: 7/6/16
Re: How to change the language of dialog boxes? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 21, 2017 2:57 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

What about it? You can display whatever text you want. Though, in the above
example, you need to pass the string as a WIDE string, not a NARROW string:

ShowMessage(L"Проверка текста");


Or, in C++11:

ShowMessage(u"Проверка текста");


The real issue is the BUTTONS on such a dialog. Those are not currently
localizable.

--
Remy Lebeau (TeamB)

Thanks Remy ! It`s work !
BTW in this [http://docwiki.embarcadero.com/RADStudio/Seattle/en/TCHAR_Mapping] they told that set _TCHAR maps to wchar_t will make same work but it`s not work...
I tried Use _TEXT Macro before Text Literals but received error instead that tchar.h is included .

About text in interface ( BUTTONS ) I use Tlang component and it`s work good. Just not work BiDiMode.
Remy Lebeau (Te...


Posts: 8,722
Registered: 12/23/01
Re: How to change the language of dialog boxes? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 21, 2017 9:22 AM   in response to: aidan levy in response to: aidan levy
aidan wrote:

BTW in this
[http://docwiki.embarcadero.com/RADStudio/Seattle/en/TCHAR_Mapping]
they told that set _TCHAR maps to wchar_t will make same work but
it`s not work...

That documentation is misleading. The TCHAR setting only affects the C runtime
and Win32 API, nothing else. It has no effect whatsoever on the Delphi RTL
or VCL/FMX frameworks, or on character/string literals that are not wrapped
in the _T() or TEXT() macros. In short, the code you showed is not using
anything related to the TCHAR data type, so changing the TCHAR mapping does
not affect that code.

ShowMessage("Проверка текста");


This passes a NARROW string. ShowMessage() expects a UnicodeString as input.
Since the string is NARROW, its format is subject to the charset used by
the source file. When constructing the UnicodeString, this will cause a
(potentially lossy) data conversion from Ansi to Unicode using the charset
of the OS, not the source file.

ShowMessage(L"Проверка текста");


This passes a WIDE string. On Windows, a WIDE string is UTF-16 encoded,
which matches the encoding of UnicodeString, and so it can be constructed
as-is without performing any data conversions. However, on other platforms,
a WIDE string may be UTF-32 encoded instead, so a (loss-less) data conversion
will occur.

ShowMessage(_T("Проверка текста"));
ShowMessage(TEXT("Проверка текста"));


These pass either a NARROW or WIDE string, depending on the TCHAR mapping.

ShowMessage(u"Проверка текста");


This passes a UTF-16 encoded string. On all platforms, UnicodeString is
UTF-16 encoded, and u"" produces a UTF-16 string, so there is no data conversion.

ShowMessage(u8"Проверка текста");


This passes a UTF-8 encoded string. On all platforms, u8"" produces a UTF-8
string, but UnicodeString does not know that such a string is UTF-8 encoded,
so it will perform an Ansi to Unicode conversion, corrupting the string if
it contains any non-ASCII characters.

About text in interface ( BUTTONS ) I use Tlang component and it`s
work good. Just not work BiDiMode.

FireMonkey does not support BiDi yet.

--
Remy Lebeau (TeamB)
aidan levy

Posts: 31
Registered: 7/6/16
Re: How to change the language of dialog boxes? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 21, 2017 11:00 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you very match for so incredible answer !!!
You must to make docs ! :)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02