Skip to content

Commit

Permalink
Remove the "pm_" prefix from all language string identifiers
Browse files Browse the repository at this point in the history
The prefix was still a leftover from the old pagemove plugin and isn't
needed at all.
  • Loading branch information
michitux committed Nov 24, 2013
1 parent bcaa37b commit d778d3f
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 249 deletions.
4 changes: 2 additions & 2 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ public function handle_ajax_call(Doku_Event $event, $params) {
ob_start();
html_msgarea();
if ($remaining === false) {
ptln('<p>'.sprintf($this->getLang('pm_ns_move_error'), $opts['ns'], $opts['newns']).'</p>');
ptln('<p>'.sprintf($this->getLang('ns_move_error'), $opts['ns'], $opts['newns']).'</p>');
echo $helper->getNSMoveButton('tryagain', $id);
echo $helper->getNSMoveButton('skip', $id);
echo $helper->getNSMoveButton('abort', $id);
} else {
ptln('<p>'.sprintf($this->getLang('pm_ns_move_continued'), $opts['ns'], $opts['newns'], $remaining).'</p>');
ptln('<p>'.sprintf($this->getLang('ns_move_continued'), $opts['ns'], $opts['newns'], $remaining).'</p>');
}
$result['html'] = ob_get_clean();
} else {
Expand Down
42 changes: 21 additions & 21 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ function getMenuText() {
global $INFO;

if( !$INFO['exists'] )
return $this->getLang('menu').' ('.sprintf($this->getLang('pm_notexist'), $INFO['id']).')';
return $this->getLang('menu').' ('.sprintf($this->getLang('notexist'), $INFO['id']).')';
elseif( !$INFO['writable'] )
return $this->getLang('menu').' ('.$this->getLang('pm_notwrite').')';
return $this->getLang('menu').' ('.$this->getLang('notwrite').')';
else
return $this->getLang('menu');
}
Expand All @@ -75,22 +75,22 @@ function html() {
switch ($this->ns_move_state) {
case 'started':
ptln('<p>');
ptln(sprintf($this->getLang('pm_ns_move_started'), hsc($this->ns_opts['ns']), hsc($this->ns_opts['newns']), $this->ns_opts['num_pages'], $this->ns_opts['num_media']));
ptln(sprintf($this->getLang('ns_move_started'), hsc($this->ns_opts['ns']), hsc($this->ns_opts['newns']), $this->ns_opts['num_pages'], $this->ns_opts['num_media']));
ptln('</p>');
ptln($this->helper->getNSMoveButton('continue'));
ptln($this->helper->getNSMoveButton('abort'));
break;
case 'error':
ptln('<p>');
ptln(sprintf($this->getLang('pm_ns_move_error'), $this->ns_opts['ns'], $this->ns_opts['newns']));
ptln(sprintf($this->getLang('ns_move_error'), $this->ns_opts['ns'], $this->ns_opts['newns']));
ptln('</p>');
ptln($this->helper->getNSMoveButton('tryagain'));
ptln($this->helper->getNSMoveButton('skip'));
ptln($this->helper->getNSMoveButton('abort'));
break;
case 'continued':
ptln('<p>');
ptln(sprintf($this->getLang('pm_ns_move_continued'), $this->ns_opts['ns'], $this->ns_opts['newns'], $this->ns_opts['remaining']));
ptln(sprintf($this->getLang('ns_move_continued'), $this->ns_opts['ns'], $this->ns_opts['newns'], $this->ns_opts['remaining']));
ptln('</p>');

ptln($this->helper->getNSMoveButton('continue'));
Expand Down Expand Up @@ -120,21 +120,21 @@ function printForm() {
$form->addHidden('page', $this->getPluginName());
$form->addHidden('id', $ID);
$form->addHidden('move_type', 'page');
$form->startFieldset($this->getLang('pm_movepage'));
$form->addElement(form_makeMenuField('ns_for_page', $ns_select_data, $this->opts['ns_for_page'], $this->getLang('pm_targetns'), '', 'block'));
$form->addElement(form_makeTextField('newns', $this->opts['newns'], $this->getLang('pm_newtargetns'), '', 'block'));
$form->addElement(form_makeTextField('newname', $this->opts['newname'], $this->getLang('pm_newname'), '', 'block'));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('pm_submit')));
$form->startFieldset($this->getLang('movepage'));
$form->addElement(form_makeMenuField('ns_for_page', $ns_select_data, $this->opts['ns_for_page'], $this->getLang('targetns'), '', 'block'));
$form->addElement(form_makeTextField('newns', $this->opts['newns'], $this->getLang('newtargetns'), '', 'block'));
$form->addElement(form_makeTextField('newname', $this->opts['newname'], $this->getLang('newname'), '', 'block'));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('submit')));
$form->endFieldset();
$form->printForm();

if ($this->ns_opts !== false) {
ptln('<fieldset>');
ptln('<legend>');
ptln($this->getLang('pm_movens'));
ptln($this->getLang('movens'));
ptln('</legend>');
ptln('<p>');
ptln(sprintf($this->getLang('pm_ns_move_in_progress'), $this->ns_opts['num_pages'], $this->ns_opts['num_media'], ':'.hsc($this->ns_opts['ns']), ':'.hsc($this->ns_opts['newns'])));
ptln(sprintf($this->getLang('ns_move_in_progress'), $this->ns_opts['num_pages'], $this->ns_opts['num_media'], ':'.hsc($this->ns_opts['ns']), ':'.hsc($this->ns_opts['newns'])));
ptln('</p>');
ptln($this->helper->getNSMoveButton('continue'));
ptln($this->helper->getNSMoveButton('abort'));
Expand All @@ -144,11 +144,11 @@ function printForm() {
$form->addHidden('page', $this->getPluginName());
$form->addHidden('id', $ID);
$form->addHidden('move_type', 'namespace');
$form->startFieldset($this->getLang('pm_movens'));
$form->addElement(form_makeMenuField('targetns', $ns_select_data, $this->opts['targetns'], $this->getLang('pm_targetns'), '', 'block'));
$form->addElement(form_makeTextField('newnsname', $this->opts['newnsname'], $this->getLang('pm_newnsname'), '', 'block'));
$form->addElement(form_makeMenuField('contenttomove', array('pages' => $this->getLang('pm_move_pages'), 'media' => $this->getLang('pm_move_media'), 'both' => $this->getLang('pm_move_media_and_pages')), $this->opts['contenttomove'], $this->getLang('pm_content_to_move'), '', 'block'));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('pm_submit')));
$form->startFieldset($this->getLang('movens'));
$form->addElement(form_makeMenuField('targetns', $ns_select_data, $this->opts['targetns'], $this->getLang('targetns'), '', 'block'));
$form->addElement(form_makeTextField('newnsname', $this->opts['newnsname'], $this->getLang('newnsname'), '', 'block'));
$form->addElement(form_makeMenuField('contenttomove', array('pages' => $this->getLang('move_pages'), 'media' => $this->getLang('move_media'), 'both' => $this->getLang('move_media_and_pages')), $this->opts['contenttomove'], $this->getLang('content_to_move'), '', 'block'));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('submit')));
$form->endFieldset();
$form->printForm();
}
Expand All @@ -160,7 +160,7 @@ function printForm() {
*
* @author Michael Hamann <[email protected]>
* @author Gary Owen <[email protected]>
* @author Arno Puschmann (bin out of _pm_form)
* @author Arno Puschmann (bin out of _form)
*/
private function build_namespace_select_content($ns) {
global $conf;
Expand All @@ -173,8 +173,8 @@ private function build_namespace_select_content($ns) {
foreach($namesp as $row) {
if ( auth_quickaclcheck($row['id'].':*') >= AUTH_CREATE || $row['id'] == $ns ) {

$result[($row['id'] ? $row['id'] : ':')] = ($row['id'] ? $row['id'].':' : ": ".$this->getLang('pm_root')).
($row['id'] == $ns ? ' '.$this->getLang('pm_current') : '');
$result[($row['id'] ? $row['id'] : ':')] = ($row['id'] ? $row['id'].':' : ": ".$this->getLang('root')).
($row['id'] == $ns ? ' '.$this->getLang('current') : '');
}
}
return $result;
Expand Down Expand Up @@ -258,7 +258,7 @@ function handle() {
} else {
// check that the pagename is valid
if ($this->opts['newname'] == '' ) {
msg($this->getLang('pm_badname'), -1);
msg($this->getLang('badname'), -1);
return;
}

Expand Down
40 changes: 20 additions & 20 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ public function move_page(&$opts, $checkonly = false) {

// Check we have rights to move this document
if ( !page_exists($ID)) {
msg(sprintf($this->getLang('pm_notexist'), $ID), -1);
msg(sprintf($this->getLang('notexist'), $ID), -1);
return false;
}
if ( auth_quickaclcheck($ID) < AUTH_EDIT ) {
msg(sprintf($this->getLang('pm_norights'), hsc($ID)), -1);
msg(sprintf($this->getLang('norights'), hsc($ID)), -1);
return false;
}

Expand All @@ -348,7 +348,7 @@ public function move_page(&$opts, $checkonly = false) {
// the file exists check checks if the page is reported unlocked if a lock exists which means that
// the page is locked by the current user
if (checklock($ID) !== false || @file_exists(wikiLockFN($ID))) {
msg( sprintf($this->getLang('pm_filelocked'), hsc($ID)), -1);
msg( sprintf($this->getLang('filelocked'), hsc($ID)), -1);
return false;
}

Expand All @@ -358,18 +358,18 @@ public function move_page(&$opts, $checkonly = false) {

// Has the document name and/or namespace changed?
if ( $opts['newns'] == $opts['ns'] && $opts['newname'] == $opts['name'] ) {
msg($this->getLang('pm_nochange'), -1);
msg($this->getLang('nochange'), -1);
return false;
}
// Check the page does not already exist
if ( @file_exists($opts['new_path']) ) {
msg(sprintf($this->getLang('pm_existing'), $opts['newname'], ($opts['newns'] == '' ? $this->getLang('pm_root') : $opts['newns'])), -1);
msg(sprintf($this->getLang('existing'), $opts['newname'], ($opts['newns'] == '' ? $this->getLang('root') : $opts['newns'])), -1);
return false;
}

// Check if the current user can create the new page
if (auth_quickaclcheck($opts['new_id']) < AUTH_CREATE) {
msg(sprintf($this->getLang('pm_notargetperms'), $opts['new_id']), -1);
msg(sprintf($this->getLang('notargetperms'), $opts['new_id']), -1);
return false;
}

Expand Down Expand Up @@ -419,13 +419,13 @@ public function move_page(&$opts, $checkonly = false) {

// Save the updated document in its new location
if ($opts['ns'] == $opts['newns']) {
$lang_key = 'pm_renamed';
$lang_key = 'renamed';
}
elseif ( $opts['name'] == $opts['newname'] ) {
$lang_key = 'pm_moved';
$lang_key = 'moved';
}
else {
$lang_key = 'pm_move_rename';
$lang_key = 'move_rename';
}

// Wait a second when the page has just been rewritten
Expand All @@ -436,7 +436,7 @@ public function move_page(&$opts, $checkonly = false) {

// Delete the orginal file
if (@file_exists(wikiFN($opts['new_id']))) {
saveWikiText($ID, '', $this->getLang('pm_delete') );
saveWikiText($ID, '', $this->getLang('delete') );
}

// Move the old revisions
Expand Down Expand Up @@ -481,12 +481,12 @@ public function move_media(&$opts, $checkonly = false) {

// Check we have rights to move this document
if ( !file_exists(mediaFN($opts['id']))) {
msg(sprintf($this->getLang('pm_medianotexist'), hsc($opts['id'])), -1);
msg(sprintf($this->getLang('medianotexist'), hsc($opts['id'])), -1);
return false;
}

if ( auth_quickaclcheck($opts['ns'].':*') < AUTH_DELETE ) {
msg(sprintf($this->getLang('pm_nomediarights'), hsc($opts['id'])), -1);
msg(sprintf($this->getLang('nomediarights'), hsc($opts['id'])), -1);
return false;
}

Expand All @@ -496,18 +496,18 @@ public function move_media(&$opts, $checkonly = false) {

// Has the document name and/or namespace changed?
if ( $opts['newns'] == $opts['ns'] && $opts['newname'] == $opts['name'] ) {
msg($this->getLang('pm_nomediachange'), -1);
msg($this->getLang('nomediachange'), -1);
return false;
}
// Check the page does not already exist
if ( @file_exists($opts['new_path']) ) {
msg(sprintf($this->getLang('pm_mediaexisting'), $opts['newname'], ($opts['newns'] == '' ? $this->getLang('pm_root') : $opts['newns'])), -1);
msg(sprintf($this->getLang('mediaexisting'), $opts['newname'], ($opts['newns'] == '' ? $this->getLang('root') : $opts['newns'])), -1);
return false;
}

// Check if the current user can create the new page
if (auth_quickaclcheck($opts['new_ns'].':*') < AUTH_UPLOAD) {
msg(sprintf($this->getLang('pm_nomediatargetperms'), $opts['new_id']), -1);
msg(sprintf($this->getLang('nomediatargetperms'), $opts['new_id']), -1);
return false;
}

Expand Down Expand Up @@ -709,7 +709,7 @@ public function execute_rewrites($id, $text = null) {
// Wait a second if page has just been saved
$oldRev = getRevisions($id, -1, 1, 1024); // from changelog
if ($oldRev == time()) sleep(1);
saveWikiText($id, $text, $this->getLang('pm_linkchange'));
saveWikiText($id, $text, $this->getLang('linkchange'));
}
unset($meta['moves']);
unset($meta['media_moves']);
Expand Down Expand Up @@ -839,18 +839,18 @@ public function getNSMoveButton($action, $id = NULL) {
case 'tryagain':
$form->addHidden('continue_namespace_move', true);
if ($action == 'tryagain') {
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('pm_ns_move_tryagain')));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('ns_move_tryagain')));
} else {
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('pm_ns_move_continue')));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('ns_move_continue')));
}
break;
case 'skip':
$form->addHidden('skip_continue_namespace_move', true);
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('pm_ns_move_skip')));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('ns_move_skip')));
break;
case 'abort':
$form->addHidden('abort_namespace_move', true);
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('pm_ns_move_abort')));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('ns_move_abort')));
break;
default:
return false;
Expand Down
28 changes: 14 additions & 14 deletions lang/cs/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
$lang['menu'] = 'Přesun/přejmenování stránky';
$lang['desc'] = 'Plugin pro přesun/přejmenování stránku';

//$lang['pm_notexist'] = 'Toto téma ještě neexistuje';
$lang['pm_notwrite'] = 'Nemáte dostatečná oprávnění pro úpravu stránky';
$lang['pm_badns'] = 'Neplatný název jmenného prostoru';
$lang['pm_badname'] = 'Neplatný název stránky';
$lang['pm_nochange'] = 'Jméno stránky a jmenného prostoru se nezměnilo';
$lang['pm_existing1'] = 'Stránka %s již existuje v %s';
$lang['pm_root'] = '[Kořen]';
$lang['pm_current'] = '(Současný)';
//$lang['pm_norights'] = 'Nemáte právo editovat jednu nebo více odkazujících stránek';
$lang['pm_filelocked'] = 'Tento soubor je uzamčen - zkuste prosím znovu později';
$lang['pm_linkchange1'] = 'Odkazy na %s změněny na %s';
$lang['pm_newname'] = 'Nový název stránky :';
$lang['pm_targetns'] = 'Cílový jmenný prostor :';
$lang['pm_submit'] = 'Potvrdit';
//$lang['notexist'] = 'Toto téma ještě neexistuje';
$lang['notwrite'] = 'Nemáte dostatečná oprávnění pro úpravu stránky';
$lang['badns'] = 'Neplatný název jmenného prostoru';
$lang['badname'] = 'Neplatný název stránky';
$lang['nochange'] = 'Jméno stránky a jmenného prostoru se nezměnilo';
$lang['existing1'] = 'Stránka %s již existuje v %s';
$lang['root'] = '[Kořen]';
$lang['current'] = '(Současný)';
//$lang['norights'] = 'Nemáte právo editovat jednu nebo více odkazujících stránek';
$lang['filelocked'] = 'Tento soubor je uzamčen - zkuste prosím znovu později';
$lang['linkchange1'] = 'Odkazy na %s změněny na %s';
$lang['newname'] = 'Nový název stránky :';
$lang['targetns'] = 'Cílový jmenný prostor :';
$lang['submit'] = 'Potvrdit';


Loading

0 comments on commit d778d3f

Please sign in to comment.