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
2019-10-15 (18 hours ago) RSS 2.0 feedStarStar 39%Total: 106 This week: 1All time: 9,177 This week: 346Up
Version License PHP version Categories
language-info 1.0.6Custom (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: 37 packages by
Country: United Kingdom United Kingdom
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

 

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:106
This week:1
All time:9,177
This week:346Up
User Ratings User Comments (1)
 All time
Utility:58%StarStarStar
Consistency:58%StarStarStar
Documentation:41%StarStarStar
Examples:-
Tests:-
Videos:-
Overall:39%StarStar
Rank:3034
 
Non-PSR compliant
2 years ago (Sergey Karavay)
17%Star