[pacman-dev] internationalized package descriptions?
krics at gds.hu
Thu May 18 21:27:00 EDT 2006
2006. 05. 19, péntek keltezéssel 02.04-kor Maksim Sipos ezt írta:
> I've been interested in i18n support for the upcoming pacman. I've
> noticed patches on the subject of gettext support and all that and I
> think that is wonderful!
> Now I'm thinking how it would be feasible to implement localized
> package descriptions. I am imagining something like pkgdesc_xx fields
> (xx being the language codes) in PKGBUILD scripts, and smart pacman
> frontends that would show the translated description string based on
> the users locale, if it is available (otherwise, show the english
> Now, before I start hacking at the code, I would like to see what
> others think of the idea, and potential ways of designing it. I'm also
> interested in knowing how well adding fields like this would play out
> in pacman's database. I think it would be really cool if pacman had
> this feature :).
Hey there! :) Sorry for answering before vmiklos :)) The idea is good.
As i know (correct me if i'm wrong) now descriptions are handled via %
DESC% in pacman's code. To PKGBUILD it isn't hard to implement this. But
in pacman code there is much more complicated.
As we know that if you follow the way pkgdesc="something" and
pkgdesc_XX_yy="" scheme then we got troubles in %DESC% field.
I don't know the right codepart for %DESC% processing. But i see two
1. need to extend %DESC% , %DESC_XX_YY% , etc..etc..
2. need to extend %DESC% with something like this:
en - english and core description (eqivalent to simple pkgdesc="")
XX_YY - some other language description (eqivalent to pkgdesc_XX_YY="")
As in the codepart we need to catch the actual locale (this is easy) .
1 situation: If we got the actual locale example: hu_HU then in
codeparsing we need to "search" for %DESC_hu_HU% part instead of %DESC%
2 situation: If we got the actual locale: example hu_HU then we need a
rewrited parser code which somehow (not want to write technical stuff
here now) which pulls out from %DESC% the line stars with hu_HU .
At sit 1. and sit. 2 we need to do a check if a description is available
in that locale what we are running example: xx_YY if that not founded
then we roll back to default english style. This is easly possible and
We need to think whats better. the %DESC_XX_YY% or the
en - somedesc
XX_YY - somethingdesc in other language
I prefer the second way because we don't need to store unusefull
newlines. So the filesize not growns too big.
If this is a good idea i will work on it and code it into pacman
If not a good idea i will code it too. :P Maybe just wont be commited
(like my libarchive and progressbar patches ...).
Waiting for comments :)
Christian Hamar alias krix
Frugalware Developer Team
More information about the pacman-dev