diff --git a/qa-tagging-tools.php b/qa-tagging-tools.php index acea15e..8845f93 100644 --- a/qa-tagging-tools.php +++ b/qa-tagging-tools.php @@ -57,7 +57,10 @@ public function filter_question(&$question, &$errors, $oldquestion) } if (count($errorTags)) { - $msg = 'You need '.$reqPoints.' points to create new tags. The following tags are not allowed: '.qa_html(implode(', ', $errorTags)); + $msg = strtr(qa_lang_html('taggingtools/tags_not_usable'), array( + '^1' => qa_html($reqPoints), + '^2' => qa_html(implode(', ', $errorTags)), + )); $errors['tags'] = $msg; } } @@ -90,11 +93,11 @@ public function admin_form(&$qa_content) qa_opt('tagging_tools_synonyms', strtolower(trim(qa_post_text('tagging_tools_synonyms')))); qa_opt('tagging_tools_prevent', (int) qa_post_text('tagging_tools_prevent')); qa_opt('tagging_tools_rep', (int) qa_post_text('tagging_tools_rep')); - $saved_msg = '
Tag Synonyms settings saved
'; + $saved_msg = '
'.qa_lang_html('taggingtools/admin_saved').'
'; // convert all old tags based on synonyms if (qa_post_text('tagging_tools_convert')) { - $saved_msg = '
Editing tags...
'; + $saved_msg = '
'.qa_lang_html('taggingtools/recalc_start').'
'; $js = file_get_contents($this->directory.'/tag-admin.js'); $replace = array( @@ -116,30 +119,30 @@ public function admin_form(&$qa_content) 'fields' => array( array( - 'label' => 'Tag Synonyms', + 'label' => qa_lang_html('taggingtools/admin_synonyms'), 'tags' => 'name="tagging_tools_synonyms" id="tagging_tools_synonyms"', 'value' => qa_opt('tagging_tools_synonyms'), 'type' => 'textarea', 'rows' => 20, - 'note' => 'Put each pair of synonyms on a new line. q2a,question2answer means that a tag of q2a will be replaced by question2answer, while help on its own means that tag will be removed.', + 'note' => qa_lang_html('taggingtools/admin_synonyms_note'), ), array( - 'label' => 'Also convert existing tags using above rules', + 'label' => qa_lang_html('taggingtools/admin_convert'), 'tags' => 'name="tagging_tools_convert" id="tagging_tools_convert"', 'value' => '', 'type' => 'checkbox', ), array( - 'label' => 'Prevent new users from creating new tags', + 'label' => qa_lang_html('taggingtools/admin_prevent'), 'tags' => 'name="tagging_tools_prevent" id="tagging_tools_prevent"', 'value' => qa_opt('tagging_tools_prevent'), 'type' => 'checkbox', ), array( + 'label' => qa_lang_html('taggingtools/admin_minpoints'), 'id' => 'tagging_tools_rep', - 'label' => 'Minimum reputation to create new tags', 'value' => qa_opt('tagging_tools_rep'), 'tags' => 'name="tagging_tools_rep"', 'type' => 'number', @@ -153,7 +156,7 @@ public function admin_form(&$qa_content) 'buttons' => array( array( - 'label' => 'Save Changes', + 'label' => qa_lang_html('main/save_button'), 'tags' => 'name="tagging_tools_save_button"', ), ), diff --git a/qa-tt-lang-default.php b/qa-tt-lang-default.php index 96b1420..f285a31 100644 --- a/qa-tt-lang-default.php +++ b/qa-tt-lang-default.php @@ -6,8 +6,19 @@ return array( - 'tag_not_usable' => 'The tag ^1 does not exist; you need ^2 points to create new tags.', + // client-side + 'tag_not_usable_js' => 'The tag ^1 does not exist; you need ^2 points to create new tags.', + // server-side + 'tags_not_usable' => 'You need ^1 points to create new tags. The following tags are not allowed: ^2', + 'admin_saved' => 'Tag Synonyms settings saved', + 'admin_synonyms' => 'Tag Synonyms', + 'admin_synonyms_note' => 'Put each pair of synonyms on a new line. q2a,question2answer means that a tag of q2a will be replaced by question2answer, while help on its own means that tag will be removed.', + 'admin_convert' => 'Also convert existing tags using above rules', + 'admin_prevent' => 'Prevent new users from creating new tags', + 'admin_minpoints' => 'Minimum reputation to create new tags', + + 'recalc_start' => 'Editing tags...', 'recalc_progress' => 'Editing tags... ^1 posts remaining...', 'recalc_error' => 'There was an error editing the tags.', 'recalc_done' => 'All tags edited!', diff --git a/qa-tt-layer.php b/qa-tt-layer.php index c0d6bb7..19603eb 100644 --- a/qa-tt-layer.php +++ b/qa-tt-layer.php @@ -14,7 +14,7 @@ public function head_script() $replace = array( 'VAR_TAG_SEPARATOR' => qa_opt('tag_separator_comma') ? qa_js(',') : qa_js(' '), 'VAR_TAG_POINTS' => number_format(qa_opt('tagging_tools_rep')), - 'VAR_TAG_ERROR' => qa_js(qa_lang('taggingtools/tag_not_usable')), + 'VAR_TAG_ERROR' => qa_js(qa_lang('taggingtools/tag_not_usable_js')), ); $js = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY.'/tag-filter.js'); $js = strtr($js, $replace);