Language and Localization
Localization in database requests
When submitting any API GET or POST request to Classics Live, a lang
parameter can be passed that will attempt to automatically translate any relevant return data. This is done by recursively applying language lookups to any database field that begins with the string "tr_".
If a specific language is not requested, the lang
field in the requester's users entry will be used. If this case is not applicable, or if the requested string is not available in the requested language, the language used will correspond with the constant DEFAULT_LANG
in private/constants.php (which is "en_US" by default).
Here, we'll log into Classics Live by sending an MD5 hash for Super Mario 64 and requesting data back with the language code "ja_JP".
POST /public/api/request.php HTTP/1.1
Host: https://classicslive.net
request=login&hash=20B854B239203BAF6C961B850A4A51A2&lang=ja_JP
{
"success": true,
"id": 5,
"title": "スーパーマリオ64",
"console": "n64",
"tags": ["3dplatformer","1p","millionseller"],
"endianness": 0,
"pointer_size": 4,
"session_id": "0d15ea5e"
}
Supported languages
This is a list of languages acknowledged by the Classics Live backend. This does not mean, however, that all site content is available in each of these languages.
const LANGUAGES = array
(
'en_US' => 'English (United States)',
'en_GB' => 'English (United Kingdom)',
'ja_JP' => 'Japanese',
'fr_FR' => 'French',
'es_ES' => 'Spanish (Spain)',
'es_MX' => 'Spanish (Mexico)',
'de_DE' => 'German',
'it_IT' => 'Italian',
'nl_NL' => 'Dutch',
'pt_PL' => 'Portugese (Portugal)',
'pt_BR' => 'Portugese (Brazil)',
'ru_RU' => 'Russian',
'ko_KR' => 'Korean',
'zh_CN' => 'Chinese (Simplified)',
'zh_TW' => 'Chinese (Traditional)',
'eo_EO' => 'Esperanto',
'pl_PL' => 'Polish',
'vi_VN' => 'Vietnamese',
'ar_SA' => 'Arabic',
'el_GR' => 'Greek',
'tr_TR' => 'Turkish'
);