Rox and desktop files: how to display Comment[fr]
Ok odd build system...even thats a rox like bunny...
stopped at
checking that shared-mime-info (version >= 0.14) is installed... no
configure: error: Package is not installed
but sources told me what I needed to know...
Ok the line is in filer.c
comment = get_value_from_desktop_file(full_path,
"Desktop Entry", "Comment", &error);
The called function does as it says.....
Basically it looks for the pattern 'Comment' to get the tooltip... no LANG anywhere near that section ......
It does not seem too hard to add it ie the pattern modified by the LANG value.
If other language support is there in general so the resultant tooltips will show I see little problem adding this... though I am not a great C coder others may breeze through it.
mike
stopped at
checking that shared-mime-info (version >= 0.14) is installed... no
configure: error: Package is not installed
but sources told me what I needed to know...
Ok the line is in filer.c
comment = get_value_from_desktop_file(full_path,
"Desktop Entry", "Comment", &error);
The called function does as it says.....
Basically it looks for the pattern 'Comment' to get the tooltip... no LANG anywhere near that section ......
It does not seem too hard to add it ie the pattern modified by the LANG value.
If other language support is there in general so the resultant tooltips will show I see little problem adding this... though I am not a great C coder others may breeze through it.
mike
Wow. Great! Many thanks! You have a falcon's eye!mikeb wrote:Ok odd build system...even thats a rox like bunny...
stopped at
checking that shared-mime-info (version >= 0.14) is installed... no
configure: error: Package is not installed
but sources told me what I needed to know...
Ok the line is in filer.c
comment = get_value_from_desktop_file(full_path,
"Desktop Entry", "Comment", &error);
The called function does as it says.....
Basically it looks for the pattern 'Comment' to get the tooltip... no LANG anywhere near that section ......
It does not seem too hard to add it ie the pattern modified by the LANG value.
If other language support is there in general so the resultant tooltips will show I see little problem adding this... though I am not a great C coder others may breeze through it.
mike
Now can we expand that filer.c line so it does the same as the bash-awk script here:
http://murga-linux.com/puppy/viewtopic. ... ost#837979
Can it be done? Many thanks in advance.
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
actually it took a few seconds using searchmonkey...wonder why I recommend that tool??!!Wow. Great! Many thanks! You have a falcon's eye!
Can it be done...don't see why not if I can get the weird thing to build...
Again c is not my strong point..its an ancient primative language thats still in common use... why is beyond me but ours is not to reason why...bit like why people love DOS.
I would assume one needs to find how to read a system variablie ie $LANG and then insert that info into the function with the [] added....a conditional statement to have just 'Comment' as a fallback. With pointers, ints, chars and all that crap thrown in there..
Escaping from this world for 2 days so watch this space unless someone else has an urge (puppy seems to lack c programmers I noticed hence all those slow scripts)
mike
ps yes lots of sarcasm in there
ok got shared mime info....
thanks to debian for changing their debs to xz which needs dpkg-deb that want glibc 2.11 even though the resultant debs do not...
ok it builds but fails as the configure says gtk 2.12 is ok but it actually needs 2.14 for the gui builder (the replacement for glade)... ah the joys of linux.
Ok time ran out so will revisit later..
MIke
thanks to debian for changing their debs to xz which needs dpkg-deb that want glibc 2.11 even though the resultant debs do not...
ok it builds but fails as the configure says gtk 2.12 is ok but it actually needs 2.14 for the gui builder (the replacement for glade)... ah the joys of linux.
Ok time ran out so will revisit later..
MIke
Back from the land of mud and floating.....
Ok one to test.
Works here to show comment according to LANG and use the fallback plain Comment if nothing found.
Also removed running as user message but there may be other puppyisms that I am unaware of...plus had trouble getting Rox menus etc in a language...might have been my compiling steup problem though...INTL IS enabled.
Built and tried on lucid..older pups probably lack library versions needed for ROX 2.11 .
Just attached the main binary for a drop in test.
mike
Ok one to test.
Works here to show comment according to LANG and use the fallback plain Comment if nothing found.
Also removed running as user message but there may be other puppyisms that I am unaware of...plus had trouble getting Rox menus etc in a language...might have been my compiling steup problem though...INTL IS enabled.
Built and tried on lucid..older pups probably lack library versions needed for ROX 2.11 .
Just attached the main binary for a drop in test.
mike
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Rox and desktop files: how to display translated Comment
Tested.mikeb wrote:Ok one to test.
Works here to show comment according to LANG and use the fallback plain Comment if nothing found.
Works as intended by you.
Fallback should have 2 steps.
example for French language:
If not found in Comment[fr_FR] use Comment[fr]
If not found in Comment[fr] use Comment.
Thanks.
- Attachments
-
- rox_Comments_translated.png
- (28.88 KiB) Downloaded 164 times
Hi, mikeb.
Thanks much for your time. However, drop-in replacement fails here. No
difference. EN comments only, same as before.
Or maybe I have to re-initialize ROX somehow? I went to black initial
console and came back to wm, but was that enough? Do I have to do
anything in addition to that?
BFN.
musher0
Thanks much for your time. However, drop-in replacement fails here. No
difference. EN comments only, same as before.
Or maybe I have to re-initialize ROX somehow? I went to black initial
console and came back to wm, but was that enough? Do I have to do
anything in addition to that?
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- LazY Puppy
- Posts: 1934
- Joined: Fri 21 Nov 2014, 18:14
- Location: Germany
Me too.drop-in replacement fails here. No
difference. EN comments only, same as before.
RSH
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
Did you replace the existing rox-filer in /usr/local/apps/ROX-filer .
If its truly stopped including pinboard and LANG is set which it sounds like then hmmmm
well the previous post about extra fallbacks may apply. IE your specific LANG variable may not be in there ... utf8 should be ok but fr_FR will not find fr as it stands... editing a desktop file would be the test...echo $LANG and ensure there is an entry to match.
Every desktop file seems to have a different set of languages or none.
I used rox's own extraction and handling of LANG
I can fix but in any other language its a 20 second job but in the obtuse bitch known as c it will be half an hour for multiple rebuilds and tests.
mike
If its truly stopped including pinboard and LANG is set which it sounds like then hmmmm
well the previous post about extra fallbacks may apply. IE your specific LANG variable may not be in there ... utf8 should be ok but fr_FR will not find fr as it stands... editing a desktop file would be the test...echo $LANG and ensure there is an entry to match.
Every desktop file seems to have a different set of languages or none.
I used rox's own extraction and handling of LANG
I can fix but in any other language its a 20 second job but in the obtuse bitch known as c it will be half an hour for multiple rebuilds and tests.
mike
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Thank you mikeb!
My test:
1 - Replace the existing rox-filer in /usr/local/apps/ROX-filer.
2 - Restart X.
3 - Open /usr/share/applications, then try with file abiword.desktop.
Result:
- With Comment[fr_FR] it is ok.
- With Comment[fr] it is not ok (comment is in english).
This is the beginning of a solution. Alas, usually the desktop files indicate only the first two characters of the language: en, de, fr, es, it...
Regards
My test:
1 - Replace the existing rox-filer in /usr/local/apps/ROX-filer.
2 - Restart X.
3 - Open /usr/share/applications, then try with file abiword.desktop.
Result:
- With Comment[fr_FR] it is ok.
- With Comment[fr] it is not ok (comment is in english).
This is the beginning of a solution. Alas, usually the desktop files indicate only the first two characters of the language: en, de, fr, es, it...
Regards
- Attachments
-
- rox_comment_fr_NOT_OK_20150406.jpg
- (56.13 KiB) Downloaded 420 times
-
- rox_comment_fr_FR_OK_20150406.jpg
- (56.66 KiB) Downloaded 446 times
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]
- LazY Puppy
- Posts: 1934
- Joined: Fri 21 Nov 2014, 18:14
- Location: Germany
Confirmed!With Comment[fr_FR] it is ok.
With Comment[fr] it is not ok (comment is in english).
My .desktop files have only [de]. After changing some of them to [de_DE] it shows immediately comments in DE. No need at all to replace the original binary nor to restart X here. Just executed the extracted binary from its extraction directory for testing.
RSH
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:
Hi, mikeb.mikeb wrote:Did you replace the existing rox-filer in /usr/local/apps/ROX-filer .
If its truly stopped including pinboard and LANG is set which it sounds like then hmmmm
well the previous post about extra fallbacks may apply. IE your specific LANG variable may not be in there ... utf8 should be ok but fr_FR will not find fr as it stands... editing a desktop file would be the test...echo $LANG and ensure there is an entry to match.
Every desktop file seems to have a different set of languages or none.
I used rox's own extraction and handling of LANG
I can fix but in any other language its a 20 second job but in the obtuse bitch known as c it will be half an hour for multiple rebuilds and tests.
mike
Thanks for these details.
FWIW... I'm French-Canadian and these are the varioous LANG
variables that I insert in /etc/profile.local:
Code: Select all
export LANG="fr_CA.utf8"
export LANGUAGE="fr_CA.utf8"
export LC_CTYPE="fr_CA.utf8"
export LC_NUMERIC="fr_CA.utf8"
export LC_TIME="fr_CA.utf8"
export LC_DATE="fr_CA.utf8"
export LC_MONETARY="fr_CA.utf8"
export LC_MESSAGES="fr_CA.utf8"
export LC_PAPER="fr_CA.utf8"
export LC_NAME="fr_CA.utf8"
export LC_ADDRESS="fr_CA.utf8"
export LC_TELEPHONE="fr_CA.utf8"
export LC_MEASUREMENT="fr_CA.utf8"
export LC_IDENTIFICATION="fr_CA.utf8"
export LC_ALL=""
recognized by my system. (Hmmm... how would I know that?) In any
case I can use the French-from-France localization files OOTB.
If it may be a hindrance , here are the contents of file
aOOwriter.desktop. It has the most comments[xy] that I know of and it
probably holds the Guinness record of fattest *.desktop file.
I'll try a full reboot and see what that does.
BFN.
musher0
- Attachments
-
- writer.desktop.zip
- (9.9 KiB) Downloaded 375 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Ok so general consensus is the need to handle fr and fr_FR variation of LANG variables... ok will add that and post the result later.... not in Lucid at the moment and REALLY hungry...
Now what's the system definition of later?
if anyone wants this for older pups ROX 2.10 works ok...its before they changed from glade which is where the library changes are needed..just shout. Functionally there seems little difference in the two versions apart from this.
mike
Now what's the system definition of later?
if anyone wants this for older pups ROX 2.10 works ok...its before they changed from glade which is where the library changes are needed..just shout. Functionally there seems little difference in the two versions apart from this.
mike
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Thank you in advance.mikeb wrote:Ok so general consensus is the need to handle fr and fr_FR variation of LANG variables... ok will add that and post the result later.... not in Lucid at the moment and REALLY hungry...
No actual emergency, you have time to eat.
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]
Hurrah! Comment[fr_CA] works!
If it's a simple matter of changing Comment[fr] to Comment[fr_CA], then
replaceit can do it in a jiffy:
People from the East side of the Great Pond will use fr_BE, fr_FR or
fr_CH of course.
Some may think that it's not be exactly kosher to do so. Anyway, the
micro-script is there if you need it.
Just a thought. Bon appétit!
musher0
If it's a simple matter of changing Comment[fr] to Comment[fr_CA], then
replaceit can do it in a jiffy:
Code: Select all
cd /usr/share/applications
for i in `ls -1 *.desktop`
do replaceit --input=$i "Comment[fr]" "Comment[fr_CA]"
done
fr_CH of course.
Some may think that it's not be exactly kosher to do so. Anyway, the
micro-script is there if you need it.
Just a thought. Bon appétit!
musher0
Last edited by musher0 on Mon 06 Apr 2015, 18:58, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Rox and desktop files
ASRI éducation wrote:No actual emergency, you have time to eat.
Stop babbling! Go! Your hamburg steak will get cold!!!mikeb wrote:fichiers Desktop sont très exigeantes
don't blame me though my translation was worse...
I don't want to pass out while compiling.... please don't hold any breath during this food related pause
Actually i will slip a note into the version output to distinguish the build.
mike
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)