Question about gettext! [SOLVED]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
You have stumbled upon one problem that is frequently encountered in pet packages made by inexperienced packagers .. failing to set prefix, sysconfdir and othersto the appropriate directories. By default puppy is set up to build _personal_ package with prefixed set to /usr/local and the rest get prefixed with that (ex. Sysconfdir would be /usr/local/etc instead of /etc)
The standard is --prefix=/usr --sysconfdir=/etc --localstatedir=/var
The rest are based on these and should typically be ok(with a few exceptions)
However, some vigilance is required when doing this on package that use Makefiles or hardcode a path in source. If this is necessary, it is a good idea to post a patch to ensure compatibility in future builds.
The standard is --prefix=/usr --sysconfdir=/etc --localstatedir=/var
The rest are based on these and should typically be ok(with a few exceptions)
However, some vigilance is required when doing this on package that use Makefiles or hardcode a path in source. If this is necessary, it is a good idea to post a patch to ensure compatibility in future builds.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
..or set "make DESTDIR=/$APP install" so you can view and edit everything prior to making the pet.technosaurus wrote:You have stumbled upon one problem that is frequently encountered in pet packages made by inexperienced packagers .. failing to set prefix, sysconfdir and othersto the appropriate directories. By default puppy is set up to build _personal_ package with prefixed set to /usr/local and the rest get prefixed with that (ex. Sysconfdir would be /usr/local/etc instead of /etc)
.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
NO!!! That is absolutely the _wrong_ thing to do.jpeps wrote:..or set "make DESTDIR=/$APP install" so you can view and edit everything prior to making the pet.
These parameters get used to make the config.h file and the paths are compiled into the binaries. Moving them around is exactly what breaks them. Unfortunately there is no equivalent to PATH and LD_LIBRARY_PATH for things like locale, sysconf, data ... yes it would be nice for the user to be able to set SYSCONF_PATH=/etc:/usr/etc:/usr/local/etc ... and would be extremely convenient for programs to use as well, (this was sort-of discussed previously, but I can't seem to find the thread)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
I guess my rearrangements have involved /usr to /usr/local, both of which are in PATH. I like to look at and test everything before building the pet. Yeah...you can't willy-nilly move around system's files that haven't been configured correctly.technosaurus wrote:NO!!! That is absolutely the _wrong_ thing to do.jpeps wrote:..or set "make DESTDIR=/$APP install" so you can view and edit everything prior to making the pet.
These parameters get used to make the config.h file and the paths are compiled into the binaries. Moving them around is exactly what breaks them.
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Thank you to all of you!
For this thread to be actually '(solved'), I still have a simple novice question: Something very confuse stays in my mind about the way to use UTF-8 and ISO-8859-1 (for example!).
How and when use the one or the other? For example, my (retrovol) mo file is build from an UTF-8 pot file and I presume that mo file automatically generated with poeditor is UTF-8 too. This runs quite well, as said above, only if UTF-8 is activated! So why UTF-8 is not the default setting and why ISO-XXX-XX?
For us, non English speaking guys, it is really so many problems (I lost my hair so many times!) due to something that appears like a lack of unity/clarity! => I know that BarryK is seriously looking for this and trying to rationalize Puppy localization process, up stream. We are working, translating, localizing here and there, using different ways to do it, downstream: the result is necessarily incoherent and a lot of time is wasted...
This has to change, indeed!
Best regards.
Thank you to all of you!
Saved!The standard is --prefix=/usr --sysconfdir=/etc --localstatedir=/var
I have to say that my mo file only works if UTF-8 is activated (checkbox at the bottom of the locale parameters window - Wary 5.2.2).I could not test and diagnose that my French translation was finally working as well as possible!
For this thread to be actually '(solved'), I still have a simple novice question: Something very confuse stays in my mind about the way to use UTF-8 and ISO-8859-1 (for example!).
How and when use the one or the other? For example, my (retrovol) mo file is build from an UTF-8 pot file and I presume that mo file automatically generated with poeditor is UTF-8 too. This runs quite well, as said above, only if UTF-8 is activated! So why UTF-8 is not the default setting and why ISO-XXX-XX?
For us, non English speaking guys, it is really so many problems (I lost my hair so many times!) due to something that appears like a lack of unity/clarity! => I know that BarryK is seriously looking for this and trying to rationalize Puppy localization process, up stream. We are working, translating, localizing here and there, using different ways to do it, downstream: the result is necessarily incoherent and a lot of time is wasted...
This has to change, indeed!
Best regards.
This code (below) helped me check which are 'real' .mo files, and which are text files...
I plan to rename all fake .mo files in my puplet to .locale files...
Any thoughts on that are welcome!
The check:
My results:
I plan to rename all fake .mo files in my puplet to .locale files...
Any thoughts on that are welcome!
The check:
Code: Select all
for x in /usr/share/locale/ru/LC_MESSAGES/*; do echo "$(file "$x" | head -1 | cut -f1 -d'(' | cut -f7 -d'/')" ; done
Code: Select all
bootflash.mo: GNU message catalog
bootmanager.mo: UTF-8 Unicode text, with very long lines
browser-installer.mo: UTF-8 Unicode text
check_deps.mo: UTF-8 Unicode text
connectwizard.mo: UTF-8 Unicode text
countrywizard.mo: GNU message catalog
defaults-chooser.mo: UTF-8 Unicode text
desksetup.mo: UTF-8 Unicode text
dialog.mo: GNU message catalog
dotpup.mo: UTF-8 Unicode text
drive_mounter.mo: UTF-8 Unicode text
epdfview.mo: GNU message catalog
eventmanager.mo: UTF-8 Unicode text, with very long lines
ffconvert.mo: GNU message catalog
flash.mo: GNU message catalog
frugalinstaller.mo: GNU message catalog
grub4dosconfig.mo: GNU message catalog
gtkspell.mo: GNU message catalog
jwmconfig.mo: GNU message catalog
jwm.mo: GNU message catalog
minimum-profit.mo: GNU message catalog
mtpaint.mo: GNU message catalog
net-setup.mo: UTF-8 Unicode English text
pcdripper.mo: UTF-8 Unicode text
pgprs.mo: GNU message catalog
pkg_chooser.mo: UTF-8 Unicode text
pman.mo: GNU message catalog
pmount.mo: UTF-8 Unicode text, with very long lines
pppoe.mo: GNU message catalog
proxy-setup.mo: GNU message catalog
pup-advert-blocker.mo: UTF-8 Unicode text
pupdial.mo: GNU message catalog
puppy-desktop.mo: GNU message catalog
pupradio.mo: GNU message catalog
pupsaveconfig.mo: GNU message catalog
resizepfile.mo: GNU message catalog
sfsconvert.mo: GNU message catalog
sfs_load.mo: GNU message catalog
startups.mo: UTF-8 Unicode C++ program text
toggle-rox-desktop.mo: UTF-8 Unicode text
viewnior.mo: GNU message catalog
welcome.mo: GNU message catalog
wizard.mo: GNU message catalog
xarchiver.mo: GNU message catalog
Xdialog.mo: GNU message catalog
xfdiff.mo: GNU message catalog
xkb.mo: GNU message catalog
xorgwizard.mo: GNU message catalog
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
UTF-8 and ISO-xxx!
Hello,
I created two mo files: one UTF-8 encoded from UTF-8 encoded po file, an other ISO encoded from ISO encoded po file. These one seem not to be recognized as ISO encoded files:
Please, need help or some link to understand what's wrong, what has to be done...
Will soon have a puncture.
Regards.
I created two mo files: one UTF-8 encoded from UTF-8 encoded po file, an other ISO encoded from ISO encoded po file. These one seem not to be recognized as ISO encoded files:
(retrovol:6585): Gtk-WARNING **: Invalid input string
(retrovol:6585): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
- - Both don't work with Puppy/Toutou 4.31 regardless of the locale setting (checkbox UTF-8 activated or not!)
- Both don't work with Wary 5.2.2 if checkbox UTF-8 deactivated
- Both work fine with Wary 5.2.2 if checkbox UTF-8 activated
Please, need help or some link to understand what's wrong, what has to be done...
Will soon have a puncture.
Regards.
Short : The 4.3 Puppy locale file had a wrong entry for the german language
/mnt/sda3/usr/share/i18n/locales/de_DE :
where i had to comment the diacrit_forward line to make some things to work (cant remember exactly anymore)
Lupu worked ok .
I have also troubles with Xlib at 4.3 saying locale not supported by its library .
/mnt/sda3/usr/share/i18n/locales/de_DE :
Code: Select all
LC_COLLATE
%define DIACRIT_FORWARD
% Copy the template from ISO/IEC 14651
copy "iso14651_t1"
END LC_COLLATE
Lupu worked ok .
I have also troubles with Xlib at 4.3 saying locale not supported by its library .
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: UTF-8 and ISO-xxx!
I have been playing with retrovol with and without utf8 in latest slacko.
1st problem was:
Could not change to my locale without utf8
So I had to start freshly using very latest slacko (5135)
deactivating UTF-8 and there is some success to report now
did it right and
did make retrovol start permanently using utf8
This has been the problem solver with BaCon too and now with a C programm (gettext is independent of the used programming language).
I suggest to put export OUTPUT_CHARSET=UTF-8 into /etc/profile
______________________
Time for a retrovol_NLS.pet
1st problem was:
Could not change to my locale without utf8
So I had to start freshly using very latest slacko (5135)
deactivating UTF-8 and there is some success to report now
Code: Select all
OUTPUT_CHARSET=UTF-8 retrovol
Code: Select all
export OUTPUT_CHARSET=UTF-8
Code: Select all
retrovol
Credits go to shinobar who reported first about the OUTPUT_CHARSET thing#
# export OUTPUT_CHARSET=UTF-8
# echo $OUTPUT_CHARSET
UTF-8
# echo $LANG
de_DE
# locale -a
C
de_DE
en_US
POSIX
# retrovol
(retrovol:26732): Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated
This has been the problem solver with BaCon too and now with a C programm (gettext is independent of the used programming language).
I suggest to put export OUTPUT_CHARSET=UTF-8 into /etc/profile
______________________
Time for a retrovol_NLS.pet
- Attachments
-
- retrovol.png
- locale without utf8
"Volume" translated correctly to "Lautstärke" - (3.04 KiB) Downloaded 695 times
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Thank you for replying.
... Feel much better now!
Puppy/Toutou 4.31:
In console:
Adding this line to /etc/profile:
Is there a right place to put the line?
This is what I did:
Will try with Wary 5.2.2 later...
Cordilalement.
Thank you for replying.
... Feel much better now!
Puppy/Toutou 4.31:
In console:
This finally works!OUTPUT_CHARSET=UTF-8 retrovol -hide
Adding this line to /etc/profile:
This unfortunately does not!export OUTPUT_CHARSET=UTF-8
Is there a right place to put the line?
This is what I did:
Tried something else which works: modifying/completing existing lines in /root/.xinitrc (hidden file):#this line gets edited by chooselocale script...
LANG=fr_FR
export LANG
LC_ALL=fr_FR
export LC_ALL
LANGUAGE=fr_FR
export LANGUAGE
export OUTPUT_CHARSET=UTF-8
Is it right? Good/bad thing?#v3.91 volume tray applet, thanks to hairywill... v3.96 MENU_BG variable...
if [ "$(which retrovol)" != "" ];then
if [ "$MENU_BG" = "" ];then
export OUTPUT_CHARSET=UTF-8
retrovol -hide &
else
export OUTPUT_CHARSET=UTF-8
retrovol -hide -bg "$MENU_BG" &
fi
fi
Will try with Wary 5.2.2 later...
Cordilalement.
- Attachments
-
- retrovol.png
- (23.13 KiB) Downloaded 664 times
Last edited by Argolance on Sat 28 Jan 2012, 18:02, edited 1 time in total.
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Wary 5.2.2:
Adding line inside /etc/profile doesn't work! (Don't know if I copied the line at the right place, as mentioned above!)
This works when completing /Startup/retrovol_tray:
Wary 5.2.2:
Adding line inside /etc/profile doesn't work! (Don't know if I copied the line at the right place, as mentioned above!)
This works when completing /Startup/retrovol_tray:
Cordialement.#!/bin/sh
#exec retrovol -hide ${BGOPT} #BGOPT is exported from /usr/sbin/delayedrun.
#retrovol 0.10, -bg option no longer needed...
export OUTPUT_CHARSET=UTF-8
exec retrovol -hide
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
export OUTPUT_CHARSET=UTF-8
Sorry, my quick shot /etc/profile is not good for this.Argolance wrote:Is there a right place to put the line?
echo $OUTPUT_CHARSET shows UTF-8 but retrovol has been started earlier.
I did not find a file called xinitrc in my running slacko so I have put
Code: Select all
OUTPUT_CHARSET=UTF-8
export OUTPUT_CHARSET
I am sure Barry will put that code into the right location if there is a better one than delayedrun. The entire system can benefit from this and not just retrovol.
______________________
Time for a retrovol_NLS.pet
_______________________
Edited after seen Argolance´s last post:
There is no Startup/retrovol_tray in slacko !!!
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Best regards
/root/.xinitrc? (hidden file)I did not find a file called xinitrc in my running slacko
I sent the French UTF-8 mo and po files to Pizzasgood (=> http://www.murga-linux.com/puppy/viewtopic.php?t=50744)Time for a retrovol_NLS
Yes! It is ok! ... and better! Will test when back home.The entire system can benefit from this and not just retrovol.
Best regards
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
export OUTPUT_CHARSET=UTF-8
Argolance wrote:/root/.xinitrc? (hidden file)
Yes, and delayedrun is launched near the end of /root/.xinitrc
So the best location seems to be the beginning of /root/.xinitrc or even PUPSTATE which could be launched from sort of fido/.xinitrc, too.
And so will IArgolance wrote:I sent the French UTF-8 mo and po files to Pizzasgood (=> http://www.murga-linux.com/puppy/viewtopic.php?t=50744)
Thank you.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
gettext with and without utf8
Started with utf8L18L wrote:I have been playing with retrovol with and without utf8 in latest slacko.
1st problem was:
Could not change to my locale without utf8
...
# locale -a
C
de_DE.utf8
en_US
POSIX
#
----------------
chooselocale: choose de_DE without utf8
# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
C
de_DE.utf8
en_US
en_US.utf8
POSIX
#
----------------
Bugfix in /usr/sbin/chooselocale:
#120129 enabling adding locale without utf8 using regexp. L18L
#if [ "`locale -a | grep "${LANGCHOICE}${UTF8}"`" = "" ];then
if [ "`locale -a | grep -E "${LANGCHOICE}${UTF8}$"`" = "" ];then #120129
----------------
chooselocale: choose de_DE without utf8
# locale -a
C
de_DE
de_DE.utf8
en_US
en_US.utf8
POSIX
#
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello L18L,
... And what about the commented line? What is it used for? then... then what?
Sorry to ask so many questions...
Thank you!
If I well undertood, this has to be copied into /usr/sbin/chooselocale? And this instead of all the different "solutions" called above? But where?#120129 enabling adding locale without utf8 using regexp. L18L
#if [ "`locale -a | grep "${LANGCHOICE}${UTF8}"`" = "" ];then
if [ "`locale -a | grep -E "${LANGCHOICE}${UTF8}$"`" = "" ];then #120129
... And what about the commented line? What is it used for? then... then what?
Sorry to ask so many questions...
Thank you!
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
bugfix for chooselocale
Hello Argolance,
yes, edit /usr/sbin/chooselocale
find the line
it is something like 147 and replace it by:
No, this is just a bugfix which enables you now to choose for example fr_FR if you have started using fr_FR.UTF-8
The other issue was to have OUTPUT_CHARSET=UTF-8 permanent.
Put into /root/.xinitrc
Cordialment
yes, edit /usr/sbin/chooselocale
find the line
Code: Select all
if [ "`locale -a | grep "${LANGCHOICE}${UTF8}"`" = "" ];then
it is something like 147 and replace it by:
Code: Select all
if [ "`locale -a | grep -E "${LANGCHOICE}${UTF8}$"`" = "" ];then
The other issue was to have OUTPUT_CHARSET=UTF-8 permanent.
Put
Code: Select all
export OUTPUT_CHARSET=UTF-8
Cordialment