languages.pm (60b96b8d) | languages.pm (f5a0c083) |
---|---|
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 --- 462 unchanged lines hidden (view full) --- 471 The ... part, if it exists, is typically en-US. 472 473 If $language does not contain a '_' then $language is returned unmodified. 474 475=cut 476sub get_normalized_language ($) 477{ 478 my ($language) = @_; | 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 --- 462 unchanged lines hidden (view full) --- 471 The ... part, if it exists, is typically en-US. 472 473 If $language does not contain a '_' then $language is returned unmodified. 474 475=cut 476sub get_normalized_language ($) 477{ 478 my ($language) = @_; |
479 480 if ($language =~ /^.*?_(.*)$/) | 479 480 if (ref($language) eq "ARRAY") |
481 { | 481 { |
482 if (scalar @$language > 1 && $language->[0] eq "en-US") 483 { 484 return $language->[1]; 485 } 486 else 487 { 488 return $language; 489 } 490 } 491 elsif ($language =~ /^.*?_(.*)$/) 492 { |
|
482 return $1; 483 } 484 else 485 { 486 return $language; 487 } 488} 489 4901; | 493 return $1; 494 } 495 else 496 { 497 return $language; 498 } 499} 500 5011; |