[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using whiptail and translated strings from arbitrary scripts



Hi,

On Wed, Apr 27, 2016 at 02:28:22PM +0200, Daniel Pocock wrote:
> 
> 
> On 27/04/16 14:00, Antonio Terceiro wrote:
> > On Tue, Apr 26, 2016 at 09:32:02PM +0200, Daniel Pocock wrote:
> >> 
> >> It is well documented how developers should create po files for
> >> i18n support in their debconf configuration questions during
> >> package install[1].
> >> 
> >> What about arbitrary scripts that are run from the command line
> >> and don't use debconf to store the user responses?  How should
> >> they interact with whiptail and translated strings?  Is there
> >> either a document explaining how to do this or any existing
> >> script that provides a good example, in a way that makes it easy
> >> for Debian translators to support the package containing the
> >> script?
> > 
> > the gettext documentation itself?
> > 
> > https://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html
> >
> >  All you need to do is make sure is that the installed package puts
> > the compiled .mo files in the right location so gettext finds
> > them.

If you are looking for an example code, I have one for you as im-config
(*).

im-config is an i18n shell script with Gnome/KDE/dialog interface.  Most
asain localization tasks include this.

 https://packages.qa.debian.org/i/im-config.html
 http://anonscm.debian.org/cgit/collab-maint/im-config.git

Oops.  Aron added the new whiptail support.  Time to package a new
version :-)

*) im-config is not run during the installation since it's configuration
system sets the most reasonable choice as default.  But user can change
it via console/GUI.

Osamu

PS: If I had more time, I could have written it in Python to be nicer
looking ... but the shell approach was simple and light by not
introducing many dependencies.
 


Reply to: