Forums

How to specify TEXTDOMAINDIR?

How to configure i18n in a script?

Auteur Réponses
PhoneixS Jeudi 10 Mars 2016 à 9:38
PhoneixS

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:

#!/bin/bash
# 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
TEXTDOMAIN=messages

# 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 Jeudi 17 Mars 2016 à 9:22
PhoneixS

No one knows it?

MTres19 Vendredi 6 Mai 2016 à 16:18
MTres19Anonymous

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

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com