Open2b versione 7.5

languages

languages.find

Returns all the languages of the site.

Request

Admin SDK
Admin.api('site.languages.find', request, function(response) { … });
HTTP POST
/api/v10/site.languages.find
{
  "fields" : [ "code", "name", … ] // fields to return - string
}

Response

{
  "status" : "ok",
  "languages" : [ { // languages
    "code" : "de", // code (ISO) - string(2)
    "name" : "Deutsch (German)", // name - string(1…35)
    "region" : "DE", // region (ISO code) - string(2)
    "currency" : "EUR", // currency (ISO code) - string(3)
    "isActive" : true, // indicates if it is showed on the site - bool
    "isDefault" : true // indicates if it is the dafult language - bool
  }, … ]
}

languages.create

Creates a new language for the site

Request

Admin SDK
Admin.api('site.languages.create', request, function(response) { … });
HTTP POST
/api/v10/site.languages.create
{
  "language" : { // language to create (required)
    "code" : "de", // code (ISO) (required) - string(2)
    "region" : "DE", // region (ISO code) (required) - string(2)
    "currency" : "EUR", // currency (ISO code) - string(3)
    "isActive" : true // indicates if it is showed on the site - bool
  }
}

Response

{
  "status" : "ok"
}

Errors

Field Type Description
code AlreadyExist Code '<code>' already exists
code Malformed '<code>' is not a valid language code
currency Malformed '<currency>' is not a valid currency code
language LimitReached Maximum number of languages has been reached
region Malformed '<region>' is not a valid region code for language '<code>'

languages.update

Updates a language. Any fields left out of the request will remain unchanged.

Request

Admin SDK
Admin.api('site.languages.update', request, function(response) { … });
HTTP POST
/api/v10/site.languages.update
{
  "code" : "de", // code (ISO) of the language to update (required) - string(2)
  "language" : { // language's fields to update (required)
    "code" : "en", // new code (ISO) - string(2)
    "region" : "UK", // region (ISO code) - string(2)
    "currency" : "GBP", // default currency (ISO code) - string(3)
    "isActive" : true // indicates if it is showed on the site - bool
  }
}

Response

{
  "status" : "ok"
}

Errors

Field Type Description
code Malformed Language '<code>' is not a valid language code
code NotFound Language '<code>' does not exist
currency Malformed '<currency>' is not a valid currency code
isActive InvalidValue 'isActive' can not be set to false for the default language
region Malformed '<region>' is not a valid region code for language '<code>'

languages.delete

Deletes one or more languages. The first language can not be deleted.

Request

Admin SDK
Admin.api('site.languages.delete', request, function(response) { … });
HTTP POST
/api/v10/site.languages.delete
{
  "codes" : [ "de", "en", … ] // codes (ISO) of the languages to delete (required) - string(2)
}

Response

{
  "status" : "ok"
}
Field Type Description
codes Malformed '<code>' is not a valid language code

Available languages

The following languages are supported:

Code Name Region
bg български (Bulgarian)
BG
България (Bulgaria)
ca Català (Catalan)
ES
Català (Catalan)
cs Čeština (Czech)
CZ
Česká republika (Czech Republic)
da Dansk (Danish)
DK
Danmark (Denmark)
de Deutsch (German)
AT
Österreich (Austria)
CH
Schweiz (Switzerland)
DE
Deutschland (Germany)
LI
Liechtenstein (Liechtenstein)
LU
Luxemburg (Luxembourg)
el Ελληνικά (Greek)
GR
Ελλάδα (Greece)
en English (English)
AU
Australia (Australia)
CA
Canada (Canada)
GB
United Kingdom (United Kingdom)
IE
Eire (Ireland)
NZ
New Zealand (New Zealand)
US
United States (United States)
ZA
South Africa (South Africa)
es Español (Spanish)
AR
Argentina (Argentina)
CL
Chile (Chile)
CO
Colombia (Colombia)
CR
Costa Rica (Costa Rica)
DO
República Dominicana (Dominican Republic)
EC
Ecuador (Ecuador)
ES
España (Spain)
GT
Guatemala (Guatemala)
HN
Honduras (Honduras)
MX
México (Mexico)
NI
Nicaragua (Nicaragua)
PA
Panamá (Panama)
PE
Perú (Peru)
PR
Puerto Rico (Puerto Rico)
PY
Paraguay (Paraguay)
SV
El Salvador (El Salvador)
UY
Uruguay (Uruguay)
VE
Republica Bolivariana de Venezuela (Venezuela)
et Eesti (Estonian)
EE
Eesti (Estonia)
fi Suomi (Finnish)
FI
Suomi (Finland)
fr Français (French)
BE
Belgique (Belgium)
CA
Canada (Canada)
CH
Suisse (Switzerland)
FR
France (France)
LU
Luxembourg (Luxembourg)
MC
Principauté de Monaco (Principality of Monaco)
gl Galego (Galician)
ES
Galego (Galician)
hr Hrvatski (Croatian)
BA
Bosna i Hercegovina (Bosnia and Herzegovina)
HR
Hrvatska (Croatia)
hu Magyar (Hungarian)
HU
Magyarország (Hungary)
is Íslenska (Icelandic)
IS
Ísland (Iceland)
it Italiano (Italian)
CH
Svizzera (Switzerland)
IT
Italia (Italy)
SM
San Marino (San Marino)
lv Latviešu (Latvian)
LV
Latvija (Latvia)
mt Malti (Maltese)
MT
Malta (Malta)
nb Norsk, bokmål (Norwegian, Bokmål)
NO
Norge (Norway)
nl Nederlands (Dutch)
BE
België (Belgium)
NL
Nederland (Netherlands)
pl Polski (Polish)
PL
Polska (Poland)
pt Português (Portuguese)
BR
Brasil (Brazil)
PT
Portugal (Portugal)
ro Română (Romanian)
RO
România (Romania)
sk Slovenčina (Slovak)
SK
Slovenská republika (Slovakia)
sl Slovenski (Slovenian)
SI
Slovenija (Slovenia)
sq Shqipe (Albanian)
AL
Shqipëria (Albania)
sv Svenska (Swedish)
FI
Finland (Finland)
SE
Sverige (Sweden)
uk Україньска (Ukrainian)
UA
Україна (Ukraine)