derivelocale

Returns the locale string for the specified locale.

Library:LibC
Classification:Other
Service:Locale

Syntax

  #include <locale.h> 
   
  char *derivelocale (
     const char    *language,
     const char    *country,
     char           locale [MAX_LOCNAME_LEN]);
  

Parameters

language

(IN) Points to a name for the locale’s language. See Remarks for a list of supported strings.

country

(IN) Points to a name for the country hosting the locale. See Remarks for a list of supported strings.

locale

(OUT) Points to the name associated with the locale in the form ll-cc where ll is a two-character designation for the language and cc a two-character designation of the hosting country.

Return Values

If successful, returns the name associated with the locale.

Remarks

The name associated with a locale is implementation-defined. This function allows you to determine that name based on numerous common strings. These are listed here. Case is unimportant to matching.

The following language names can be passed for language argument:

csy

czech

dan

danish

dea

des

deu

german

german-austrian

german-swiss

swiss

american

american english

american-english

australian

canadian

ena

enc

eng

english

english-american

english-aus

english-can

english-nz

english-uk

english-us

english-usa

enu

enz

uk

us

usa

esm

esn

esp

spanish

spanish-mexican

spanish-modern

spanish-spain

fin

finnish

fra

frb

frc

french

french-belgian

french-canadian

french-swiss

hun

hungarian

icelandic

isl

ita

italian

italian-swiss

its

japanese

jpn

kor

korean

belgian

dutch

dutch-belgian

nlb

nld

non

nor

norwegian

norwegian-bokmal

norwegian-nynorsk

plk

polish

portuguese

portuguese-brazil

portuguese-brazilian

ptb

portuguese-portugal

ptg

rus

russian

sve

swedish

chinese

chinese(prc)

chinese(taiwan)

chinese-simplified

chinese-traditional

chs

cht

The following country names can be passed as the country argument:

albania

arabia

argentina

australia, aus

austria

belgium, bel

bosnia

bosnia herzegovina

brazil, bra

bulgaria

canada french, can

canada english, can

chile

people’s republic of china, china, pr china, pr-chin, chn

colombia

croatia

czech republic, czech, cze

denmark, dnk

ecuador

finland, fin

france, fra

germany, deu

greece, grc

hong kong, hong-kong

hkg

hungary, hun

iceland, isl

international english

ireland, irl

israel

italy, ita

japan, jpn

korea, south korea

south-korea, kor

latin america

macedonia

malaysia

mexico, mex

montenegro

netherlands, holland

nld

new zealand, new-zealand, nz, nzl

norway, nor

poland, pol

portugal, prt

romania

russia, rus

serbia

singapore, sgp

slovakia, svk

slovenia

south africa

spain, esp

sweden, swe

switzerland, che

taiwan, twn

turkey, tur

united kingdom, great britain, britain, england, gbr

united states, united-states, america, us, usa

venezuela

yugoslavia

See Also