get_active_languages(); $version = isset($_GET['version']) ? $_GET['version'] : false; if(isset($_POST['action']) && $_POST['action']=='icl_admo_add_translations' && wp_verify_nonce($_POST['_wpnonce'], 'icl_adm_save_translations')){ $translations_add = array(); if(!empty($_POST['add_new'])){ $new_translations = unserialize(base64_decode($_POST['add_new'])); foreach($new_translations as $tr){ $translations_add[] = array( 'string' => $tr[ 'string' ], 'translation' => $tr[ 'new' ], 'name' => $tr[ 'name' ], 'gettext_context' => $tr[ 'gettext_context' ] ); } if(!empty($translations_add)){ $user_messages[] = sprintf(_n('%d new translation was added.', '%d new translations were added.', count($translations_add), 'wpml-string-translation'), count($translations_add)); } } if(!empty($_POST['selected'])){ $translations_updated = 0; foreach($_POST['selected'] as $idx => $v){ if(!empty($v)){ $translations_add[] = array( 'string' => base64_decode( $_POST[ 'string' ][ $idx ] ), 'translation' => base64_decode( $_POST[ 'translation' ][ $idx ] ), 'name' => base64_decode( $_POST[ 'name' ] [ $idx ] ), 'gettext_context' => base64_decode( $_POST[ 'gettext_context' ][ $idx ] ) ); $translations_updated++; } } if($translations_updated){ $user_messages[] = sprintf(_n('%d translation was updated.', '%d translations were updated.', $translations_updated, 'wpml-string-translation'), $translations_updated); } } if($translations_add){ $WPML_ST_MO_Downloader->save_translations($translations_add, $_POST['language'], $_POST['version']); }else{ $user_errors[] = __('No action performed. Please select the strings that you need to update or add.', 'wpml-string-translation'); } } if(isset($active_languages[$language])){ try{ $WPML_ST_MO_Downloader->load_xml(); $WPML_ST_MO_Downloader->get_translation_files(); $version_projects = explode(';', $version); $types = array(); foreach($version_projects as $project){ $exp = explode('|', $project); $types[] = $exp[0]; } $translations = $WPML_ST_MO_Downloader->get_translations($language, array('types' => $types)); }catch(Exception $error){ $user_errors[] = $error->getMessage(); } } ?>


bottom of this page and click on the Proceed button.', 'wpml-string-translation'), isset($translations['new']) ? count($translations['new']) : 0, isset($translations['updated']) ? count($translations['updated']) : 0, ' href="#adm-proceed"'); ?>

$translation): ?>

$translation): ?>