Page tree
Skip to end of metadata
Go to start of metadata

The languages array lets a developer specify one or more language codes that can be applied to HTML content for internationalization.  Adding the languages configuration won't add automatically the language button to the toolbar which needs to be specified as explained in the command and id's section here

This array directly configures the languages available for application in the languages menu. Selecting a language from the languages menu sets the HTML lang attribute for text selected in the editor.

Setting the languages configuration array overrides the languages array defaults.

Note that only some languages have their names translated into all Textbox.io UI languages (see Translated Language Codes below). A developer may choose to apply languages codes from this list, or specify any 2 or 4 letter language code. When specifying a language code that is outside of the translated language codes list (like 'x-klingon'), that language code will appear in the language menu.

Example Configuration

In this example, a simple configuration object is created that specifies which languages to use in the language menu. Note, as mentioned before, not all of these language codes will be translated by Textbox.io.

var config = {
	ui: {
		languages : [	// Languages array, sets the available languages to apply 
			'fr', 		// French
			'fr_ca', 	// French (Canadian)
			'en_gb', 	// English (United Kingdom)
			'x-klingon' // x-klingon : klingon  
		]
	} 
};
 
var editor = textboxio.replace('#targetId', config);

Properties

PropertyTypeProperties
languagesArrayarray of string language codes

Defaults

LanguageLanguage Code String

English

en

Spanish

es

French

fr

German

de

Portuguese

pt

Chinese

zh

Translated Language Codes

LanguageLanguage Code String

Arabic

ar

Catalan

ca
Chinesezh

Chinese (Simplified)

zh_cn

Chinese (Traditional)

zh_tw

Croatian

hr

Czech

cs

Danish

da

Dutch

nl

English

en
English (Australia)en_au
English (Canada)en_ca
English (United Kingdom)en_gb
English (United States)en_us

Farsi

fa

Finnish

fi
Frenchfr

French (Canada)

fr_ca

German

de

Greek

el

Hebrew

he

Hungarian

hu

Italian

it

Japanese

ja

Kazakh

kk

Korean

ko

Norwegian

no

Polish

pl
Portugesept

Portuguese (Brazil)

pt_br

Portuguese (Portugal)

pt_pt

Romanian

ro

Russian

ru

Slovak

sk

Slovenian

sl

Spanish

es

Spanish (Latin America)

es_419

Spanish (Spain)

es_es

Swedish

sv

Thai

th

Tartar

tt

Turkish

tr

Ukrainian

uk
  • No labels