languages.pm (f5a0c083) languages.pm (677600b0)
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 465 unchanged lines hidden (view full) ---

474
475=cut
476sub get_normalized_language ($)
477{
478 my ($language) = @_;
479
480 if (ref($language) eq "ARRAY")
481 {
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 465 unchanged lines hidden (view full) ---

474
475=cut
476sub get_normalized_language ($)
477{
478 my ($language) = @_;
479
480 if (ref($language) eq "ARRAY")
481 {
482 if (scalar @$language > 1 && $language->[0] eq "en-US")
482 if (scalar @$language > 1)
483 {
483 {
484 return $language->[1];
484 if ($language->[0] eq "en-US")
485 {
486 return $language->[1];
487 }
488 else
489 {
490 return $language->[0];
491 }
485 }
486 else
487 {
492 }
493 else
494 {
488 return $language;
495 return join("_", @$language);
489 }
490 }
491 elsif ($language =~ /^.*?_(.*)$/)
492 {
493 return $1;
494 }
495 else
496 {
497 return $language;
498 }
499}
500
5011;
496 }
497 }
498 elsif ($language =~ /^.*?_(.*)$/)
499 {
500 return $1;
501 }
502 else
503 {
504 return $language;
505 }
506}
507
5081;