bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash: Translation support (i18n/l10n)


From: Karl Eichwalder
Subject: Bash: Translation support (i18n/l10n)
Date: 10 Jul 2001 08:58:49 +0200

Hello,

I'm happy to see you can write bash scripts with native language
support!  I like to propose the following documentation improvements
(more index entries):

--- bash-2.05/doc/bashref.texi.~1~      Wed Mar 28 21:49:52 2001
+++ bash-2.05/doc/bashref.texi  Tue Jul 10 08:24:42 2001
@@ -556,6 +556,9 @@
 @node Locale Translation
 @subsubsection Locale-Specific Translation
 @cindex localization
address@hidden internationalization
address@hidden native languages
address@hidden translation, native languages
 
 A double-quoted string preceded by a dollar sign (@samp{$}) will cause
 the string to be translated according to the current locale.
@@ -564,6 +567,9 @@
 If the string is translated and replaced, the replacement is
 double-quoted.
 
address@hidden LC_MESSAGES
address@hidden TEXTDOMAIN
address@hidden TEXTDOMAINDIR
 Some systems use the message catalog selected by the @env{LC_MESSAGES}
 shell variable.  Others create the name of the message catalog from the
 value of the @env{TEXTDOMAIN} shell variable, possibly adding a

Diff finished at Tue Jul 10 08:34:43

I've the feeling the text is a little bit misleading.  Normally, there's
no "use either LC_MESSAGES or TEXTDOMAIN".  Actually, the variables
will expand this way:

    $TEXTDOMAINDIR/$LC_MESSAGES/LC_MESSAGES/$TEXTDOMAIN.mo
    = 'my/path/locale'          ^^^^^^^^^^^ |
                   = 'it' (the locale)      = 'hello' (the domain)


With ^^^^^^^ I'm marking a literal string; example:

    /usr/share/locale/it/LC_MESSAGES/hello.mo
    |                 |  |           +- TEXTDOMAIN (e.g., 'hello')
    |                 |  +------------- literal
    |                 +---------------- LC_MESSAGES (here the user wants
    |                                   'it') 
    +---------------------------------- TEXTDOMAINDIR

Instead of $LC_MESSAGES you can use $LANG (or even $LC_ALL) to specify
the language you're interested in (I'm not sure whether bash honors this
variables, too).  Cf. the gettext manual, 'Locating Message Catalog
Files'.

-- 

address@hidden (work) / address@hidden (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]