Languages endpoint

Languages documentation

Fetch all system languages

system_languages([params=None])

Fetches all languages that Lokalise supports.

Parameters:

params (dict) – (optional) pagination options

Returns:

Collection of languages

Example:

client.system_languages({"page": 2, "limit": 10})

Fetch all project languages

project_languages(project_id[, params=None])

Fetches all languages for the given project.

Parameters:
Returns:

Collection of languages

Example:

client.project_languages('123.abc', {"page": 2, "limit": 3})

Create project languages

create_languages(project_id, params)

Create one or more languages for the given project.

param str project_id:

ID of the project

param params:

Language parameters

type params:

dict or list

return:

Collection of languages

Example:

client.create_languages('123.abc', [
    {
        "lang_iso": "ar",
        "custom_name": "Custom AR"
    },
    {
        "lang_iso": "be_BY",
        "custom_iso": "by_2"
    }
])

Fetch a single project language

language(project_id, language_id)
Parameters:
  • project_id (str) – ID of the project

  • language_id – ID of the language to fetch

Returns:

Language model

Example:

language = client.language('123.abc', 345)
language.lang_iso # => 'lv'
language.is_rtl # => False

Update project language

update_language(project_id, language_id, params)
Parameters:
  • project_id (str) – ID of the project

  • language_id – ID of the language to update

  • params (dict) – Update parameters

Returns:

Language model

Example:

client.update_language('123.abc', 345, {
    "lang_name": "My very own name"
})

Delete project language

delete_language(project_id, language_id)
Parameters:
  • project_id (str) – ID of the project

  • language_id – ID of the language to delete

Returns:

Dictionary with project ID and “language_deleted” set to True

Rtype dict:

Example:

client.delete_language('123.abc', 345)