View | Details | Raw Unified | Return to bug 32775
Collapse All | Expand All

(-)a/C4/Languages.pm (-24 / +27 lines)
Lines 371-403 sub _build_languages_arrayref { Link Here
371
371
372
        my %idx = map { $enabled_languages->[$_] => $_ } reverse 0 .. @$enabled_languages-1;
372
        my %idx = map { $enabled_languages->[$_] => $_ } reverse 0 .. @$enabled_languages-1;
373
        my @ordered_keys = sort {
373
        my @ordered_keys = sort {
374
            my $aa = '';
374
            my $aa     = '';
375
	    my $bb = '';
375
            my $bb     = '';
376
	    my $acount = @{$language_groups->{$a}};
376
            my $acount = @{ $language_groups->{$a} };
377
	    my $bcount = @{$language_groups->{$b}};
377
            my $bcount = @{ $language_groups->{$b} };
378
	    if ( $language_groups->{$a}->[0]->{enabled} ) {
378
            if ( $language_groups->{$a}->[0]->{enabled} ) {
379
                $aa = $language_groups->{$a}->[0]->{rfc4646_subtag};
379
                $aa = $language_groups->{$a}->[0]->{rfc4646_subtag};
380
	    } elsif ( $acount > 1 ) {
380
            }
381
		for ( my $i=1;$i<$acount;$i++ ) {
381
            elsif ( $acount > 1 ) {
382
                for ( my $i = 1 ; $i < $acount ; $i++ ) {
382
                    if ( $language_groups->{$a}->[$i]->{enabled} ) {
383
                    if ( $language_groups->{$a}->[$i]->{enabled} ) {
383
			$aa = $language_groups->{$a}->[$i]->{rfc4646_subtag};
384
                        $aa = $language_groups->{$a}->[$i]->{rfc4646_subtag};
384
			last;
385
                        last;
385
		    }
386
                    }
386
	        }
387
                }
387
	    }
388
            }
388
	    if ( $language_groups->{$b}->[0]->{enabled} ) {
389
            if ( $language_groups->{$b}->[0]->{enabled} ) {
389
                $bb = $language_groups->{$b}->[0]->{rfc4646_subtag};
390
                $bb = $language_groups->{$b}->[0]->{rfc4646_subtag};
390
	    } elsif ( $bcount > 1 ) {
391
            }
391
		for ( my $i=1;$i<$bcount;$i++ ) {
392
            elsif ( $bcount > 1 ) {
392
		    if ($language_groups->{$b}->[$i]->{enabled} ) {
393
                for ( my $i = 1 ; $i < $bcount ; $i++ ) {
394
                    if ( $language_groups->{$b}->[$i]->{enabled} ) {
393
                        $bb = $language_groups->{$b}->[$i]->{rfc4646_subtag};
395
                        $bb = $language_groups->{$b}->[$i]->{rfc4646_subtag};
394
			last;
396
                        last;
395
		    }
397
                    }
396
		}
398
                }
397
	    }
399
            }
398
            ( exists $idx{$aa} and exists $idx{$bb} and ( $idx{$aa} cmp $idx{$bb} ) )
400
            (         exists $idx{$aa}
399
            || ( exists $idx{$aa} and exists $idx{$bb} )
401
                  and exists $idx{$bb}
400
            || exists $idx{$bb}
402
                  and ( $idx{$aa} cmp $idx{$bb} ) )
403
              || ( exists $idx{$aa} and exists $idx{$bb} )
404
              || exists $idx{$bb}
401
        } keys %$language_groups;
405
        } keys %$language_groups;
402
406
403
        for my $key ( @ordered_keys ) {
407
        for my $key ( @ordered_keys ) {
404
- 

Return to bug 32775