Quantcast

Re: How to enable national language support (NLS)and install lanugage packge?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable national language support (NLS)and install lanugage packge?

LI An-Bang
Thanks Eli Zaretskii for the reply.

I am sorry for my inaccuracy. Yes, I mean GCC and I want GCC to write out compiling messages in Chinese. 

I repeated my actions again.  Then I realized that I was confused with MinGW, MinGW-w64 and TDM-GCC. Their default configuration of NLS are quite different: gcc 4.9.3 in MinGW has "--enable-nls", but both gcc 5.3.0 in MinGW-w64 and gcc 4.9.2 in TDM-GCC have "--disable-nls".

Since this is the Mingw-users' maillist, now, my questions are: how could I get Mingw's NLS package, i.e. "gcc-4.9.3-1-mingw32-lang.tar.xz"? And, how to configure it so that GCC will write out compiling messages in Chinese?

Thanks in advance.

------------------
LI AnBang
Physics Department, Central China Normal University, China
 

------------------ Original ------------------
From:  "Eli Zaretskii";<[hidden email]>;
Date:  Sat, May 7, 2016 02:46 PM
To:  "MinGW Users List"<[hidden email]>;
Subject:  Re: [Mingw-users] How to enable national language support (NLS)and install lanugage packge?

> From: "LI An-Bang" <[hidden email]>
> Date: Sat, 7 May 2016 11:21:31 +0800
>
> I am a Chinese user of MinGW on Windows. I want MinGW to write out compiling messages in Chinese.
> After some search and analysis on Internet, I realized that I should enable MinGW's national language support
> (NLS), and I also noticed that the released version has configured with "--disable-nls".
>
> So, my question is, how can I enable national language (NLS) support and install lanugage packge?

What do you mean by "MinGW" in this context?  Do you mean GCC?  How
did you notice that the released version was configured with --disable-nls?

In general, this setting is per-package.  For example, I have MinGW
GCC 4.9.3 installed on the system where I'm typing this, and it says:

  D:\>gcc -v
  Using built-in specs.
  COLLECT_GCC=gcc
  COLLECT_LTO_WRAPPER=d:/usr/bin/../libexec/gcc/mingw32/4.9.3/lto-wrapper.exe
  Target: mingw32
  Configured with: ../src/gcc-4.9.3/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-nls
  Thread model: win32                                              ^^^^^^^^^^^^
  gcc version 4.9.3 (GCC)

The language-specific message catalogs come with the package.  They
are either part of the "binary" distribution, or might sometimes come
as a separate archive.  For example, for the above version of GCC, I
have gcc-4.9.3-1-mingw32-lang.tar.xz.


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable national language support (NLS)and install lanugage packge?

Eli Zaretskii
> From: "LI An-Bang" <[hidden email]>
> Date: Sat, 7 May 2016 20:49:24 +0800
>
> Since this is the Mingw-users' maillist, now, my questions are: how could I get Mingw's NLS package, i.e.
> "gcc-4.9.3-1-mingw32-lang.tar.xz"?

It's on the MinGW site.

> And, how to configure it so that GCC will write out compiling
> messages in Chinese?

You shouldn't need to configure anything.  As long as your system
codepage is Chinese, and assuming you unpack
gcc-4.9.3-1-mingw32-lang.tar.xz in the same directory tree where you
have GCC, GCC should start talking Chinese automatically.

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable national language support (NLS)and install lanugage packge?

Erwin Waterlander
Op 7-5-2016 om 16:13 schreef Eli Zaretskii:

>> From: "LI An-Bang" <[hidden email]>
>> Date: Sat, 7 May 2016 20:49:24 +0800
>>
>> Since this is the Mingw-users' maillist, now, my questions are: how could I get Mingw's NLS package, i.e.
>> "gcc-4.9.3-1-mingw32-lang.tar.xz"?
> It's on the MinGW site.
>
>> And, how to configure it so that GCC will write out compiling
>> messages in Chinese?
> You shouldn't need to configure anything.  As long as your system
> codepage is Chinese, and assuming you unpack
> gcc-4.9.3-1-mingw32-lang.tar.xz in the same directory tree where you
> have GCC, GCC should start talking Chinese automatically.

It doesn't always work out-of-the-box. Sometimes you need to help by
setting these variables:

set LANG=zh_CN
set LANGUAGE=zh_CN

regards,

Erwin Waterlander

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable national language support (NLS)and install lanugage packge?

Eli Zaretskii
> From: Erwin Waterlander <[hidden email]>
> Date: Mon, 9 May 2016 20:44:20 +0200
>
> >> And, how to configure it so that GCC will write out compiling
> >> messages in Chinese?
> > You shouldn't need to configure anything.  As long as your system
> > codepage is Chinese, and assuming you unpack
> > gcc-4.9.3-1-mingw32-lang.tar.xz in the same directory tree where you
> > have GCC, GCC should start talking Chinese automatically.
>
> It doesn't always work out-of-the-box. Sometimes you need to help by
> setting these variables:
>
> set LANG=zh_CN
> set LANGUAGE=zh_CN

Are you talking about GCC specifically, or generally about ported
packages?  If the latter, I understand and agree, but if the former,
then it'd mean GCC uses replacement setlocale functions (e.g., from
gnulib) or some private code to the same effect, because AFAIK the
native msvcrt.dll locale functions on Windows pay no attention
whatsoever to environment variables, they look only at the system-wide
locale settings.

Does GCC indeed cater to these variables?

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable national language support (NLS)and install lanugage packge?

Erwin Waterlander
Eli Zaretskii schreef op 2016-05-09 20:59:

>> From: Erwin Waterlander <[hidden email]>
>> Date: Mon, 9 May 2016 20:44:20 +0200
>>
>> >> And, how to configure it so that GCC will write out compiling
>> >> messages in Chinese?
>> > You shouldn't need to configure anything.  As long as your system
>> > codepage is Chinese, and assuming you unpack
>> > gcc-4.9.3-1-mingw32-lang.tar.xz in the same directory tree where you
>> > have GCC, GCC should start talking Chinese automatically.
>>
>> It doesn't always work out-of-the-box. Sometimes you need to help by
>> setting these variables:
>>
>> set LANG=zh_CN
>> set LANGUAGE=zh_CN
>
> Are you talking about GCC specifically, or generally about ported
> packages?  If the latter, I understand and agree, but if the former,
> then it'd mean GCC uses replacement setlocale functions (e.g., from
> gnulib) or some private code to the same effect, because AFAIK the
> native msvcrt.dll locale functions on Windows pay no attention
> whatsoever to environment variables, they look only at the system-wide
> locale settings.
>
> Does GCC indeed cater to these variables?
>

This is my experience in general with applications linked to libintl on
Windows. The behaviour can differ with libintl version or Windows
version (Win7/8 32/64 bit). Libintl is not always able to pick up the
locale from the Windows system locale setting . I read somewhere that
gcc has its private copy of libintl included. I don't know any specific
information about that. I assumed it would work the same as standard
libintl.

I forgot to mention that the system locale needs to be set to CP936.

regards,

--
Erwin Waterlander

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable national language support (NLS)and install lanugage packge?

Keith Marshall
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/05/16 08:19, waterlan wrote:
> Eli Zaretskii schreef op 2016-05-09 20:59:
>>> From: Erwin Waterlander It doesn't always work out-of-the-box.
>>> Sometimes you need to help by setting these variables:
>>>
>>> set LANG=zh_CN set LANGUAGE=zh_CN
>>
>> Does GCC indeed cater to these variables?

Yes.  GCC uses GNU's textdomain, (from GNU gettext, via libintl).  The
Windows builds may also attempt to honour Microsoft's locales, but any
of these, (or LC_* environment variable settings), should override.

It may be worth noting that, depending on your installation, you may
need to specify full (absolute) localization path names, (to whatever
directory contains the message catalogues), as explained here:
https://sourceforge.net/p/mingw/bugs/2108/?limit=25&page=2#482e

Also note follow-up comments to that, and that my experience was not
always consistent, w.r.t. behaviour of different environment
variables; in particular, setting LC_MESSAGES or LANGUAGE gave more
consistently reliable results than LC_ALL or LANG; (I don't know why).

> This is my experience in general with applications linked to
> libintl on Windows. The behaviour can differ with libintl version
> or Windows version (Win7/8 32/64 bit). Libintl is not always able
> to pick up the locale from the Windows system locale setting. I
> read somewhere that gcc has its private copy of libintl included.

I don't know where you read it, but yes, you are quite correct: the
GCC sources do indeed include (at least a subset of) the GNU libintl
code.  What's more, the GCC build process seems to favour static
linking with this embedded code, over dynamic linking with any
pre-existing libintl DLL which may be installed.  All of the GCC
builds, which I've posted recently, have statically linked libintl
code; I've not been able to circumvent that, (which suggests that
mingw-get's declared dependency on libintl-8.dll may, in fact, be bogus):

  $ objdump -x /mingw/bin/gcc.exe | grep DLL
        DLL Name: ADVAPI32.DLL
        DLL Name: KERNEL32.dll
        DLL Name: msvcrt.dll
        DLL Name: msvcrt.dll
        DLL Name: USER32.dll
        DLL Name: libiconv-2.dll

> I don't know any specific information about that. I assumed it
> would work the same as standard libintl.

Likewise, I don't know for certain, but I believe it does; the source
code does bear significant similarity to (parts of) GNU gettext.

- --
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJXMbufAAoJEMCtNsY0flo/BVoP/0UI5nJG9GvRBEpXwrkmwpm+
+HVg0V5sl20p5kFwU7EONnBPR8kQc3SgQwfpcTUp7gmV5m51LoGU1r+eFfTOHBG9
1v4AQGo2+tHG7XWFTY+obT8DhfxTQdAAxtSNAWLOgEtBbgf5rYbJHHSKpU6auYMA
No8L1OWFItW+leHT410PIaBoAphdCzuEdOS8xLvo05VR3T4+ELJRCnI7K+/x7J26
vt7oUV4Qp0IVcVIkBa4PRf1Brx7LbNd855ASmkue37thKjTUbVYY4doOb/CYMYE7
mApTAqQsOqo2CChMVXd/yTdg64NLjpRQq3Da6Q3kSkbFL79wK29nhUMCnIewgStL
CCj5Pms07uubMyfZLRtb16qLh7gKqEZgeXezqphAAd3PSxym3fARHrkEvlqNRWeF
vjHtDMvEKQoCYVbSD9tRJd+E225cafaseJWDlQDzBGWvXznYyIhyThNLpqnSIVUD
sAVxaoeGfTHSRT5BJ2ukB/bQkk7ehLY9Lx0XCaxr4JCL5528SOdiq/hxkRjHCzFR
UVf27+BE0aQMO8S/M3tutVegMSsLjTImE7I17eF6ZXVTrxMXv0qtY+HHbO+zwBOn
xOd7umJ+pC4z4eNykZk55OJG5jRYL7XfzBFIB9i54MumgggKgLt2dnuMcC3znDnK
4D66Sx25WHgL2QgAXGKN
=saOM
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enable national language support (NLS)and install lanugage packge?

Eli Zaretskii
> From: Keith Marshall <[hidden email]>
> Date: Tue, 10 May 2016 11:44:47 +0100
>
> >>> set LANG=zh_CN set LANGUAGE=zh_CN
> >>
> >> Does GCC indeed cater to these variables?
>
> Yes.  GCC uses GNU's textdomain, (from GNU gettext, via libintl).  The
> Windows builds may also attempt to honour Microsoft's locales, but any
> of these, (or LC_* environment variable settings), should override.

Thanks for the info.

> It may be worth noting that, depending on your installation, you may
> need to specify full (absolute) localization path names, (to whatever
> directory contains the message catalogues), as explained here:
> https://sourceforge.net/p/mingw/bugs/2108/?limit=25&page=2#482e

Having to set LANGUAGE or LC_MESSAGES to an absolute file name is
weird.  I guess it only works because Windows doesn't support
LC_MESSAGES natively, so the value never gets to setlocale.

> Also note follow-up comments to that, and that my experience was not
> always consistent, w.r.t. behaviour of different environment
> variables; in particular, setting LC_MESSAGES or LANGUAGE gave more
> consistently reliable results than LC_ALL or LANG; (I don't know why).

Not sure whether this is relevant (I didn't look at the code which
implements this stuff in GCC and/or libintl), but there's a subtle
asymmetry in how msvcrt's setlocale treats the different categories.
Specifically, only LC_ALL may specify the codeset (a.k.a. "codepage")
part of the value; if any other category specifies a codeset, Windows
will not change the codepage.  The URL above doesn't show any examples
of changing a codepage, so I'm not sure this is relevant.

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Loading...