[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use $"msgid"?
From: |
Jesse Hathaway |
Subject: |
Re: How to use $"msgid"? |
Date: |
Tue, 23 Mar 2021 22:08:02 -0500 |
On Tue, Mar 23, 2021 at 5:54 PM Peng Yu <pengyu.ut@gmail.com> wrote:
> I don't get it. Could you show the exact sequence of commands (without
> any dummy strings) so that it works out of box?
These steps worked for me on a fresh Debian Sid image:
$ cd ~
$ 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
$ bash hello.sh
Hola Mundo