Re: all of the web pages will now have a mirror list.
On Fri, Jun 08, 2001 at 11:40:18PM +0200, Denis Barbier wrote:
> > > > Same problem applies to ie. consultants page where countries are in
> > > > wrong order in translations[1]. Basically problem is same, so it would
> > > > be useful to think enough general solution for this. With my
> > > > knowledge about WML it would be some kind of Perl function to sort
> > > > those things that would be used everywhere when needed.
> > >
> > > Yes, I think it can be done the way it's done in the languages template.
> > > I'll look into it, unless someone beats me to it.
> >
> > It could have been done, were it not for the dreaded slices[1].
> [...]
> > Maybe Denis can show us an elegant way to do this?
>
> not sure this is elegant, but it seems to work.
Not sure what that thing down there is :)) but it does seem to work.
It doesn't know how to handle characters like © (which should be sorted
between S and T), though :o) Could that be fixed by tweaking the regexp?
> my $mirrors_lang = {};
> foreach $m (keys %mirrors) {
> while ($m =~ m/\[([A-Z_]+):(.*?):\]/g) {
> $mirrors_lang->{$1}->{$2} = $mirrors{$m};
> }
> }
> foreach $l (keys %$mirrors_lang) {
> foreach $m (sort langcmp keys %{$mirrors_lang->{$l}}) {
> <perl:print> [$l:<option value=\"http://www.$mirrors_lang->{$l}->{$m}.debian.org\">$m</option>\n:]</perl:print>
> }
> }
BTW I'm going to organize it in a slightly different way, without the new
tag.
--
Digital Electronic Being Intended for Assassination and Nullification
Reply to: