function lingotek_get_source_language_json in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.2 lingotek.dashboard.inc \lingotek_get_source_language_json()
- 7.3 lingotek.dashboard.inc \lingotek_get_source_language_json()
Outputs the language code with page count in json format. Supplied to the dashboard. Output Format (example): {'code':'en_US','docs':'500'}
1 call to lingotek_get_source_language_json()
- lingotek_get_dashboard_code in ./
lingotek.dashboard.inc - Generates the code for the embedded Javascript dashboard.
File
- ./
lingotek.dashboard.inc, line 280 - Lingotek Dashboard.
Code
function lingotek_get_source_language_json() {
$data = array();
$source_language = lingotek_get_source_language();
$data['code'] = Lingotek::convertDrupal2Lingotek($source_language);
$data['edited'] = LingotekSync::getCountByStatus(LingotekSync::STATUS_EDITED);
$data['pending'] = LingotekSync::getCountByStatus(LingotekSync::STATUS_PENDING);
$data['ready'] = LingotekSync::getCountByStatus(LingotekSync::STATUS_READY);
$data['current'] = LingotekSync::getCountByStatus(LingotekSync::STATUS_CURRENT);
$data['docs'] = $data['edited'] + $data['pending'] + $data['ready'] + $data['current'];
return json_encode($data);
}