[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
advice on marking strings in bash scripts
From: |
Eric Blake |
Subject: |
advice on marking strings in bash scripts |
Date: |
Tue, 14 Dec 2010 11:32:53 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
http://www.gnu.org/software/gettext/manual/gettext.html#xgettext-Invocation
doesn't mention 'xgettext -L Shell' as a valid option, but xgettext
--help does (I'm using xgettext 0.18.1).
Meanwhile, I'm trying to figure out how to mark strings for translation
in a shell script. According to
http://www.gnu.org/software/gettext/manual/gettext.html#bash, use of $""
in bash is discouraged because bash mistakenly re-interprets translated
contents, allowing a translator to inject arbitrary shell commands.
Besides, since $"" is a bash-ism, when porting a script to POSIX sh
(such as dash), you'd have to go through gettext(1) anyways.
But the documentation for xgettext wasn't very clear on what it looks
for when using -L Shell mode. Is it only picking up bash's $"", or does
it also look for 'gettext "string"' patterns when figuring out which
strings to mark?
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- advice on marking strings in bash scripts,
Eric Blake <=