El Foro

How to specify TEXTDOMAINDIR?

How to configure i18n in a script?

Autor Respuestas
PhoneixS Thursday 10 March 2016 at 9:38

I'm more or less ready to release my script for GHC program, I have localized the script  with gettext and made translations into Spanish and English. The problem I found is that normally when I i18n a script a use `TEXTDOMAINDIR=./` however when running the script through POL (Tools/Run script) it don't get localized because the script don't run in the same folder it is.

Other scripts I have saw don't have `. gettext.sh` at all!

I think that wiki page (http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_10:_Script_Translation) need more information for begginers.

So my question is, how I configure TEXTDOMAINDIR? Is it necessary to configure it or to add `. gettext.sh`?

This is the start of my script:

# Date : 2012-09-05 12-07
# Last revision : 2016-02-24 12-15
# Wine version used : 1.3.9
# Distribution used to test : Ubuntu 14.04
# Author : Javier Alfonso <jabellota@penalara.com>

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

. gettext.sh

# TEXTDOMAIN specifies the .mo file name

# TEXTDOMAINDIR specifies base location .mo files lies in.
TEXTDOMAINDIR="/home/jabellota/Proyectos/ghc playonlinux/"

# This will be the title of the installer.
TITLE="$(eval_gettext 'School Timetable Generator')"
PhoneixS Thursday 17 March 2016 at 9:22

No one knows it?

MTres19 Friday 6 May 2016 at 16:18

I personally haven't ever used that, but I'm not familier with gettext. I just followed what's on the wiki.