gMeasures not working in localized Puppies [almost solved]

Stuff that has yet to be sorted into a category.
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

gMeasures not working in localized Puppies [almost solved]

#1 Post by musher0 »

March 6, 2015, 22:11 EST. If confirmation feedback is positive, we have
a solution! BFN. musher0
~~~~~~~~~~~~~
Hello, people.

This in the context of that. If you care to read below my message on
that thread, you'll see very recent reactions by famous and various Puppy
personalities.

I ran a simple 100 centimeters test on rarsa's pConvert, python's gonvert
and gMeasures. I'll let the pictures do the talking...

Image

The one attached below is from the gMeasures in Simplicity Linux-
Desktop-15.4_32-bit, an independent Puppy based on slacko-5.7.1.
gMeasures does'nt work there either.

In whatever Puppy, try this: type "100" in top left box, click centimeters in
the top middle box and then specify "inches" in the box below: a number
should appear to the left underneath the 100. It doesn't.

How much more proof do we need to remove the inefficient gMeasures
from our Puppies?

BFN.

musher0
Attachments
gMeasures-Simplicity-D154-32_2015-03-06_014501.png
(20.61 KiB) Downloaded 632 times
Last edited by musher0 on Sat 07 Mar 2015, 03:14, edited 4 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hello again.

This is where you may download the gonvert utility from.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#3 Post by nic007 »

The "problems" with gmeasures must be specific to certain distributions. I'm using the very same gmeasures0.7 with Wary Puppy and everything works 100%

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#4 Post by Geoffrey »

gmeasure works ok in carolina, it is from the wary repo.
Attachments
gmeasures-0.7.pet
(23.16 KiB) Downloaded 561 times
gmeasure.jpg
(21.87 KiB) Downloaded 560 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

Hi, guys.

This may be the problem: my default LANG parameter is fr_CA.

From the README doc in the source file suggested by BK, you can read :
Locales
=======
By default, gMeasures uses the "C" locale. If your locale uses a comma instead
of a decimal point, and you want a localized version of this program, here are
the steps to take:

1. In the main.c file, go to main() and uncomment the gtk_set_locale() line.
2. Also in the main.c file, go to AppReadWriteConfig() and replace the decimal
points in the defs array with commas.

3. Recompile the program.
fr_CA uses the comma as the decimal delimiter.

I did point # 1, but I couldn't find any decimal commas in the "main.c" file
at "AppReadWriteConfig()"... So it's going to be pretty tough to recompile
with non-existing commas!!!

Ah, Linux programs... ;)

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#6 Post by BarryK »

musher0,
Thanks for finding the cause of the problem.

I suppose that a 'fix" would be to run gMeasures via a wrapper, say a script named 'gmeasureswrapper':

Code: Select all

#!/bin/sh
LANG=C gmeasures
Not satisfactory though, for our non-English users.

I might modify the PET as above, but in the interests of international support, will have to consider one of the other units-converters for future quirkies.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post by BarryK »

I had a vague memory that gmeasures has been internationalised.

I think that rodin.s is our expert at internationalizing C programs.

Just did a search, found this:

http://www.murga-linux.com/puppy/viewtopic.php?t=95490

...that has gmeasures internationalized by robwoj44, but only a binary posted there.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#8 Post by BarryK »

Ah here it is, internationalised gmeasures source, by robwoj44:

http://www.murga-linux.com/puppy/viewto ... 440#819440
[url]https://bkhome.org/news/[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

gMeasures is not working in localized Puppies

#9 Post by L18L »

musher0 wrote:Hi, guys.

This may be the problem: my default LANG parameter is fr_CA.

From the README doc in the source file suggested by BK, you can read :

Quote:
Locales
=======
By default, gMeasures uses the "C" locale. If your locale uses a comma instead
of a decimal point, and you want a localized version of this program, here are
the steps to take:

1. In the main.c file, go to main() and uncomment the gtk_set_locale() line.
2. Also in the main.c file, go to AppReadWriteConfig() and replace the decimal
points in the defs array with commas.

3. Recompile the program.


fr_CA uses the comma as the decimal delimiter.

I did point # 1, but I couldn't find any decimal commas in the "main.c" file
at "AppReadWriteConfig()"... So it's going to be pretty tough to recompile
with non-existing commas!!!

Ah, Linux programs... Wink

BFN.

musher0
_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Never been using gmeasures though it is in every Puppy I have used so far.
Isn't it needless to post this in Additional Software (PETs, n' stuff)?

Anyway, congrats, you have found a bug! 8)
... and Puppy and BK is the wrong adress to report this bug.
I couldn't find any decimal commas in the "main.c" file
at "AppReadWriteConfig()"...
Nobody has said you should find decimal commas:
Paul Schuurmans in the README file in the source package of gmeasures-0.7 wrote: replace the decimal
points in the defs array with commas
Hope this "multiplication of a recipe" has not been needlessly. :wink:

If you would use jwm menu you could simply fix it by:

Code: Select all

sed -i 's/>gmeasures</\>LANG=C gmeasures\</' $HOME/.jwmrc
jwm -restart
But I have read somewhere you hate jwm.... :cry:

---
Barry was faster....

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post by musher0 »

Hello, L18L.

I see that you are happy oh so happy to have found fault with me! :)

You can certainly rejoice in the fact that I do not know the C language,
and that therefore I cannot pinpoint nor correct whatever needs to be
fixed in the C code to localize gMeasures properly.

Please feel free to add to the list of my known and unknown defects if
it makes you happy... I'm thick-skinned, and all for my fellow humans'
happiness. :twisted:

I know the < LANG=C > prefix to commands, it can be used in any
launcher or menu, including pekwm's. But using it makes no sense in
the context of an internationalized distro.

The problem here is that the Puppy community has been presented with
a program that does not lend itself well to localization.

Another forum member using localized Puppies has just informed me
that gMeasures has other shortcomings: gMeasures can only convert
euros to guilders, not to other currencies, and seconds only to minutes,
not to hours or days, for example.


Of course BK is faster. (What BK is faster at you do not say,
however! :) So for the fun of it, I'll agree with you that he is a
generally faster person!)

In particular: he's a fast developer, and I'm simply an enthusiastic
amateur (actually, in this case, I'm fast becoming a "depressed"
amateur...).

It stands to logic that professionals shouldn't be pitted against amateurs.
Doing so is unfair, isn't it?

I should not have to spell out here that if "professional" programmers
such as those who programmed gMeasures truly had a professional
attitude, amateurs would not have to do what I'm having to do: play
critic because they've uncovered program bugs.

In any case, pConvert and gonvert brilliantly do what gMeasures fails to
do, and I am happy to have discovered them. I may not be a C
programmer at all, but I'm a damn good researcher.

So I stand my ground: for technical reasons, and now for human oh so
human reasons, gMeasures has to go.

Regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#11 Post by rcrsn51 »

BarryK wrote:I suppose that a 'fix" would be to run gMeasures via a wrapper, say a script named 'gmeasureswrapper':

Code: Select all

#!/bin/sh
LANG=C gmeasures
Or maybe

Code: Select all

#!/bin/sh
LC_NUMERIC=C gmeasures
That might use the dot as the decimal separator regardless of locale, while honouring the translations.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#12 Post by musher0 »

Hello, all.

The following goes beyond localisation, it is even more serious as it puts
into question the accuracy offered by gMeasures. I ran gMeasures with the
C locale and this is the conversion I get from kilgrams to pounds.

Taking as reference an old "Mathematical Tables from Handbook of
Chemistry and Physics" (1963), a kilogram weighs 2.204623 pounds.
The constant has not changed since then! :)

gonvert and pConvert get it right, not gMeasures, even with the use of the
C locale prefix.

Image

gMeasures only multiplies by two (2).

I rest my case. Let's get rid of this program before its wrong results get
all of our users into trouble.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#13 Post by Moat »

Hmm... works fine here.

I've always liked gMeasures - a light little app that does what it does, just fine by me.

Bob
Attachments
gmeasures-precise571.jpeg
gMeasures on Precise 5.7.1
(36.68 KiB) Downloaded 404 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#14 Post by musher0 »

Moat wrote:Hmm... works fine here.

I've always liked gMeasures - a light little app that does what it does, just fine by me.

Bob
Hi, bob.

Thanks for your input.

What's your LANG parameter ? en_SOMETHING ?
That proves itself, doesn't it?

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#15 Post by musher0 »

rcrsn51 wrote:
BarryK wrote:I suppose that a 'fix" would be to run gMeasures via a wrapper, say a script named 'gmeasureswrapper':

Code: Select all

#!/bin/sh
LANG=C gmeasures
Or maybe

Code: Select all

#!/bin/sh
LC_NUMERIC=C gmeasures
That might use the dot as the decimal separator regardless of locale, while honouring the translations.
Nope. Doesn't work.
Attachments
how-much-more-proof-do-we-need_2015-03-06(2).jpg
(28.63 KiB) Downloaded 420 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#16 Post by Moat »

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! 8)

Bob

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#17 Post by musher0 »

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! 8)

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
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#18 Post by Moat »

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... :lol:

Bob

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#19 Post by Geoffrey »

From the few different languages I've tried with the wary repo version, it seems gMeasures is only correct in English.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#20 Post by BarryK »

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.
[url]https://bkhome.org/news/[/url]

Post Reply