Get Locale

About method

This method is used to obtain a localized string for the requested language based on the text string identifier (locale code).

Method Usage

To get a localized string, you need to send a POST request to the following URL:

https://cp.ocugine.pro/api/localization/get_locale/

Accepted Parameters:

Param Type Usage
app_id double Ocugine Project ID
app_key string Ocugine Project Client Key
lang string Language code for requested locale. For example: "en".
code string ID of requested localized string. For example: "test-node"

After which the server will give the following information:

{
  "complete": true,
  "message": "",
  "data": {
    "uid": "1",
    "code": "test-node",
    "value": "This is a test",
    "language": "en",
    "project_id": "1"
  }
}

Where:

Param Type Usage
complete bool The status of the operation. If false, the locale could not be obtained.
message string / null Error message. If complete = true, returns null
data locale object Current locale data

Locale Object

The following describes the locale object returned by the server. With it, you can get the value of localized strings.

Param Type Usage
uid bool Internal locale ID
code string ID of requested localized string
value string Value for requested localized string
language string Language code for requested localized string
project_id double Ocugine Project ID for requested localized string