ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] Q: locale(7) hell
Date: Tue, 14 Dec 2004 13:30:57 +0300
Message-ID: <20041214103057.GB32499@basalt.office.altlinux.org> (raw)
In-Reply-To: <20041214090540.GB16434@immo.ru>

[-- Attachment #1: Type: text/plain, Size: 2283 bytes --]

On Tue, Dec 14, 2004 at 12:05:40PM +0300, Alexey I. Froloff wrote:
> * Alexey I. Froloff <raorn@> [041214 11:29]:
> > Всвязи с этим вопрос - куда девать ГНУтое расширение под
> > названием LANGUAGE?  Вариантов два:
> Посмотрел как сделано в gettext...
> 
> Если есть LANGUAGE - использовать его, при условии что данная
> категория локали не выставлена в "C"...
> 
> Однако берут меня сомнения...  У LC_ALL должен быть самый большой
> приоритет.

В gettext(3) написано следующее:

Translation lookup operates in the context of the current locale.
For the gettext and dgettext functions, the LC_MESSAGES locale facet
is used.  It is determined by a preceding call to the setlocale function.
setlocale(LC_ALL,"") initializes the LC_MESSAGES locale based on the first
nonempty value of the three environment variables LC_ALL, LC_MESSAGES,
LANG; see setlocale(3).  For the dcgettext function, the locale facet
is determined by the category argument, which should be one of the
LC_xxx constants defined in the <locale.h> header, excluding LC_ALL.
In both cases, the functions also use the LC_CTYPE locale facet in
order to convert the translated message from the translator's codeset
to the current locale's codeset, unless overridden by a prior call to
the bind_textdomain_codeset function.

The message catalog used by the functions is at the pathname
dirname/locale/category/domainname.mo.  Here dirname is the directory
specified through bindtextdomain.  Its default is system and configuration
dependent; typically it is prefix/share/locale, where prefix is the
installation prefix of the package.  locale is the name of the current
locale facet; the GNU implementation also tries generalizations, such as
the language name without the territory name.  category is LC_MESSAGES
for the gettext and dgettext functions, or the argument passed to the
dcgettext function.

If the LANGUAGE environment variable is set to a nonempty value, and
the locale is not the "C" locale, the value of LANGUAGE is assumed
to contain a colon separated list of locale names.  The functions will
attempt to look up a translation of msgid in each of the locales in turn.
This is a GNU extension.

Было бы разумно реализовать аналогичное поведение.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-12-14 10:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14  8:28 Alexey I. Froloff
2004-12-14  9:05 ` Alexey I. Froloff
2004-12-14 10:30   ` Dmitry V. Levin [this message]
2004-12-15  9:07     ` Sergey V Turchin
2004-12-15  9:12       ` Alexey I. Froloff
2004-12-15 11:58         ` Sergey V Turchin
2004-12-15 12:01           ` Alexey I. Froloff
2004-12-15 12:04             ` Sergey V Turchin
2004-12-15 12:02           ` Sergey V Turchin
2004-12-15 10:13       ` Dmitry V. Levin
2004-12-15 10:38         ` Sergey V Turchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041214103057.GB32499@basalt.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git