Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Language Code List for PHP Programs

This guide lists common language codes. PHP programs and apps such as WordPress use them to pick a language.

Domains and DNS2 min read5 steps1 screenshots

What is a language code?

A language code is a short label for a language. It is like a name tag. Instead of writing "English", a program uses en. PHP is a language that runs many websites. A PHP app reads the code to show text in the right language.

The short code usually has two letters. It comes from a standard called ISO 639-1. A longer code adds the country after an underscore or dash. For example, en_US means English as used in the United States. en_GB means English as used in Great Britain.

Common codes

LanguageShort codeExample with country
Englishenen_US, en_GB
Spanisheses_ES, es_MX
Frenchfrfr_FR, fr_CA
Germandede_DE
Italianitit_IT
Portugueseptpt_PT, pt_BR
Dutchnlnl_NL
Russianruru_RU
Arabicarar_SA
Hindihihi_IN
Chinese (Simplified)zhzh_CN
Chinese (Traditional)zhzh_TW
Japanesejaja_JP
Koreankoko_KR
Turkishtrtr_TR
Polishplpl_PL
Swedishsvsv_SE
Indonesianidid_ID

How to use a code

  1. Find your language in the table.
  2. Open the settings or config file of your PHP app.
  3. Look for a setting named something like lang, locale or language.
  4. Type the code. Keep the same style the app already uses.
  5. Save the file and reload your site.

In plain PHP, you can set the locale like this.

setlocale(LC_ALL, 'fr_FR.UTF-8');

This asks PHP to use French formats for dates and numbers. The server must have that language installed.

Tip: Some apps use a dash, like en-US. Others use an underscore, like en_US. Copy the style your app already shows.

Ask Hostvento support through a support ticket if a language is missing on your server.

Quick recap

  • A language code is a short name tag for a language.
    language-code-list-for-php-programs
  • Two letters give the language. A second part gives the country.
  • Put the code in your app's language or locale setting.
  • Match the dash or underscore style the app uses.