Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -248,15 +248,29 @@ |
249 | 249 | // Add links to other languages |
250 | 250 | $suffix = ( $code === 'en' ) ? '' : "/$code"; |
251 | 251 | $_title = Title::makeTitle( $title->getNamespace(), $title->getDBkey() . $suffix ); |
252 | | - |
253 | | - if ( $parser->getTitle()->getText() === $_title->getText() ) { |
| 252 | + if ( intval( $percent ) === 0 ) { |
| 253 | + /* When language is included because it is a priority language, |
| 254 | + * but translation does not yet exists, link directly to the |
| 255 | + * translation view. */ |
| 256 | + $translate = SpecialPage::getTitleFor( 'Translate' ); |
| 257 | + $params = array( |
| 258 | + 'group' => $page->getMessageGroupId(), |
| 259 | + 'language' => $code, |
| 260 | + 'task' => 'view' |
| 261 | + ); |
| 262 | + $attribs = array( |
| 263 | + 'title' => wfMessage( 'tpt-languages-zero' )->text(), |
| 264 | + 'class' => 'new', // For red link color |
| 265 | + ); |
| 266 | + $languages[] = Linker::link( $translate, "$name $percentImage", $attribs, $params ); |
| 267 | + } elseif ( $parser->getTitle()->getText() === $_title->getText() ) { |
254 | 268 | $name = Html::rawElement( 'span', array( 'class' => 'mw-pt-languages-selected' ), $name ); |
255 | 269 | $languages[] = "$name $percentImage"; |
256 | 270 | } else { |
257 | 271 | if ( $code === $userLangCode ) { |
258 | 272 | $name = Html::rawElement( 'span', array( 'class' => 'mw-pt-languages-ui' ), $name ); |
259 | 273 | } |
260 | | - $languages[] = Linker::link( $_title, "$name $percentImage" ); |
| 274 | + $languages[] = Linker::linkKnown( $_title, "$name $percentImage" ); |
261 | 275 | } |
262 | 276 | } |
263 | 277 | |
Index: trunk/extensions/Translate/PageTranslation.i18n.php |
— | — | @@ -86,6 +86,7 @@ |
87 | 87 | |
88 | 88 | 'tpt-languages-legend' => 'Other languages:', |
89 | 89 | 'tpt-languages-separator' => ' • ', |
| 90 | + 'tpt-languages-zero' => 'Start translation for this language', |
90 | 91 | |
91 | 92 | 'tpt-target-page' => 'This page cannot be updated manually. |
92 | 93 | This page is a translation of page [[$1]] and the translation can be updated using [$2 the translation tool].', |
— | — | @@ -259,6 +260,7 @@ |
260 | 261 | 'pt-deletepage-action-check' => 'This is a button label. "List" is an imperative verb.', |
261 | 262 | 'pt-deletepage-current' => '{{Identical|Page name}}', |
262 | 263 | 'pt-deletepage-reason' => '{{Identical|Reason}}', |
| 264 | + 'tpt-languages-zero' => 'Tooltip for a link in <language /> when language is included because it is a priority language, but translation does not yet exists. It links directly to the translation view.', |
263 | 265 | ); |
264 | 266 | |
265 | 267 | /** ꢱꣃꢬꢵꢯ꣄ꢡ꣄ꢬꢵ (ꢱꣃꢬꢵꢯ꣄ꢡ꣄ꢬꢵ) |