Home_greyopenFATE - openSUSE feature tracking > #310621
Dashboard | Search | Sign up | Login

Please login or register to be able to edit or vote this feature.

Get rid of %suse_update_desktop_files

Feature state

openSUSE-11.4
Unconfirmed

Description

In less than a month we will have the openSUSE Conference 2010 with the motto "Collaboration across Borders". So I think it's a good time to fix this.

The openSUSE Build Service is a great tool, and with mostly just some "Substitutes" you can have a single spec file, mostly without %if's, that will build in any RPM-based distro. Now in my experience one of the most problematic things is the %suse_update_desktop_files macro. That forces to add ugly "%if 0%{?suse_version}" to every package with a .desktop file.

One would say openSUSE could just do as Fedora and use freedesktop's desktop-file-install, deprecating %suse_update_desktop_files. But it's my understanding %suse_update_desktop_files is also used, somehow, for translations. I would like to help here. But I don't thing there is much documentation about how translations/X-SuSE-translate/%suse_update_desktop_files exactly work (I have been packaging for some years now and have no idea). But, from my ignorance, I would say that if Fedora can we can also handle translations in a way that doesn't requires of that macro.

I don't know, perhaps this can be solved through OBS's prjconf in a way that Fedora/Mandriva targets work even if the spec file uses %suse_update_desktop_files (redefining the macro to use desktop-file-install?) but I'm not sure if that's possible. Otherwise openSUSE should stop using that macro... Perhaps it will take years to fix all packages, but we should at least deprecate it and define a clear path of how this should be done from now.

P.S. Any link explaining the translations/X-SuSE-translate/%suse_update_desktop_files is welcome.

Discussion


icons/user_comment.png a. f. wrote: (3 years ago)

i'm against it! suse has things better than other distro... we should keep them!

%suse_update_desktop_files is able to mark a string as "translatable" so you can have them translated using only .po

translations are in particular handled by the file:

/usr/share/locale/<LANGUAGE>/LC_MESSAGES/desktop_translations.mo

let me try do describe why this way is better.

STANDARD/FREEDESKTOP way:

all translations if available are into the .desktop file itsealf like here:

[Desktop Entry]
Encoding=UTF-8
Name=LXTerminal
Name[af]=LXTerminal
Name[ar]=LXTerminal
Name[bg]=LXTerminal
Name[bn_IN]=LXTerminal
Name[ca]=LXTerminal
Name[cs]=LXTerminal
Name[da]=LXTerminal
Name[de]=LXTerminal
Name[el]=LXTerminal
Name[es]=LXTerminal
Name[es_VE]=LXTerminal
Name[et]=LXTerminal
Name[eu]=LXTerminal
Name[fa]=پایانه ی LX
Name[fi]=LXTerminal
Name[fr]=LXTerminal
Name[frp]=LXTerminal
Name[gl]=LXTerminal
Name[he]=תוכנית הדמיית המסוף LXTerminal
Name[hr]=LXTerminal
Name[hu]=LXTerminal
Name[id]=LXTerminal
Name[it]=LXTerminal
Name[ja]=LXTerminal
Name[lt]=LXTerminal
Name[ms]=LXTerminal
Name[nb]=LXTerminal
Name[nl]=LXTerminal
Name[nn]=LXTerminal
Name[pl]=LXTerminal
Name[pt]=LXTerminal
Name[pt_BR]=LXTerminal
Name[ru]=LXTerminal
Name[sk]=LXTerminal
Name[sl]=LXTerminal
Name[sr]=LXTerminal
Name[sv]=LXTerminal
Name[tr]=LXTerminal
Name[uk]=LX-термінал
Name[ur]=ایل ایکس ٹرمنل
Name[ur_PK]=ایل ایکس ٹرمنل
Name[vi]=LXTerminal
Name[zh_CN]=LX 终端
Name[zh_TW]=LX 終端機
GenericName=Terminal
GenericName[af]=Terminaal
GenericName[ar]=شاشة طرفية
GenericName[bg]=Терминал
GenericName[ca]=Terminal
GenericName[cs]=Terminál
GenericName[da]=Terminal
GenericName[de]=Terminal
GenericName[el]=&Tau;&epsilon;&rho;&mu;&alpha;&tau;&iota;&kappa;ό
GenericName[es]=Terminal
GenericName[es_VE]=Terminal
GenericName[et]=Terminal
GenericName[eu]=Terminala
GenericName[fa]=پایانه
GenericName[fi]=Pääte
GenericName[fr]=Terminal
GenericName[gl]=Terminal
GenericName[he]=מסוף
GenericName[hr]=Terminal
GenericName[hu]=Terminál
GenericName[id]=Terminal
GenericName[it]=Terminale
GenericName[ja]=端末
GenericName[ko]=터미널
GenericName[lt]=Terminalas
GenericName[ml]=ടെ‍ര്മിനല്
GenericName[ms]=Terminal
GenericName[nb]=Terminal
GenericName[nl]=Terminalvenster
GenericName[nn]=Terminal
GenericName[pl]=Terminal
GenericName[pt]=Terminal
GenericName[pt_BR]=Terminal
GenericName[ru]=Терминал
GenericName[sk]=Terminál
GenericName[sl]=Konzola
GenericName[sr]=Терминал
GenericName[sv]=Terminal
GenericName[tr]=Uçbirim
GenericName[uk]=Термінал
GenericName[vi]=Cửa sổ lệnh
GenericName[zh_CN]=终端
GenericName[zh_TW]=終端機
Comment=Use the command line
Comment[af]=Gebruik die opdraglyn
Comment[ar]=استخدِم سطر الأوامر
Comment[bg]=Използване на команден ред
Comment[ca]=Utilitza la línia d'ordres
Comment[cs]=Používat příkazový řádek
Comment[da]=Brug kommandolinjen
Comment[de]=Befehlszeile verwenden
Comment[el]=&Chi;&rho;ή&sigma;&eta; &gamma;&rho;&alpha;&mu;&mu;ή&sigmaf; &epsilon;&nu;&tau;&omicron;&lambda;ώ&nu;
Comment[es]=Usar la línea de comandos
Comment[es_VE]=Usar la línea de comandos
Comment[et]=Käsurea kasutamine
Comment[eu]=Erabili komando-lerroa
Comment[fa]=استفاده از خط فرمان
Comment[fi]=Käytä komentoriviä
Comment[fr]=Utiliser la ligne de commande
Comment[gl]=Usar a liña de ordes
Comment[he]=שימוש בשורת הפקודה
Comment[hr]=Koristi naredbeni redak
Comment[hu]=Parancssor használata
Comment[id]=Gunakan perintah baris
Comment[it]=Usa la riga di comando
Comment[ja]=コマンド・ライン端末です
Comment[ko]=명령 행을 사용합니다
Comment[lt]=Naudoti komandų eilutę
Comment[nb]=Bruk kommandolinjen
Comment[nl]=Gebruik de opdrachtregel
Comment[nn]=Bruk kommandolinja
Comment[pl]=Wiersz poleceń
Comment[pt]=Utilizar a linha de comando
Comment[pt_BR]=Use a linha de comando
Comment[ru]=Использовать командную строку
Comment[sk]=Použiť príkazový riadok
Comment[sl]=Uporabi konzolo
Comment[sr]=Користите линију наредби
Comment[sv]=Använd kommandoraden
Comment[tr]=Komut satırını kullan
Comment[uk]=Використати командну стрічку
Comment[vi]=Dùng dòng lệnh
Comment[zh_CN]=使用命令行
Comment[zh_TW]=使用命令列
TryExec=lxterminal
Exec=lxterminal
Icon=lxterminal
Type=Application
Categories=GTK;Utility;TerminalEmulator;System;

that make the .desktop file incredibly long, verbose, and with the need to RE-INSTALL it in case a new translation in added. most likely new translation will not be added, re-install an rpm because of that is only a waste of time/bandwitch ecc.

openSUSE way using %suse_update_desktop_file :

example of YaST.desktop

[Desktop Entry]
X-SuSE-translate=true
Type=Application
Categories=Settings;System;X-SuSE-Core-System;X-SuSE-ControlCenter-System;
Name=YaST
Icon=yast
GenericName=Administrator Settings
Exec=/usr/bin/xdg-su -c /sbin/yast2
Encoding=UTF-8

no specific translations are into the .desktop file itsealf, instead as i said are into:

/usr/share/locale/<LANGUAGE>/LC_MESSAGES/desktop_translations.mo

if a new language is added, or a translation upgrade occurr you have only to upgrade the "desktop-translations" package.

this is more effective in case 2 or more packages need the .desktop file to be upgtrade... in the "others" way you have to upgrade all the packages, with our you upgrade ONLY desktop-translations.

for me is not a good idea to remove what use added as improvments.. and add a simple %suse_version is not a much big deal if i can have big improvments.

my 2 cents

icons/user_comment.png a. f. wrote: (3 years ago)

sorry but fate don't keep the "\n" or something, you find the 2 .desktop files of the example here:

http://pastebin.com/qCrYpNEq

icons/user_comment.png L. N. wrote: (3 years ago)

nevertheless the ugly macro could be removed and instead an rpm brp script could transparently handle the translations.

icons/user_comment.png P. R. wrote: (3 years ago)

I am all in favor of this feature! If there is a 100% replacement for handling translations in brp-script we should do it as there is no valid usecase for using this SUSE specific macro.

PS: You can add/edit categories, mime types, etc. using desktop-file-install utility and if there is some functionality missing, we should push it there (I'm sure Vincent will help us :D)

icons/user_comment.png a. f. wrote: (3 years ago)

i'm sorry i completly disagree to remove it

why don't get rid completly of /usr/lib/rpm/suse_macros than?

i do believe and strongly push that we should keep and improve everything good and better we have compared to other distros... soon or later, that way, we'll have nothing that will make suse the best choice for something.

icons/user_comment.png C. M. wrote: (3 years ago)

Lets see if I understand it...

%suse_update_desktop_files in non openSUSE:<version> projects just adds a "X-SuSE-translate=true" string to the .desktop files and nothing else happens. Doesn't have any real function, correct?

In openSUSE:<version> projects what happens? Is %suse_update_desktop_files redefined to remove all the translations from the .desktop file and to copy them to .po files that end in the desktop-translations package? Or %suse_update_desktop_files still only adds the "X-SuSE-translate=true" string and is a brp script the thing that extracts the translations to .po files? Or it works in a completly different way? It's still far from clear to me.

icons/user_comment.png I. C. wrote: (3 years ago)

I think whatever this script does it could be evoked automatically before the build just as the script which creates debug packages (formerly one had to have %debug_package macro in their spec but now there is no such necessity).

Last change: 3 years ago
Voting
Score: 8
  • Negative: 2
  • Neutral: 1
  • Positive: 10
Tags

No tags yet.

Feature Export
Application-xmlXML   Text-x-logPlaintext   PrinterPrint