Manual Reference Pages - I18N::LANGTAGS::DETECT (3)
I18N::LangTags::Detect - detect the users language preferences
my @user_wants = I18N::LangTags::Detect::detect();
It is a common problem to want to detect what language(s) the user would
prefer output in.
This module defines one public function,
I18N::LangTags::Detect::detect(). This function is not exported
(nor is even exportable), and it takes no parameters.
In scalar context, the function returns the most preferred language
tag (or undef if no preference was seen).
In list context (which is usually what you want),
the function returns a
(possibly empty) list of language tags representing (best first) what
languages the user apparently would accept output in. You will
probably want to pass the output of this through
I18N::LangTags::implicate_supers(...), like so:
my @languages =
This module looks for several environment variables, including
LANGUAGE, LC_ALL, LC_MESSAGES, and LANG.
It will also use the Win32::Locale module, if its installed.
I18N::LangTags, Win32::Locale, Locale::Maketext.
(This modules core code started out as a routine in Locale::Maketext;
but I moved it here once I realized it was more generally useful.)
Copyright (c) 1998-2004 Sean M. Burke. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
The programs and documentation in this dist are distributed in
the hope that they will be useful, but without any warranty; without
even the implied warranty of merchantability or fitness for a
Sean M. Burke email@example.com
|perl v5.20.3 ||I18N::LANGTAGS::DETECT (3) ||2004-06-21 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.