Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 05 Jul 2015, 13:34
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
gMeasures not working in localized Puppies [almost solved]
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Author Message
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 03:22    Post subject:  gMeasures not working in localized Puppies [almost solved]
Subject description: It's still not perfect, but maybe removal from Puppy repos is not required.
 

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



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
gMeasures-Simplicity-D154-32_2015-03-06_014501.png
 Description   
 Filesize   20.61 KB
 Viewed   299 Time(s)

gMeasures-Simplicity-D154-32_2015-03-06_014501.png


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Fri 06 Mar 2015, 23:14; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 03:34    Post subject:  

Hello again.

This is where you may download the gonvert utility from.

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
nic007

Joined: 13 Nov 2011
Posts: 1087

PostPosted: Fri 06 Mar 2015, 03:58    Post subject:  

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%
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 1794
Location: Queensland

PostPosted: Fri 06 Mar 2015, 04:03    Post subject:  

gmeasure works ok in carolina, it is from the wary repo.
gmeasures-0.7.pet
Description 
pet

 Download 
Filename  gmeasures-0.7.pet 
Filesize  23.16 KB 
Downloaded  60 Time(s) 
gmeasure.jpg
 Description   
 Filesize   21.87 KB
 Viewed   238 Time(s)

gmeasure.jpg


_________________
Carolina: Recent Repository Additions
Create strikethrough text HERE
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 04:21    Post subject:  

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)
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7441
Location: Perth, Western Australia

PostPosted: Fri 06 Mar 2015, 06:39    Post subject:  

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:
#!/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.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7441
Location: Perth, Western Australia

PostPosted: Fri 06 Mar 2015, 06:54    Post subject:  

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.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7441
Location: Perth, Western Australia

PostPosted: Fri 06 Mar 2015, 06:56    Post subject:  

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

http://www.murga-linux.com/puppy/viewtopic.php?p=819440#819440

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2943
Location: www.eussenheim.de/

PostPosted: Fri 06 Mar 2015, 06:59    Post subject: gMeasures is not working in localized Puppies
Subject description: might read: gMeasures is not internationalized
 

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! Cool
... and Puppy and BK is the wrong adress to report this bug.

Quote:
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:
sed -i 's/>gmeasures</\>LANG=C gmeasures\</' $HOME/.jwmrc
jwm -restart
But I have read somewhere you hate jwm.... Crying or Very sad

---
Barry was faster....
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 11:36    Post subject:  

Hello, L18L.

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

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 Evil

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! Smile 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

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
rcrsn51


Joined: 05 Sep 2006
Posts: 9944
Location: Stratford, Ontario

PostPosted: Fri 06 Mar 2015, 13:10    Post subject:  

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

Code:
#!/bin/sh
LANG=C gmeasures


Or maybe
Code:
#!/bin/sh
LC_NUMERIC=C gmeasures

That might use the dot as the decimal separator regardless of locale, while honouring the translations.
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 14:17    Post subject:  

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! Smile

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



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

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Moat

Joined: 16 Jul 2013
Posts: 386

PostPosted: Fri 06 Mar 2015, 14:30    Post subject:  

Hmm... works fine here.

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

Bob
gmeasures-precise571.jpeg
 Description   gMeasures on Precise 5.7.1
 Filesize   36.68 KB
 Viewed   98 Time(s)

gmeasures-precise571.jpeg

Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 14:41    Post subject:  

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

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 14:46    Post subject:  

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

Code:
#!/bin/sh
LANG=C gmeasures


Or maybe
Code:
#!/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.
how-much-more-proof-do-we-need_2015-03-06(2).jpg
 Description   
 Filesize   28.63 KB
 Viewed   96 Time(s)

how-much-more-proof-do-we-need_2015-03-06(2).jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

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
[ Time: 0.1011s ][ Queries: 12 (0.0074s) ][ GZIP on ]