function l10n_update_locale_translate_edit_form_submit in Localization update 7
Same name and namespace in other branches
- 6 l10n_update.module \l10n_update_locale_translate_edit_form_submit()
- 7.2 l10n_update.module \l10n_update_locale_translate_edit_form_submit()
Additional submit handler for locale and i18n_string translation edit form.
Mark locally edited translations as customized.
See also
1 string reference to 'l10n_update_locale_translate_edit_form_submit'
- l10n_update_form_alter in ./
l10n_update.module - Implements hook_form_alter().
File
- ./
l10n_update.module, line 192 - Download translations from remote localization server.
Code
function l10n_update_locale_translate_edit_form_submit($form, &$form_state) {
module_load_include('inc', 'l10n_update');
$lid = $form_state['values']['lid'];
foreach ($form_state['values']['translations'] as $langcode => $value) {
if (!empty($value) && $value != $form_state['complete form']['translations'][$langcode]['#default_value']) {
// An update has been made, mark the string as customized.
db_update('locales_target')
->fields(array(
'l10n_status' => L10N_UPDATE_STRING_CUSTOM,
))
->condition('lid', $lid)
->condition('language', $langcode)
->execute();
}
}
}