Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/translation#9 Create API Action to rebuild Multilingual Schema #12112

Merged
merged 1 commit into from
May 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 schema on non Multilingual database');
}
}