The time now is Thu 26 Apr 2018, 23:22
All times are UTC - 4 |
Page 2 of 2 [29 Posts] |
Goto page: Previous 1, 2 |
Author |
Message |
Moat

Joined: 16 Jul 2013 Posts: 813 Location: Mid-mitten, USA
|
Posted: Fri 06 Mar 2015, 14:59 Post subject:
|
|
musher0 wrote: | What's your LANG parameter ? en_SOMETHING ? |
Yes - en_US. But wouldn't the fix be as easy as re-compiling the internationalized source from robwoj44, as Barry linked to above? Might be interesting to see if that resolves these issues or not.
I'll have to give one of the alternates you posted a look-see, though!
Bob
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12098 Location: Gatineau (Qc), Canada
|
Posted: Fri 06 Mar 2015, 16:12 Post subject:
|
|
Moat wrote: | musher0 wrote: | What's your LANG parameter ? en_SOMETHING ? |
Yes - en_US. But wouldn't the fix be as easy as re-compiling the internationalized source from robwoj44, as Barry linked to above? Might be interesting to see if that resolves these issues or not.
I'll have to give one of the alternates you posted a look-see, though!
Bob |
Hello again, bob.
Nope. I don't know what it is, but the "internationalized" version that I just
compiled from that source still says a kilo weighs only two pounds...
I didn't test every conversion, but this version still offers only guilders as
a conversion from euros.
I've finished banging my head on this one. BFN.
musher0
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
Moat

Joined: 16 Jul 2013 Posts: 813 Location: Mid-mitten, USA
|
Posted: Fri 06 Mar 2015, 16:41 Post subject:
|
|
musher0 wrote: | ... but this version still offers only guilders as
a conversion from euros. |
Ha - same here. I'm not even sure what a "guilder" is...
Bob
|
Back to top
|
|
 |
Geoffrey

Joined: 30 May 2010 Posts: 2346 Location: Queensland
|
Posted: Fri 06 Mar 2015, 17:44 Post subject:
|
|
From the few different languages I've tried with the wary repo version, it seems gMeasures is only correct in English.
_________________ Carolina: Recent Repository Additions

|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 8531 Location: Perth, Western Australia
|
Posted: Fri 06 Mar 2015, 21:11 Post subject:
|
|
I am testing robwoj44's gmeasures
This converts kilograms to pounds correctly;
# LANG=C ./gmeasures
Interesting this also correct (German uses the comma):
# LANG=de_DE ./gmeasures
But this gives the error reported by musher0:
# LANG=de_DE.UTF-8 ./gmeasures
also:
# LANG=de_DE.utf8 ./gmeasures
I will ask robwoj44 about it.
_________________ http://bkhome.org/news/
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12098 Location: Gatineau (Qc), Canada
|
Posted: Fri 06 Mar 2015, 21:29 Post subject:
|
|
Moat wrote: | musher0 wrote: | ... but this version still offers only guilders as
a conversion from euros. |
Ha - same here. I'm not even sure what a "guilder" is...
Bob |
From http://dictionary.reference.com/browse/Guilder :
Quote: | "a silver or nickel coin and monetary unit of the Netherlands until
the euro was adopted, equal to 100 cents" |
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12098 Location: Gatineau (Qc), Canada
|
Posted: Fri 06 Mar 2015, 22:00 Post subject:
|
|
Hello, all.
As Mr. Kauler mentioned, gmeasures seems to be allergic to utf8...
It doesn't care if LANG=en_CA or LANG=fr_CA, but it can't tolerate utf8!!!
Maybe the gtk-spin-button is making it dizzy!!!
All in the interest of science... BFN.
musher0
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12098 Location: Gatineau (Qc), Canada
|
Posted: Fri 06 Mar 2015, 23:08 Post subject:
|
|
Hello, all.
Eureka! This is how to get gmeasures to show proper decimals in a
localized UTF-8 environment !
Create a new file gmeasures.sh in /usr/bin and make it executable.
Copy the following code from here and paste it in the new script. Save.
Code: | #!/bin/ash
# /usr/bin/gmeasures.sh
# To get gmeasures to use decimals properly in a localized environment.
# musher0, March 6, 2015.
# Thanks to BK for help in testing and for the hints.
# Discussion reference : http://murga-linux.com/puppy/viewtopic.php?t=98030
####
if [ "${LANG:6:5}" = "UTF-8" -o "${LANG:6:4}" = "utf8" ];then
LANG="${LANG:0:5}"
LANG="$LANG" gmeasures
LANG="`awk -F"=" '$1=="LANG" { print $2 }' /etc/profile`"
# We restore the original linguistic environment afterwards.
# See /etc/profile, lines 99-104, if in doubt.
else
gmeasures
fi |
You'll also have to modify your gmeasures.desktop file at
/usr/share/applications, like so:
Code: | [Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Gmeasures
Comment=Gmeasures weights and measures converter
Comment[fr]=Convertisseur de poids et mesures Gmeasures
Exec=gmeasures.sh
Icon=gmeasures.xpm
Terminal=false
Type=Application
Categories=Calculator
StartupNotify=true
GenericName=Units converter
|
If you prefer, you may manually change only the "Exec=" line,
from gmeasures to gmeasures.sh.
Result : we have proper decimals!!!
Below, proof that UTF-8 has been restored: we can type fancy accented
vowels and characters in the last line after running gmeasures.
I believe the above script should work with all UTF-8 locales? Please tell
me. Thanks in advance.
As to the euros to guilders conversion, I'll throw out there that someone
on the development team really loved his guilders -- more than euros--,
and was nostalgic? (Now where's that tongue-in-cheek icon...)
Thanks everyone!
musher0
~~~~~~~~~
P.S. I'll wait for confirmation feedback before uploading a little *.pet
archive of this. Thanks in advance.
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 8531 Location: Perth, Western Australia
|
Posted: Sat 07 Mar 2015, 04:22 Post subject:
|
|
musher0,
No, that does not fix it.
I realised, soon after my last post, that I had made a mistake.
The problem is not UTF-8.
earlier I reported that this works, running robwoj44's binary:
# LANG=de_DE ./gmeasures
However, it doesn't. If there is no folder /usr/lib/locale/de_DE, then gmeasures falls back to using C locale.
So, it seems to have worked, but not really.
If you run quicksetup and choose de_DE, and untick the UTF-8 checkbox, then /usr/lib/locale/de_DE gets created.
Now run "LANG=de_DE ./gmeasures" and it doesn't work.
The C code needs to be fixed. Maybe robwoj44 will do that, I have informed him of the problem.
_________________ http://bkhome.org/news/
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 8531 Location: Perth, Western Australia
|
Posted: Sat 07 Mar 2015, 05:03 Post subject:
|
|
OK, I think that I have the solution.
The "gmeasureswrapper" script just needs this:
#!/bin/sh
LC_NUMERIC=C gmeasures
I am using robwoj44's binary.
I tried to put this into the C code, using setlocale(), but it doesn't work. So resorted to the above wrapper.
_________________ http://bkhome.org/news/
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12098 Location: Gatineau (Qc), Canada
|
Posted: Sat 07 Mar 2015, 10:29 Post subject:
|
|
Thanks for sharing your thoughts and solutions about this problem, Barry.
It is true that the problem is not really one of localization by language,
but rather of the use of global standards: ISO vs "Imperial", for ex.
It's independent of linguistic maps.
I have some trouble understanding your argument on the impact of
existent or non-existent locale folders on decimals in the gmeasures
application. I'm sure I'll get there. The important thing is that a couple of
workarounds can now be offered to the user.
Perhaps robwoj44 could drop the euro<>guilder conversion altogether.
Currency rates change daily and perhaps should not be confused with
units conversions that are based on scientific constants. Just a thought.
The web is really well adapted to currency activity:
http://www.ask.com/web?qsrc=1&o=0&l=dir&q=money+exchange&qo=serpSearchTopBox
As I said earlier, I don't want to bang my head on this gmeasures any
longer. I have opted to use Puppy's good old pConvert for units, and
XE.com or a similar site if I ever need to know a daily exchange rate.
Best regards.
musher0
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 8531 Location: Perth, Western Australia
|
Posted: Sat 07 Mar 2015, 21:16 Post subject:
|
|
BarryK wrote: | OK, I think that I have the solution.
The "gmeasureswrapper" script just needs this:
#!/bin/sh
LC_NUMERIC=C gmeasures
I am using robwoj44's binary. |
robwoj44 has confirmed that this works, so this is the fix I will use in Quirky.
_________________ http://bkhome.org/news/
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12098 Location: Gatineau (Qc), Canada
|
Posted: Sun 08 Mar 2015, 00:46 Post subject:
|
|
Sorry, wrong thread.
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1655
|
Posted: Sun 28 May 2017, 19:10 Post subject:
|
|
BarryK wrote: | OK, I think that I have the solution.
The "gmeasureswrapper" script just needs this:
#!/bin/sh
LC_NUMERIC=C gmeasures
I am using robwoj44's binary.
I tried to put this into the C code, using setlocale(), but it doesn't work. So resorted to the above wrapper. |
Hey Barry & guys.
I was working on adding support for Kelvin degrees to gMeasures and stumbled across this thread.
Just letting you know that the 'setlocale()' hack works for me.
Well, it wasn't at first, when it was placed at the very beginning of main(), but I moved it below gtk_init(&argc, &argv); and it just started to work, dunno why actually.
The attached is the Kelvin patch (it's for the original sources, not Robwoj44's) that also contains the above fix (I'm too lazy to split it into 2 patches ).
The relevant lines are 172 & 248.
Greetings!
Description |
|

Download |
Filename |
gmeasures-kelvin.patch.tar.gz |
Filesize |
3.81 KB |
Downloaded |
43 Time(s) |
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
|
Page 2 of 2 [29 Posts] |
Goto page: Previous 1, 2 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|