A
A
Andrey Shiryaev2011-09-17 14:15:52
PowerShell
Andrey Shiryaev, 2011-09-17 14:15:52

Problem with gettext and bash?

Hello.
I'm struggling with gettext and xgettext for bash script localization. And constantly, one thing or the other does not work. Now, for some reason, the --from-code=utf-8 key stopped working and instead of utf-8 in the resulting .po file, it displays:

&quot;Content-Type: text/plain; charset=CHARSET\n&quot;<br/>

And should
&quot;Content-Type: text/plain; charset=utf-8\n&quot;<br/>

PS The problem appeared for a reason I do not understand. Those. I do everything as before (before everything was OK), but the result is not the same.
UPD1 The problem has become clearer6 it appears if msgid are written in English (Latin). There is no problem with Cyrillic.
UPD2
An example of localized code:
echo &quot;`gettext 'Text text text...'`&quot;
The command of which I generate a .po file (with variables in full order):
xgettext -c -inL Shell --package-name=&quot;$SA_EXT_ID&quot; --package-version=&quot;$SA_EXT_VERSION&quot; --msgid-bugs-address=&quot;$SA_EXT_EMAIL&quot; --copyright-holder=&quot;$SA_EXT_AUTHOR&quot; --from-code=UTF-8 --force-po -o &quot;${output_file}t&quot; &quot;$input_file&quot;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
temaHT, 2011-09-17
@temaHT

Andrey, can you write the full text of the command you use, and the minimum piece of the bash script that you localize?
I faced a similar problem a couple of years ago, but to remember the solution, details are needed ...

B
Borro, 2011-09-18
@Borro

You can add to the file using the flag --join-existing, set all the settings in the updated po file as you need and add the flag--omit-header

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question