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

(-)a/C4/Languages.pm (-3 / +24 lines)
Lines 371-378 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 = $language_groups->{$a}->[0]->{rfc4646_subtag};
374
            my $aa = '';
375
            my $bb = $language_groups->{$b}->[0]->{rfc4646_subtag};
375
	    my $bb = '';
376
	    my $acount = @{$language_groups->{$a}};
377
	    my $bcount = @{$language_groups->{$b}};
378
	    if ( $language_groups->{$a}->[0]->{enabled} ) {
379
                $aa = $language_groups->{$a}->[0]->{rfc4646_subtag};
380
	    } elsif ( $acount > 1 ) {
381
		for ( my $i=1;$i<$acount;$i++ ) {
382
                    if ( $language_groups->{$a}->[$i]->{enabled} ) {
383
			$aa = $language_groups->{$a}->[$i]->{rfc4646_subtag};
384
			last;
385
		    }
386
	        }
387
	    }
388
	    if ( $language_groups->{$b}->[0]->{enabled} ) {
389
                $bb = $language_groups->{$b}->[0]->{rfc4646_subtag};
390
	    } elsif ( $bcount > 1 ) {
391
		for ( my $i=1;$i<$bcount;$i++ ) {
392
		    if ($language_groups->{$b}->[$i]->{enabled} ) {
393
                        $bb = $language_groups->{$b}->[$i]->{rfc4646_subtag};
394
			last;
395
		    }
396
		}
397
	    }
376
            ( exists $idx{$aa} and exists $idx{$bb} and ( $idx{$aa} cmp $idx{$bb} ) )
398
            ( exists $idx{$aa} and exists $idx{$bb} and ( $idx{$aa} cmp $idx{$bb} ) )
377
            || ( exists $idx{$aa} and exists $idx{$bb} )
399
            || ( exists $idx{$aa} and exists $idx{$bb} )
378
            || exists $idx{$bb}
400
            || exists $idx{$bb}
379
- 

Return to bug 32775