Get .pot file from a 'gettexted' application script [SOLVED]
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Get .pot file from a 'gettexted' application script [SOLVED]
Hello,
All is in the title...
Is there a command line which allows to get a pot file directly from a 'gettexted' application script?
Thank you for your attention.
Cordialement.
All is in the title...
Is there a command line which allows to get a pot file directly from a 'gettexted' application script?
Thank you for your attention.
Cordialement.
Last edited by Argolance on Tue 06 Nov 2012, 21:26, edited 2 times in total.
Re: How to get pot file from a gettexted script
Allô, argolance.Argolance wrote:Hello,
All is in the title...
Is there a command line which allows to get a pot file directly from a 'gettexted' script?
Thank you for your attention.
Cordialement.
How to get a "pot" file ?
As the above is written, if I was from the RCMP drug squad, I'd put a tail on you! What are you talking about? /
Comment obtenir un fichier de "pot" ?
Tel que ton message ci-dessus est écrit, si j'étais de l'escouade des stup. de la GRC, je te prendrais en filature ! De quoi tu parles, là ?
A+
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello musher0,
Thank you for answering.
When a script has to be internationalized with "gettext", it is consequently modified for. Ex: the chain "Do you smoke?" is changed as a gettext variable:
All the chains (Ex: "Yes I do!" ) of the application are then written in a special file, Ex: my_application.pot from which is built a .po file, specific to a particular language, from which is created a .mo file, usually stored inside /usr/share/locale... This .pot file can be built manually. But it is sometimes long, boring, and especially precarious, because it is easy to make errors, making .mo files not to work properly.
I just would like to know if a command line could create the .pot file automatically directly from tlhe gettexted application script? Or perhaps a special simple application?
Cordialement.
Thank you for answering.
This really made me burst of laughing... So, it is not a tail, but a spell you put on me!As the above is written, if I was from the RCMP drug squad, I'd put a tail on you! What are you talking about?
When a script has to be internationalized with "gettext", it is consequently modified for. Ex: the chain "Do you smoke?" is changed as a gettext variable:
Code: Select all
$(gettext 'Do you smoke')
I just would like to know if a command line could create the .pot file automatically directly from tlhe gettexted application script? Or perhaps a special simple application?
Cordialement.
Last edited by Argolance on Wed 07 Nov 2012, 09:03, edited 1 time in total.
pot-file from script
The command is (devx.sfs is needed):
or if you want to see it's content in terminal:
Code: Select all
xgettext -L shell file.sh -o file.pot
Code: Select all
xgettext -L shell file.sh -o -
Re: pot-file from script
What if the script isn't gettexted yet? Is there a command to gettext a script?rodin.s wrote:The command is (devx.sfs is needed):or if you want to see it's content in terminal:Code: Select all
xgettext -L shell file.sh -o file.pot
Code: Select all
xgettext -L shell file.sh -o -
[url=http://murga-linux.com/puppy/viewtopic.php?t=76948]Puppy Linux en español[/url]
command to gettext a script
Would be nice but it has to be dome manually.
Re: command to gettext a script
rodin.s wrote:Would be nice but it has to be dome manually.
Let's say I want to gettext the script in this PET. What modifications should I do? Is it the same for all scripts or it depends on the type of script?
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Re: command to gettext a script
I have exactly the same question.vicmz wrote:...Let's say I want to gettext the script in this PET. What modifications should I do? Is it the same for all scripts or it depends on the type of script?
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Re: command to gettext a script
I managed to translate wmswitcher, I will send the packet to 01micko to know what he thinks about.ASRI éducation wrote:I have exactly the same question.vicmz wrote:...Let's say I want to gettext the script in this PET. What modifications should I do? Is it the same for all scripts or it depends on the type of script?
Infos to translate /usr/share/doc/HOWTO-internatialization.htm
Re: command to gettext a script
Me too. In fact, for apps such as wmswitcher, desksetup, pupshutdown, pmount, jwm config., etc., I've been translating the scripts directly, but this must be done with patience and care to avoid breaking the code, which will cause the app to not work. Also, if you manage to gettext an app you're giving others the chance to translate to their language by just installing it and using momanager. Another advantage is that the new gettexted apps are put into woof, then you just have to put the .mo file in the langpack. Official language packs are not meant to include any executables to ensure compatibility across Puppy versions, so the apps I translate by modifying the scripts have to be offered separately. If there are new versions of those apps, I have to translate the scripts again from scratch, while for gettexted apps you just have to update through momanager.ASRI éducation wrote: I managed to translate wmswitcher
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
wmswitcher
Hello world
I do not know what you have been translating...
here is
wmswitcher internationalized
translatable now using momanager
cheers
I do not know what you have been translating...
here is
wmswitcher internationalized
translatable now using momanager
cheers
/usr/sbin/wmswitcher wrote:#!/bin/sh -a
#simple switcher for whatever WM and back
#01micko 2010 GPL see /usr/share/doc/legal/
#Backup /usr/bin/restartwm (and hide it)
#ver 0.1 #2010-07-11
#ver 0.3 #2010-07-12
#ver 0.4 #2010-07-25
#ver 0.5 #2010-08-01
#ver 0.6 #2010-10-17
#ver 0.7 #2010-10-28
#ver 0.7 #2010-10-31
#ver 0.10 #2010-11-04
#ver 0.11 #2010-11-06
#ver 0.12 #2010-11-06
#ver 0.13 #2010-11-07
#ver 0.14 #2010-11-09
#ver 0.16 #2011-01-03
#ver 0.17 #2011-06-11
#ver 0.18 #20120318
#ver 0.19 #20121110 internationalized
#set -x
ver="0.19"
export TEXTDOMAIN=wmswitcher
export OUTPUT_CHARSET=UTF-8
#find images for gui
IMGDIR="/usr/share/pixmaps"
CURRENTWM=`cat /etc/windowmanager`
#icewm changer
ICEWM(){
if [ -f $HOME/.gtkrc-2.0.bak ];then mv -f $HOME/.gtkrc-2.0.bak $HOME/.gtkrc-2.0
fi
echo 'icewm'> /tmp/nextwm
restartwm icewm
[ "$CURRENTWM" = "openbox" ]&& killall fbpanel
[[ "$CURRENTWM" = "startxfce4" || "$CURRENTWM" = "startfluxbox" || "$CURRENTWM" = "startkde" ]]&& killall X
}
#jwm changer
JWM(){
if [ -f $HOME/.gtkrc-2.0.bak ];then mv -f $HOME/.gtkrc-2.0.bak $HOME/.gtkrc-2.0
fi
echo 'jwm'> /tmp/nextwm
rm -f /tmp/wmswithcer
restartwm jwm
[ "$CURRENTWM" = "openbox" ]&& killall fbpanel
[[ "$CURRENTWM" = "startxfce4" || "$CURRENTWM" = "startfluxbox" || "$CURRENTWM" = "startkde" ]]&& killall X
}
#xfce4 changer #ditto icewm comment
XFCE(){
if [ -f $HOME/.gtkrc-2.0 ];then mv -f $HOME/.gtkrc-2.0 $HOME/.gtkrc-2.0.bak
fi
restartwm startxfce4
[ "$CURRENTWM" = "openbox" ]&& killall fbpanel
[[ "$CURRENTWM" = "startxfce4" || "$CURRENTWM" = "startfluxbox" || "$CURRENTWM" = "startkde" ]]&& killall X
}
#openbox
OPENBOX(){
if [ -f $HOME/.gtkrc-2.0.bak ];then mv -f $HOME/.gtkrc-2.0.bak $HOME/.gtkrc-2.0
fi
echo 'openbox'> /tmp/nextwm
restartwm openbox
[ "$CURRENTWM" = "openbox" ]&& killall fbpanel
[[ "$CURRENTWM" = "startxfce4" || "$CURRENTWM" = "startfluxbox" || "$CURRENTWM" = "startkde" ]]&& killall X
}
#fluxbox
FLUXBOX(){
if [ -f $HOME/.gtkrc-2.0.bak ];then mv -f $HOME/.gtkrc-2.0.bak $HOME/.gtkrc-2.0
fi
echo 'startfluxbox'> /tmp/nextwm
restartwm startfluxbox
[ "$CURRENTWM" = "openbox" ]&& killall fbpanel
[[ "$CURRENTWM" = "startxfce4" || "$CURRENTWM" = "startfluxbox" || "$CURRENTWM" = "startkde" ]]&& killall X
}
#kde
KDE(){
if [ -f $HOME/.gtkrc-2.0 ];then mv -f $HOME/.gtkrc-2.0 $HOME/.gtkrc-2.0.bak
fi
restartwm startkde
[ "$CURRENTWM" = "openbox" ]&& killall fbpanel
[[ "$CURRENTWM" = "startxfce4" || "$CURRENTWM" = "startfluxbox" || "$CURRENTWM" = "startkde" ]]&& killall X
}
#emerald changer
EMERALD(){
if [ -f $HOME/.gtkrc-2.0.bak ];then mv -f $HOME/.gtkrc-2.0.bak $HOME/.gtkrc-2.0
fi
echo 'dummy'> /tmp/nextwm
restartwm dummy
[ "$CURRENTWM" = "openbox" ]&& killall fbpanel
[[ "$CURRENTWM" = "startxfce4" || "$CURRENTWM" = "startfluxbox" || "$CURRENTWM" = "startkde" ]]&& killall X
}
#switch function
SWITCH(){
if [ $RADIOBUTTON1 = true ];then JWM
elif [ $RADIOBUTTON2 = true ];then ICEWM
elif [ $RADIOBUTTON3 = true ];then XFCE
elif [ $RADIOBUTTON4 = true ];then OPENBOX
elif [ $RADIOBUTTON5 = true ];then FLUXBOX
elif [ $RADIOBUTTON6 = true ];then KDE
elif [ $RADIOBUTTON7 = true ];then EMERALD
fi
}
#current window manager and radio button defaults
case $CURRENTWM in
jwm) RADIOBUTTON1=true
RADIOBUTTON2=false
RADIOBUTTON3=false
RADIOBUTTON4=false
RADIOBUTTON5=false
RADIOBUTTON6=false
RADIOBUTTON7=false
;;
icewm*) RADIOBUTTON2=true
RADIOBUTTON1=false
RADIOBUTTON3=false
RADIOBUTTON4=false
RADIOBUTTON5=false
RADIOBUTTON6=false
RADIOBUTTON7=false
;;
startxfce4*) RADIOBUTTON3=true
RADIOBUTTON2=false
RADIOBUTTON1=false
RADIOBUTTON4=false
RADIOBUTTON5=false
RADIOBUTTON6=false
RADIOBUTTON7=false
;;
openbox) RADIOBUTTON4=true
RADIOBUTTON2=false
RADIOBUTTON3=false
RADIOBUTTON1=false
RADIOBUTTON5=false
RADIOBUTTON6=false
RADIOBUTTON7=false
;;
startfluxbox) RADIOBUTTON5=true
RADIOBUTTON2=false
RADIOBUTTON3=false
RADIOBUTTON4=false
RADIOBUTTON1=false
RADIOBUTTON6=false
RADIOBUTTON7=false
;;
startkde) RADIOBUTTON6=true
RADIOBUTTON5=false
RADIOBUTTON2=false
RADIOBUTTON3=false
RADIOBUTTON4=false
RADIOBUTTON1=false
RADIOBUTTON7=false
;;
dummy) RADIOBUTTON7=true
RADIOBUTTON5=false
RADIOBUTTON2=false
RADIOBUTTON3=false
RADIOBUTTON4=false
RADIOBUTTON1=false
RADIOBUTTON6=false
;;
*)echo "woops, unsupported"; exit
;;
esac
#find window managers!
JWM_IS=`which jwm`
ICEWM_IS=`which icewm`
XFCE4_IS=`which xfwm4`
OPENBOX_IS=`which openbox`
FLUXBOX_IS=`which startfluxbox`
KDE_IS=`which startkde`
EMERALD_IS=`which dummy`
#GUI vars
if [[ "$JWM_IS" != "" ]];then JWMGUI="
<radiobutton>
<variable>RADIOBUTTON1</variable>
<label>"JWM"</label>
<default>$RADIOBUTTON1</default>
</radiobutton>
<pixmap><input file>$IMGDIR/jwm.png</input></pixmap>
"
fi
if [[ "$ICEWM_IS" != "" ]];then ICEWMGUI="
<radiobutton>
<variable>RADIOBUTTON2</variable>
<label>"IceWM"</label>
<default>$RADIOBUTTON2</default>
</radiobutton>
<pixmap><input file>$IMGDIR/icewm-logo.png</input></pixmap>
"
fi
if [[ "$XFCE4_IS" != "" ]];then XFCEGUI="
<radiobutton>
<variable>RADIOBUTTON3</variable>
<label>"Xfce4"</label>
<default>$RADIOBUTTON3</default>
</radiobutton>
<pixmap><input file>$IMGDIR/xfce4_xicon3.png</input></pixmap>
"
fi
if [[ "$OPENBOX_IS" != "" ]];then OPENBOXGUI="
<radiobutton>
<variable>RADIOBUTTON4</variable>
<label>"Openbox"</label>
<default>$RADIOBUTTON4</default>
</radiobutton>
<pixmap><input file>$IMGDIR/openbox1.png</input></pixmap>
"
fi
if [[ "$FLUXBOX_IS" != "" ]];then FLUXGUI="
<radiobutton>
<variable>RADIOBUTTON5</variable>
<label>"Fluxbox"</label>
<default>$RADIOBUTTON5</default>
</radiobutton>
<pixmap><input file>$IMGDIR/fluxbox.png</input></pixmap>
"
fi
if [[ "$KDE_IS" != "" ]];then KDEGUI="
<radiobutton>
<variable>RADIOBUTTON6</variable>
<label>"Kde"</label>
<default>$RADIOBUTTON6</default>
</radiobutton>
<pixmap><input file>$IMGDIR/kde.png</input></pixmap>
"
fi
if [[ "$EMERALD_IS" != "" ]];then EMERALDGUI="
<radiobutton>
<variable>RADIOBUTTON7</variable>
<label>"Emerald-compiz"</label>
<default>$RADIOBUTTON7</default>
</radiobutton>
<pixmap><input file>$IMGDIR/emerald.png</input></pixmap>
"
fi
#GUI
switcheroo="
<window title="$(gettext 'WM Switcher') $ver" resizable="false">
<vbox>
<frame $(gettext 'Choose the window manager you would like to use')>
<vbox>
$JWMGUI
$ICEWMGUI
$XFCEGUI
$OPENBOXGUI
$FLUXGUI
$KDEGUI
$EMERALDGUI
</vbox>
</frame>
<frame $(gettext 'Important Information')>
<text use-markup="true" xalign="0"><label>"<b>$(gettext 'Restart X')</b> $(gettext 'will switch WMs and restart X now')"</label></text>
<text use-markup="true" xalign="0"><label>"<b>$(gettext 'Note:')</b><i> $(gettext 'Restarting X will kill all your open applications')</i>"</label></text>
<text use-markup="true"><label>"<i>$(gettext 'Save your work before you continue')</i>"</label></text>
</frame>
<hbox homogeneous="true">
<button>
<label>$(gettext 'Restart X')</label>
<input file stock="gtk-apply"></input>
<action>SWITCH</action>
<action>restartwm</action>
<action>EXIT:restartX</action>
</button>
</hbox>
</vbox>
</window>"
gtkdialog3 -p switcheroo
unset switcheroo
#END
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Re: wmswitcher
Hello L18L,L18L wrote:Hello world
I do not know what you have been translating...
here is
wmswitcher internationalized
translatable now using momanager
cheers
I have translate ver 0.18
Re: wmswitcher
Don't worry, it is the same code. L18L upgraded the script to version 0.19 because it is now gettexted, and also marked in red what has to be done in order to gettext a script. Thanks, L18L.ASRI éducation wrote:Hello L18L,L18L wrote:Hello world
I do not know what you have been translating...
here is
wmswitcher internationalized
translatable now using momanager
cheers
I have translate ver 0.18
And thanks, rodin.s too, for the gettext commands.
- Attachments
-
- wmswitcher-0.19.pet
- WM Switcher internationalised by L18L
- (18.42 KiB) Downloaded 472 times
Last edited by vicmz on Fri 18 Jan 2013, 03:24, edited 2 times in total.
[url=http://murga-linux.com/puppy/viewtopic.php?t=76948]Puppy Linux en español[/url]
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Re: wmswitcher
Yes, thanks L18L.vicmz wrote:...
Thanks, L18L.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/