Edit report at https://pear.php.net/bugs/bug.php?id=19221&edit=1
ID: 19221
Updated by: cweiske@php.net
Reported By: cweiske at php dot net
Summary: Return ISO 639-1 or ISO 639-2 language codes
Status: Open
Type: Feature/Change Request
Package: Text_LanguageDetect
Package Version: SVN
PHP Version: HEAD SVN-2012-01-13
Roadmap Versions:
New Comment:
Also see http://perl.active-venture.com/lib/Locale/Country.html
Previous Comments:
------------------------------------------------------------------------
[2012-01-13 09:33:05] cweiske
Description:
------------
Currently Text_LanguageDetect returns language names only. It'd be nice
if it would return ISO 639-1 (2-letter) and ISO 639-2 (3-letter)
language codes.
I imagine an API like this:
$l = new Text_LanguageDetect();
$l->setLangFormat(Text_LanguageDetect::ALPHA_2);
$l->detect($text, 4);
The tricky part is probably that *all* methods would need to accept and
output such codes.
------------------------------------------------------------------------