View topic - Photon Localization -- PxTranslateSet()

Photon Localization -- PxTranslateSet()

Read-only archive of qnx.gui (Creating graphical applications within a GUI environment, such as Photon or PhAB) at inn.qnx.com

Photon Localization -- PxTranslateSet()

Postby Kevin Stallard » Thu Aug 17, 2006 12:08 pm

Hi,

Under Configuration->Localization, one can set the Time Zone, Language,
Keyboard and Time & Date. How does one acquire the Language setting in
code?

I may be approaching this incorrectly, but I need to be able to translate
between UTF-8 and Unicode and it appears that I need the correct character
set translation installed (using PxTranslateSet()). Our application will
have string resources in several different languages and I would like to use
the setting in the Localization Configuration application to help the
application select the correct character set translation.

Thanks
Kevin
Kevin Stallard
 

Re: Photon Localization -- PxTranslateSet()

Postby Misha Nefedov » Thu Aug 17, 2006 12:41 pm

Please take a look into 'phlocale' help pages. It contains information about
files it saves. In your case you can use ABLANG environment variable (after
a restart).
-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1lu9$e29$1@inn.qnx.com...
Hi,

Under Configuration->Localization, one can set the Time Zone, Language,
Keyboard and Time & Date. How does one acquire the Language setting in
code?

I may be approaching this incorrectly, but I need to be able to translate
between UTF-8 and Unicode and it appears that I need the correct character
set translation installed (using PxTranslateSet()). Our application will
have string resources in several different languages and I would like to
use the setting in the Localization Configuration application to help the
application select the correct character set translation.

Thanks
Kevin
Misha Nefedov
 

Re: Photon Localization -- PxTranslateSet()

Postby Kevin Stallard » Thu Aug 17, 2006 1:17 pm

Thank you Misha,

I see that the ABLANG has the selection from the phlocale utility. Now the
next step is to resolve this name into something that PxTranslateSet() can
use to lookup the entry in the /usr/photon/translations/charsets table and
install the correct character set.

I believe I need this so that I can translate wide character ( 2 byte) based
strings into UTF-8 encoded strings and back again using the
PxTranslateToUtf. If I'm looking at this problem wrong (or if there is a
better), please don't hesitate to let me know.

We won't be using PhAB for translation strings. It's a long story, but they
will be using a non-qnx utility to create the localization strings. These
will not be UTF-8 encoded, but will be Unicode wide character (2 byte)
strings.

Thanks
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1nrn$evo$1@inn.qnx.com...
Please take a look into 'phlocale' help pages. It contains information
about files it saves. In your case you can use ABLANG environment variable
(after a restart).
-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1lu9$e29$1@inn.qnx.com...
Hi,

Under Configuration->Localization, one can set the Time Zone, Language,
Keyboard and Time & Date. How does one acquire the Language setting in
code?

I may be approaching this incorrectly, but I need to be able to translate
between UTF-8 and Unicode and it appears that I need the correct
character set translation installed (using PxTranslateSet()). Our
application will have string resources in several different languages and
I would like to use the setting in the Localization Configuration
application to help the application select the correct character set
translation.

Thanks
Kevin


Kevin Stallard
 

Re: Photon Localization -- PxTranslateSet()

Postby Misha Nefedov » Thu Aug 17, 2006 1:28 pm

The Unicode wide characters (2 or 4) could be easily converted into utf8
with a wctoutb8() function call.
I don't think you would need to know what language it is -- since it is
unicode.
There are some additional details in 'Appendix: Unicode Multilingual
Support' -- there is a link to this chapter from the
wctoutf8() function docs.

-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1pvc$gik$1@inn.qnx.com...
Thank you Misha,

I see that the ABLANG has the selection from the phlocale utility. Now
the next step is to resolve this name into something that PxTranslateSet()
can use to lookup the entry in the /usr/photon/translations/charsets table
and install the correct character set.

I believe I need this so that I can translate wide character ( 2 byte)
based strings into UTF-8 encoded strings and back again using the
PxTranslateToUtf. If I'm looking at this problem wrong (or if there is a
better), please don't hesitate to let me know.

We won't be using PhAB for translation strings. It's a long story, but
they will be using a non-qnx utility to create the localization strings.
These will not be UTF-8 encoded, but will be Unicode wide character (2
byte) strings.

Thanks
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1nrn$evo$1@inn.qnx.com...
Please take a look into 'phlocale' help pages. It contains information
about files it saves. In your case you can use ABLANG environment
variable (after a restart).
-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1lu9$e29$1@inn.qnx.com...
Hi,

Under Configuration->Localization, one can set the Time Zone, Language,
Keyboard and Time & Date. How does one acquire the Language setting in
code?

I may be approaching this incorrectly, but I need to be able to
translate between UTF-8 and Unicode and it appears that I need the
correct character set translation installed (using PxTranslateSet()).
Our application will have string resources in several different
languages and I would like to use the setting in the Localization
Configuration application to help the application select the correct
character set translation.

Thanks
Kevin




Misha Nefedov
 

Re: Photon Localization -- PxTranslateSet()

Postby Kevin Stallard » Thu Aug 17, 2006 3:47 pm

Yeah...I saw that one, but it does it one character at a time, I was hoping
that the PxTranslate*() would be more efficent.

Looks like I just need to buckle down and write some code and play with
it...

Thanks for your help
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1qj7$gsj$1@inn.qnx.com...
The Unicode wide characters (2 or 4) could be easily converted into utf8
with a wctoutb8() function call.
I don't think you would need to know what language it is -- since it is
unicode.
There are some additional details in 'Appendix: Unicode Multilingual
Support' -- there is a link to this chapter from the
wctoutf8() function docs.

-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1pvc$gik$1@inn.qnx.com...
Thank you Misha,

I see that the ABLANG has the selection from the phlocale utility. Now
the next step is to resolve this name into something that
PxTranslateSet() can use to lookup the entry in the
/usr/photon/translations/charsets table and install the correct character
set.

I believe I need this so that I can translate wide character ( 2 byte)
based strings into UTF-8 encoded strings and back again using the
PxTranslateToUtf. If I'm looking at this problem wrong (or if there is a
better), please don't hesitate to let me know.

We won't be using PhAB for translation strings. It's a long story, but
they will be using a non-qnx utility to create the localization strings.
These will not be UTF-8 encoded, but will be Unicode wide character (2
byte) strings.

Thanks
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1nrn$evo$1@inn.qnx.com...
Please take a look into 'phlocale' help pages. It contains information
about files it saves. In your case you can use ABLANG environment
variable (after a restart).
-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1lu9$e29$1@inn.qnx.com...
Hi,

Under Configuration->Localization, one can set the Time Zone, Language,
Keyboard and Time & Date. How does one acquire the Language setting in
code?

I may be approaching this incorrectly, but I need to be able to
translate between UTF-8 and Unicode and it appears that I need the
correct character set translation installed (using PxTranslateSet()).
Our application will have string resources in several different
languages and I would like to use the setting in the Localization
Configuration application to help the application select the correct
character set translation.

Thanks
Kevin






Kevin Stallard
 

Re: Photon Localization -- PxTranslateSet()

Postby Misha Nefedov » Thu Aug 17, 2006 4:45 pm

There is the wctombs() function.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec22pa$m5l$1@inn.qnx.com...
Yeah...I saw that one, but it does it one character at a time, I was
hoping that the PxTranslate*() would be more efficent.

Looks like I just need to buckle down and write some code and play with
it...

Thanks for your help
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1qj7$gsj$1@inn.qnx.com...
The Unicode wide characters (2 or 4) could be easily converted into utf8
with a wctoutb8() function call.
I don't think you would need to know what language it is -- since it is
unicode.
There are some additional details in 'Appendix: Unicode Multilingual
Support' -- there is a link to this chapter from the
wctoutf8() function docs.

-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1pvc$gik$1@inn.qnx.com...
Thank you Misha,

I see that the ABLANG has the selection from the phlocale utility. Now
the next step is to resolve this name into something that
PxTranslateSet() can use to lookup the entry in the
/usr/photon/translations/charsets table and install the correct
character set.

I believe I need this so that I can translate wide character ( 2 byte)
based strings into UTF-8 encoded strings and back again using the
PxTranslateToUtf. If I'm looking at this problem wrong (or if there is
a better), please don't hesitate to let me know.

We won't be using PhAB for translation strings. It's a long story, but
they will be using a non-qnx utility to create the localization strings.
These will not be UTF-8 encoded, but will be Unicode wide character (2
byte) strings.

Thanks
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1nrn$evo$1@inn.qnx.com...
Please take a look into 'phlocale' help pages. It contains information
about files it saves. In your case you can use ABLANG environment
variable (after a restart).
-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1lu9$e29$1@inn.qnx.com...
Hi,

Under Configuration->Localization, one can set the Time Zone,
Language, Keyboard and Time & Date. How does one acquire the Language
setting in code?

I may be approaching this incorrectly, but I need to be able to
translate between UTF-8 and Unicode and it appears that I need the
correct character set translation installed (using PxTranslateSet()).
Our application will have string resources in several different
languages and I would like to use the setting in the Localization
Configuration application to help the application select the correct
character set translation.

Thanks
Kevin








Misha Nefedov
 

Re: Photon Localization -- PxTranslateSet()

Postby Kevin Stallard » Thu Aug 17, 2006 5:06 pm

Yes, but I still have this function that is indiciating that I need to
choose the correct character set.

I just need to write some code that beats on this. I have a copy of the
unicode tables and such and I just need to see how things work...

Thanks again for your help...

Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec2662$oe3$1@inn.qnx.com...
There is the wctombs() function.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec22pa$m5l$1@inn.qnx.com...
Yeah...I saw that one, but it does it one character at a time, I was
hoping that the PxTranslate*() would be more efficent.

Looks like I just need to buckle down and write some code and play with
it...

Thanks for your help
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1qj7$gsj$1@inn.qnx.com...
The Unicode wide characters (2 or 4) could be easily converted into utf8
with a wctoutb8() function call.
I don't think you would need to know what language it is -- since it is
unicode.
There are some additional details in 'Appendix: Unicode Multilingual
Support' -- there is a link to this chapter from the
wctoutf8() function docs.

-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1pvc$gik$1@inn.qnx.com...
Thank you Misha,

I see that the ABLANG has the selection from the phlocale utility. Now
the next step is to resolve this name into something that
PxTranslateSet() can use to lookup the entry in the
/usr/photon/translations/charsets table and install the correct
character set.

I believe I need this so that I can translate wide character ( 2 byte)
based strings into UTF-8 encoded strings and back again using the
PxTranslateToUtf. If I'm looking at this problem wrong (or if there is
a better), please don't hesitate to let me know.

We won't be using PhAB for translation strings. It's a long story, but
they will be using a non-qnx utility to create the localization
strings. These will not be UTF-8 encoded, but will be Unicode wide
character (2 byte) strings.

Thanks
Kevin

"Misha Nefedov" <mnefedov@qnx.com> wrote in message
news:ec1nrn$evo$1@inn.qnx.com...
Please take a look into 'phlocale' help pages. It contains information
about files it saves. In your case you can use ABLANG environment
variable (after a restart).
-Misha.

"Kevin Stallard" <kevin@a.com> wrote in message
news:ec1lu9$e29$1@inn.qnx.com...
Hi,

Under Configuration->Localization, one can set the Time Zone,
Language, Keyboard and Time & Date. How does one acquire the
Language setting in code?

I may be approaching this incorrectly, but I need to be able to
translate between UTF-8 and Unicode and it appears that I need the
correct character set translation installed (using PxTranslateSet()).
Our application will have string resources in several different
languages and I would like to use the setting in the Localization
Configuration application to help the application select the correct
character set translation.

Thanks
Kevin










Kevin Stallard
 


Return to qnx.gui

Who is online

Users browsing this forum: No registered users and 1 guest