Skip to content

Commit

Permalink
dev/translation#9 Create API Action to rebuild Multilingual Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
seamuslee001 committed Apr 10, 2018
1 parent fce4583 commit f86232b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/v3/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,21 @@ function civicrm_api3_system_createmissinglogtables() {
}
return civicrm_api3_create_success(1);
}

/**
* Rebuild Multilingual Schema
*
*/
function civicrm_api3_system_rebuildMultilingualSchema() {
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);

if ($domain->locales) {
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
CRM_Core_I18n_Schema::rebuildMultilingualSchema($locales);
return civicrm_api3_create_success(1);
}
else {
throw new API_Exception('Cannot call rebuild Multilingual scheama on non Multilingual database');
}
}

0 comments on commit f86232b

Please sign in to comment.