help-bash
[Top][All Lists]
Advanced

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

Re: How to use $"msgid"?


From: Peng Yu
Subject: Re: How to use $"msgid"?
Date: Wed, 24 Mar 2021 08:48:41 -0500

> These steps worked for me on a fresh Debian Sid image:
>
> $ cd ~

Just to make sure. It doesn't seem to go to home in this case? Am I correct?

> $ cat <<EOF >hello.sh
> #!/bin/bash
> LANG=es_ES.UTF-8
> TEXTDOMAINDIR=~+/locale
> TEXTDOMAIN=hello
> echo $"Hello, world"
> EOF
> $ cat <<EOF >hello.pot
> #: hello.sh:5
> msgid "Hello, world"
> msgstr "Hola Mundo"
> EOF
> $ mkdir -p ~+/locale/es_ES/LC_MESSAGES
> $ apt-get install gettext
> $ msgfmt -o ~+/locale/es_ES/LC_MESSAGES/hello.mo hello.pot
> # This is necessary to get the base files needed for the es_ES locale
> $ apt-get install locales-all

I see these files. How are they used for `LANG=es_ES.UTF-8`? It seems
that all info is in ~+/locale/es_ES/LC_MESSAGES/hello.mo. I don't
under how files in locales-all are used?

$ apt-file list locales-all |grep 'es_ES[.]utf8'
locales-all: /usr/lib/locale/es_ES.utf8/LC_ADDRESS
locales-all: /usr/lib/locale/es_ES.utf8/LC_COLLATE
locales-all: /usr/lib/locale/es_ES.utf8/LC_CTYPE
locales-all: /usr/lib/locale/es_ES.utf8/LC_IDENTIFICATION
locales-all: /usr/lib/locale/es_ES.utf8/LC_MEASUREMENT
locales-all: /usr/lib/locale/es_ES.utf8/LC_MESSAGES/SYS_LC_MESSAGES
locales-all: /usr/lib/locale/es_ES.utf8/LC_MONETARY
locales-all: /usr/lib/locale/es_ES.utf8/LC_NAME
locales-all: /usr/lib/locale/es_ES.utf8/LC_NUMERIC
locales-all: /usr/lib/locale/es_ES.utf8/LC_PAPER
locales-all: /usr/lib/locale/es_ES.utf8/LC_TELEPHONE
locales-all: /usr/lib/locale/es_ES.utf8/LC_TIME

> $ bash hello.sh
> Hola Mundo

-- 
Regards,
Peng



reply via email to

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