You are not logged in.

#1 2009-07-12 03:52:15

madalu
Member
Registered: 2009-05-05
Posts: 217

[SOLVED] obm-xdg menus in Spanish

I'm using the obm-xdg pipe (included with obmenu) to generate an automatic menu of all my installed gtk applications in Openbox.

The problem I'm currently having is that the labels for the programs are in Spanish (at least I believe it's Spanish -- I'm no expert).

My locale in locale.gen is set to:

en_US.UTF-8 UTF-8
en_US ISO-8859-1

Here's how I call obm-xdg in menu.xml:

<menu execute="obm-xdg" id="xdg-menu" label="Others"/>

Thanks.

Edit reason: Patches below solve the issue.

Last edited by madalu (2010-06-16 21:40:57)

Offline

#2 2009-07-12 05:48:28

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] obm-xdg menus in Spanish

I'm going to be of no help here, but for me it was incremental. It was just GIMP at first. Myself and others even brought that up months ago here. Then crept in Inkscape, which interestingly reverted itself back at some point. Now it's three of the four categories that I have.

--EDIT--

I can be a little help after all. You can return the values in ~/.obmxdg.xml. They'll go back to Spanish as soon as something new comes in though.

Offline

#3 2009-07-12 13:23:01

madalu
Member
Registered: 2009-05-05
Posts: 217

Re: [SOLVED] obm-xdg menus in Spanish

Thanks for the help. I modified obm-xdg, but may have to create my
menus by hand from now on.

Offline

#4 2009-07-22 17:04:14

lamberss
Member
Registered: 2009-04-11
Posts: 10

Re: [SOLVED] obm-xdg menus in Spanish

I was running into this problem, too.  I patched obm-xdg to fix it.  The patch is below.

The problem was that it was only trying to match languages by searching inside the language string.  For example, if the application had an entry for "ca@valencia", and your LANG is "en_US" it would produce a match because of the "en" at the beginning of LANG matching the "en" somewhere inside "ca@valencia".

This patch seems to have fixed it, at least for my locale of en_US.

Now, I need to learn how to submit patches upstream ...

--- obm-xdg     2009-07-22 12:35:25.423776943 -0400
+++ obm-xdg.new 2009-07-22 12:35:31.790440961 -0400
@@ -210,10 +210,10 @@
                                        lang = None

                                if lang:
-                                       if lang_major in lang and (title == "" or accuracy < 2):
+                                       if lang_major == lang[:2] and (title == "" or accuracy < 2):
                                                title = name
                                                accuracy = 2
-                                       if lang_minor and lang_major in lang and lang_minor in lang:
+                                       if lang_minor and lang_major == lang[:2] and lang_minor == lang[3:5]:
                                                title = name
                                                accuracy = 3
                                elif title == "":
@@ -250,10 +250,10 @@
                                        lang = None

                                if lang:
-                                       if lang_major in lang and (title == "" or accuracy < 2):
+                                       if lang_major == lang[:2] and (title == "" or accuracy < 2):
                                                title = name
                                                accuracy = 2
-                                       if lang_minor and lang_major in lang and lang_minor in lang:
+                                       if lang_minor and lang_major == lang[:2] and lang_minor == lang[3:5]:
                                                title = name
                                                accuracy = 3
                                elif title == "":

Offline

#5 2009-10-01 09:38:10

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: [SOLVED] obm-xdg menus in Spanish

lamberss
Can you describe how to use this patch?

I use obm-xdg just to get list of all installed applications. Maybe there is some more elegant and effective solution for this? Can you suggest me something?

Thanks.

Offline

#6 2009-10-30 03:37:16

Intrepid
Member
Registered: 2008-06-11
Posts: 254

Re: [SOLVED] obm-xdg menus in Spanish

There's no other solution?  THe menu used to work fine!

[EDIT] I'm willing to make a PKGBUILD with the patch you described as a temporary fix.  I just don't know how to use the patch program properly. I will upload the modified obmenu to AUR b/c I really want to use obm-xdg.

[EDIT 2] The patch doesn't seem to work, but I edited the file by hand and made the changes according to the patch file, and it works PERFECTLY now!  Thanks!  (this is probably due to my ignorance of how to use the patch command)

Last edited by Intrepid (2009-11-01 02:21:51)


Intrepid (adj.): Resolutely courageous; fearless.

Offline

#7 2009-11-03 17:39:50

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [SOLVED] obm-xdg menus in Spanish

Intrepid wrote:

The patch doesn't seem to work, but I edited the file by hand and made the changes according to the patch file, and it works PERFECTLY now!  Thanks!  (this is probably due to my ignorance of how to use the patch command)

Please, can you describe the whole procedure to make obm-xdg display menu in english?
Thank you very much! big_smile


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#8 2009-12-10 18:16:01

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [SOLVED] obm-xdg menus in Spanish

Is there any news with this issue?
Menu in spanish are so...useless. neutral


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#9 2009-12-10 21:25:05

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: [SOLVED] obm-xdg menus in Spanish

You can take a look at http://www.linuxhq.com/patch-howto.html although it states it is for unofficial kernel patches, it applies to all source patches.

Basically it'll look something like this

patch -p0 < xdg-spanish-fix.patch


Website - Blog - arch-home
Arch User since March 2005

Offline

#10 2009-12-11 02:51:32

NeOnsKuLL
Member
From: Havana, Cuba
Registered: 2005-03-29
Posts: 117

Re: [SOLVED] obm-xdg menus in Spanish

Sorry, I'm not trying to spam, but, why don't you try obmenugen?

http://aur.archlinux.org/packages.php?ID=27300

https://launchpad.net/obmenugen

See it's features.

This is not spam, I'm just recommending an application which do auto-updating menu generation for Openbox.

In a few hours I'll be releasing and uploading the version 0.4.1, which includes support for English, Spanish, French and German.

See you


Intel Core 2 Duo E8400 3.0 GHz | 2x1GB 667MHz | 250+750GB Seageate SATAII | Samsung 19" TFT 1440x900
Openbox + obmenugen + PyTyle | bmpanel2 | oblogout | conky | pyBgSetter (with Esetroot as backend)
Projects: obmenugen, pyBgSetter

Offline

#11 2009-12-18 21:56:03

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [SOLVED] obm-xdg menus in Spanish

NeOnsKuLL wrote:

Sorry, I'm not trying to spam, but, why don't you try obmenugen?

http://aur.archlinux.org/packages.php?ID=27300

https://launchpad.net/obmenugen

See it's features.

This is not spam, I'm just recommending an application which do auto-updating menu generation for Openbox.

In a few hours I'll be releasing and uploading the version 0.4.1, which includes support for English, Spanish, French and German.

See you

Your project seems interesting but I am not willing to try it because I am on a 64 bit system and it requests some lib32 packages... sad


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#12 2009-12-18 23:04:37

NeOnsKuLL
Member
From: Havana, Cuba
Registered: 2005-03-29
Posts: 117

Re: [SOLVED] obm-xdg menus in Spanish

It only needs you to install lib32-glibc, that's all. But, ok, I just suggested it for help.

See you


Intel Core 2 Duo E8400 3.0 GHz | 2x1GB 667MHz | 250+750GB Seageate SATAII | Samsung 19" TFT 1440x900
Openbox + obmenugen + PyTyle | bmpanel2 | oblogout | conky | pyBgSetter (with Esetroot as backend)
Projects: obmenugen, pyBgSetter

Offline

#13 2010-01-30 20:36:47

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [SOLVED] obm-xdg menus in Spanish

Don't know if this is due to some update or to the fact that I switched locale from en-US to en-GB but... obm-xdg menu now is in english! lol


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#14 2010-06-16 21:40:09

madalu
Member
Registered: 2009-05-05
Posts: 217

Re: [SOLVED] obm-xdg menus in Spanish

The patch above required one more fix to work with en_US, since many of the application and directory files assume that en_US will default to the plain "Name" line. Now obm-xdg works just fine for me:

diff -aur obmenu-1.0-pristine/pipes/obm-xdg obmenu-1.0-new/pipes/obm-xdg
--- obmenu-1.0-pristine/pipes/obm-xdg    2010-06-16 13:20:05.159431066 -0400
+++ obmenu-1.0-new/pipes/obm-xdg    2010-06-16 13:49:38.635505913 -0400
@@ -208,12 +208,15 @@
                     lang = line[:n].split("[")[1].split("]")[0]
                 else:
                     lang = None
+                    if lang_minor == "US":
+                        title = name
+                        accuracy = 2
 
                 if lang:
-                    if lang_major in lang and (title == "" or accuracy < 2):
+                    if lang_major == lang[:2] and (title == "" or accuracy < 2):
                         title = name
                         accuracy = 2
-                    if lang_minor and lang_major in lang and lang_minor in lang:
+                    if lang_minor and lang_major == lang[:2] and lang_minor == lang[3:5]:
                         title = name
                         accuracy = 3
                 elif title == "":
@@ -248,12 +251,15 @@
                     lang = line[:n].split("[")[1].split("]")[0]
                 else:
                     lang = None
+                    if lang_minor == "US":
+                        title = name
+                        accuracy = 2
 
                 if lang:
-                    if lang_major in lang and (title == "" or accuracy < 2):
+                    if lang_major == lang[:2] and (title == "" or accuracy < 2):
                         title = name
                         accuracy = 2
-                    if lang_minor and lang_major in lang and lang_minor in lang:
+                    if lang_minor and lang_major == lang[:2] and lang_minor == lang[3:5]:
                         title = name
                         accuracy = 3
                 elif title == "":

Offline

Board footer

Powered by FluxBB