# Locale::Language - ISO two letter codes for language identification (ISO 639)
# $Id: Language.pm,v 2.7 2004/06/10 21:19:34 neilb Exp $
package Locale
::Language
;
#-----------------------------------------------------------------------
# Public Global Variables
#-----------------------------------------------------------------------
use vars
qw($VERSION @ISA @EXPORT);
$VERSION = sprintf("%d.%02d", q$Revision: 2.7 $ =~ /(\d+)\.(\d+)/);
@EXPORT = qw(&code2language &language2code
&all_language_codes &all_language_names );
#-----------------------------------------------------------------------
# Private Global Variables
#-----------------------------------------------------------------------
#=======================================================================
#=======================================================================
return undef unless defined $code;
if (exists $CODES{$code})
#---------------------------------------------------------------
#---------------------------------------------------------------
#=======================================================================
# language2code ( LANGUAGE )
#=======================================================================
return undef unless defined $lang;
if (exists $LANGUAGES{$lang})
return $LANGUAGES{$lang};
#---------------------------------------------------------------
#---------------------------------------------------------------
#=======================================================================
#=======================================================================
#=======================================================================
#=======================================================================
#=======================================================================
# initialisation code - stuff the DATA into the CODES hash
#=======================================================================
($code, $language) = split(/:/, $_, 2);
$CODES{$code} = $language;
$LANGUAGES{"\L$language"} = $code;