PHP Classes
elePHPant
Icontem

PHP Language Info: Get information about a language

Recommend this page to a friend!
  Info   View files Documentation   View files View files (20)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-06-11 (3 months ago) RSS 2.0 feedStarStar 39%Total: 102 All time: 8,740 This week: 616Up
Version License PHP version Categories
language-info 1.0.4Custom (specified...5Localization, PHP 5
Description Author

This class can get information about a language.

It takes as parameter the code of a given language.

The class returns the name of the language in the same or other language given also its code.

Innovation Award
PHP Programming Innovation award nominee
May 2017
Number 10
The name of each language changes from language to language that you are using mention the language name.

This class can get the names of the languages in many different languages.

Manuel Lemos
  Performance   Level  
Name: Peter Kahl <contact>
Classes: 32 packages by
Country: Hong Kong Hong Kong
Age: ???
All time rank: 6854 in Hong Kong Hong Kong
Week rank: 15 Up1 in Hong Kong Hong Kong Up
Innovation award
Innovation award
Nominee: 18x

Details

Language Info (Multilingual)

Converts language code to a full name in requested language.

Translations are available in these languages: * Arabic (????) * Czech (?e?tina) * German (Deutsch) * Danish (dansk) * English * Spanish (español) * French (français) * Hebrew (???????) * Italian (italiano) * Japanese (???) * Dutch (Nederlands) * Portuguese (português) * Russian (???????) * Slovak (sloven?ina) * Chinese simplified (????) * Chinese traditional (????)

Language codes that can be converted to full name in any of the above languages:

<pre> albanian arabic armenian azeri bengali bulgarian burmese cebuano chinese chinese simplified chinese traditional croatian czech danish dutch english english gb english us estonian farsi finnish french georgian german greek gujarati hausa hawaiian hebrew hindi hungarian icelandic indonesian italian japanese kazakh khmer korean kyrgyz lao latin latvian lithuanian macedonian malayalam mongolian nepali norwegian pashto pidgin polish portuguese romanian russian serbian sinhalese slovak slovene somali spanish swahili swedish tagalog tamil thai tibetan turkish ukrainian urdu uzbek vietnamese welsh </pre>

How to Use

use peterkahl\LanguageInfo\LanguageInfo;

echo LanguageInfo::getName($key, $langCode);

Parameters

key ... The word (language name or code) we want to translate. Admissible values are 2-letter code, 3-letter code or full name in English (case-insensitive).

langCode ... The code of the language we want to translate the key to. Admissible values are 2-letter code (case-insensitive).

Usage Examples

use peterkahl\LanguageInfo\LanguageInfo;

echo LanguageInfo::getName('AR', 'EN');       # Arabic

echo LanguageInfo::getName('ara', 'EN');      # Arabic

echo LanguageInfo::getName('HE', 'ar');       # ????? ???????

echo LanguageInfo::getName('ru_RU', 'de_AT'); # Russisch

echo LanguageInfo::getName('Russian', 'zh');  # ??

echo LanguageInfo::getName('bo', 'en-us');    # Tibetan

echo LanguageInfo::getName('bo', 'fr');       # tibétain

echo LanguageInfo::getName('bod', 'DE');      # Tibetisch

echo LanguageInfo::getName('zh-cn', 'en');    # Chinese simplified

echo LanguageInfo::getName('zh-tw', 'en');    # Chinese traditional

echo LanguageInfo::getName('chinese traditional', 'de'); # Chinesisch traditionell

echo LanguageInfo::getName('zh', 'en');       # Chinese

# Non-existent code
echo LanguageInfo::getName('xx-xx', 'en');    # unknown xx-xx
  Files folder image Files  
File Role Description
Files folder imagesrc (17 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Accessible without login Plain text file ar.php Aux. Auxiliary script
  Accessible without login Plain text file cs.php Aux. Auxiliary script
  Accessible without login Plain text file da.php Aux. Auxiliary script
  Accessible without login Plain text file de.php Aux. Auxiliary script
  Accessible without login Plain text file en.php Aux. Auxiliary script
  Accessible without login Plain text file es.php Aux. Auxiliary script
  Accessible without login Plain text file fr.php Aux. Auxiliary script
  Accessible without login Plain text file he.php Aux. Auxiliary script
  Accessible without login Plain text file it.php Aux. Auxiliary script
  Accessible without login Plain text file ja.php Aux. Auxiliary script
  Plain text file LanguageInfo.php Class Class source
  Accessible without login Plain text file nl.php Aux. Auxiliary script
  Accessible without login Plain text file pt.php Aux. Auxiliary script
  Accessible without login Plain text file ru.php Aux. Auxiliary script
  Accessible without login Plain text file sk.php Aux. Auxiliary script
  Accessible without login Plain text file zh-cn.php Aux. Auxiliary script
  Accessible without login Plain text file zh-hk.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:102
This week:0
All time:8,740
This week:616Up
User Ratings User Comments (1)
 All time
Utility:58%StarStarStar
Consistency:58%StarStarStar
Documentation:41%StarStarStar
Examples:-
Tests:-
Videos:-
Overall:39%StarStar
Rank:2930
 
Non-PSR compliant
3 months ago (Sergey Karavay)
17%Star