How to save translatable strings in a script

Project:Smoking is cool!
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Project wiki:Smoking is cool! (multi-language open animation project)
Related pages:#1233: Translation tools
Description

Text-based textures will be create from the command line:
#1228: How to create the title cards on the command line

How to set the project up so that all strings are easily translatable?

Comments

#1

How to add localization support to your bash scripts
http://mywiki.wooledge.org/BashFAQ/098

#2

Related pages:+1233: Translation tools

#3

$ env | egrep 'LC|LANG'
LC_MESSAGES=en_GB.UTF-8
LANG=en_GB.UTF-8
LANGUAGE=en_GB

$ LANGUAGE=es_ES

$ env | egrep 'LC|LANG'
LC_MESSAGES=en_GB.UTF-8
LANG=en_GB.UTF-8
LANGUAGE=es_ES

$ dpkg-reconfigure locales
/usr/sbin/dpkg-reconfigure debe ejecutarse como root

#4

msgfmt -o translations/fr/LC_MESSAGES/hello.mo translations/fr/hello.po
export LANGUAGE=fr_FR

#5

LANGUAGE=fr_FR TEXTDOMAINDIR=/home/overshoot/blender/overshoot-blender-projects/smoking.is.cool/translations/ gettext -d hello -s "Hello, world"
Bonjour le monde

#6

http://mywiki.wooledge.org/BashFAQ/098
Having followed the above tutorial, everything worked but the last, most important step: running the script didn't translate strings.
Finally, I found the solution here:
http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scr...
In my bash script, I had to replace all the echo statements with eval_gettext statements.

#7

Tags:+gettext

#8

msgmerge: invalid multibyte sequence
http://linux.overshoot.tv/ticket/376
[Edit: SOLVED]

#9

Status:active» fixed

It's working. Check the wiki for details and links.

#10

Status:fixed» closed
Related pages:-1233: Translation tools

Automatically closed -- issue fixed for 2 weeks with no activity.

#11

Related pages:+1233: Translation tools
Tags:+Version 1