Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
February 03, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
You can build multiple versions of you app: http://dsource.org/projects/tutorials/wiki/LocalesExample On Thu, Feb 2, 2012, at 07:48 PM, xancorreu wrote: > Hi, > > Is there any way for localizate and internationalizate messages? > I were shocked if D has something like Fantom > [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty > ugly ;-) > > > If not, any plannings? > > Thanks, > Xan. > -- D |
February 05, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
On Thu, Feb 2, 2012 at 4:48 PM, xancorreu <xancorreu@gmail.com> wrote: > Hi, > > Is there any way for localizate and internationalizate messages? > I were shocked if D has something like Fantom > [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly > ;-) I just glanced at Fantom because I am very much interesting in localization framework design. You really think that Fantom's localization design is better than gettext? What human language is "$<fwt::cancel.name>"? > > > If not, any plannings? > > Thanks, > Xan. |
February 05, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
Al 05/02/12 05:26, En/na Jose Armando Garcia ha escrit:
> On Thu, Feb 2, 2012 at 4:48 PM, xancorreu<xancorreu@gmail.com> wrote:
>> Hi,
>>
>> Is there any way for localizate and internationalizate messages?
>> I were shocked if D has something like Fantom
>> [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly
>> ;-)
> I just glanced at Fantom because I am very much interesting in
> localization framework design. You really think that Fantom's
> localization design is better than gettext? What human language is
> "$<fwt::cancel.name>"?
So, in conclusion, what can I do for localize outputs of programs?
|
February 05, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
On Sun, Feb 5, 2012 at 1:15 PM, xancorreu <xancorreu@gmail.com> wrote: > Al 05/02/12 05:26, En/na Jose Armando Garcia ha escrit: >> >> On Thu, Feb 2, 2012 at 4:48 PM, xancorreu<xancorreu@gmail.com> wrote: >>> >>> Hi, >>> >>> Is there any way for localizate and internationalizate messages? >>> I were shocked if D has something like Fantom >>> [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly >>> ;-) >> >> I just glanced at Fantom because I am very much interesting in localization framework design. You really think that Fantom's localization design is better than gettext? What human language is "$<fwt::cancel.name>"? > > > So, in conclusion, what can I do for localize outputs of programs? > > I would suggest writing D binding for gettext and reading gettext documentation... "Most GNU packages have the ability to output messages in several languages. This native-language support (NLS) requires the LibIntl and the LibIconv libraries. On MS-Windows they have been adapted so that NLS chooses the system language, unless the environment variables LANG and LANGUAGE have been set. The language codes (ISO 639) for these environment variables are different from the MS-Windows ones. When using a program in a console window (command.com or cmd.exe) and setting LANG and LANGUAGE, you must also set the correct code page with the chcp command; for Western European languages, code page 1252 usually suffices. You can change the default code page by changing the OEMCP value in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage For other languages, such as those with a Cyrillic character set, NLS may not operate correctly, unless a TrueType font with these characters has been chosen. If you want to disable NLS, then set the environment variables LANGUAGE and LANG to en; then all messages will be in English. " Hope that helps! -Jose |
February 05, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jose Armando Garcia | Am Sun, 5 Feb 2012 14:16:37 -0200
schrieb Jose Armando Garcia <jsancio@gmail.com>:
> On Sun, Feb 5, 2012 at 1:15 PM, xancorreu <xancorreu@gmail.com> wrote:
> > Al 05/02/12 05:26, En/na Jose Armando Garcia ha escrit:
> >>
> >> On Thu, Feb 2, 2012 at 4:48 PM, xancorreu<xancorreu@gmail.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> Is there any way for localizate and internationalizate messages? I were shocked if D has something like Fantom [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly ;-)
> >>
> >> I just glanced at Fantom because I am very much interesting in localization framework design. You really think that Fantom's localization design is better than gettext? What human language is "$<fwt::cancel.name>"?
> >
> >
> > So, in conclusion, what can I do for localize outputs of programs?
> >
> >
>
> I would suggest writing D binding for gettext and reading gettext documentation...
>
> "Most GNU packages have the ability to output messages in several languages. This native-language support (NLS) requires the LibIntl and the LibIconv libraries. On MS-Windows they have been adapted so that NLS chooses the system language, unless the environment variables LANG and LANGUAGE have been set. The language codes (ISO 639) for these environment variables are different from the MS-Windows ones. When using a program in a console window (command.com or cmd.exe) and setting LANG and LANGUAGE, you must also set the correct code page with the chcp command; for Western European languages, code page 1252 usually suffices. You can change the default code page by changing the OEMCP value in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
>
> For other languages, such as those with a Cyrillic character set, NLS may not operate correctly, unless a TrueType font with these characters has been chosen. If you want to disable NLS, then set the environment variables LANGUAGE and LANG to en; then all messages will be in English. "
>
> Hope that helps!
> -Jose
There's one problem with gettext though: It scans you source files for strings to translate. This means you must at least use the gettext C API exactly as in C and if you're lucky the C parser can extract the strings from the D source. If not, you'll need a D parser.
|
February 05, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Pfau | Al 05/02/12 18:30, En/na Johannes Pfau ha escrit:
> Am Sun, 5 Feb 2012 14:16:37 -0200
> schrieb Jose Armando Garcia<jsancio@gmail.com>:
>
>> On Sun, Feb 5, 2012 at 1:15 PM, xancorreu<xancorreu@gmail.com> wrote:
>>> Al 05/02/12 05:26, En/na Jose Armando Garcia ha escrit:
>>>> On Thu, Feb 2, 2012 at 4:48 PM, xancorreu<xancorreu@gmail.com>
>>>> wrote:
>>>>> Hi,
>>>>>
>>>>> Is there any way for localizate and internationalizate messages?
>>>>> I were shocked if D has something like Fantom
>>>>> [http://fantom.org/doc/docLang/Localization.html]. Gettext is
>>>>> pretty ugly ;-)
>>>> I just glanced at Fantom because I am very much interesting in
>>>> localization framework design. You really think that Fantom's
>>>> localization design is better than gettext? What human language is
>>>> "$<fwt::cancel.name>"?
>>>
>>> So, in conclusion, what can I do for localize outputs of programs?
>>>
>>>
>> I would suggest writing D binding for gettext and reading gettext
>> documentation...
>>
>> "Most GNU packages have the ability to output messages in several
>> languages. This native-language support (NLS) requires the LibIntl and
>> the LibIconv libraries. On MS-Windows they have been adapted so that
>> NLS chooses the system language, unless the environment variables LANG
>> and LANGUAGE have been set. The language codes (ISO 639) for these
>> environment variables are different from the MS-Windows ones. When
>> using a program in a console window (command.com or cmd.exe) and
>> setting LANG and LANGUAGE, you must also set the correct code page
>> with the chcp command; for Western European languages, code page 1252
>> usually suffices. You can change the default code page by changing the
>> OEMCP value in the registry key
>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
>>
>> For other languages, such as those with a Cyrillic character set, NLS
>> may not operate correctly, unless a TrueType font with these
>> characters has been chosen. If you want to disable NLS, then set the
>> environment variables LANGUAGE and LANG to en; then all messages will
>> be in English. "
>>
>> Hope that helps!
>> -Jose
> There's one problem with gettext though: It scans you source files for
> strings to translate. This means you must at least use the gettext C
> API exactly as in C and if you're lucky the C parser can extract the
> strings from the D source. If not, you'll need a D parser.
>
So, out of my scope and "probably this does not work". For this reason I ask for "official solution". None, it sounds very very bad.
What do you think I could do practically?
Xan.
|
February 05, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
Posted in reply to xancorreu | On Sunday, 5 February 2012 at 18:19:20 UTC, xancorreu wrote:
> So, out of my scope and "probably this does not work". For this reason I ask for "official solution". None, it sounds very very bad.
> What do you think I could do practically?
It's simple: when there's no ready existing solution, you write your own. This is what programming is all about.
|
February 05, 2012 Re: i18n | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | Al 05/02/12 20:22, En/na Kagamin ha escrit:
> On Sunday, 5 February 2012 at 18:19:20 UTC, xancorreu wrote:
>> So, out of my scope and "probably this does not work". For this reason I ask for "official solution". None, it sounds very very bad.
>> What do you think I could do practically?
>
> It's simple: when there's no ready existing solution, you write your own. This is what programming is all about.
Even more simple: the main developers see the request and make a library for that ;-). So no tedious (and majorty of times repeated) task.
Xan.
|
Copyright © 1999-2021 by the D Language Foundation