Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -984,7 +984,48 @@ |
985 | 985 | return $group->getMessage( $handle->getKey(), $code ); |
986 | 986 | } |
987 | 987 | } |
| 988 | +} |
988 | 989 | |
| 990 | +class WorkflowStatesMessageGroup extends WikiMessageGroup { |
| 991 | + // id and source are not needed |
| 992 | + public function __construct() {} |
| 993 | + |
| 994 | + public function getId() { |
| 995 | + return 'translate-workflow-states'; |
| 996 | + } |
| 997 | + |
| 998 | + public function getLabel() { |
| 999 | + return wfMessage( 'translate-workflowgroup-label' )->text(); |
| 1000 | + } |
| 1001 | + |
| 1002 | + public function getDescription() { |
| 1003 | + return wfMessage( 'translate-workflowgroup-desc' )->text(); |
| 1004 | + } |
| 1005 | + |
| 1006 | + public function getDefinitions() { |
| 1007 | + global $wgTranslateWorkflowStates; |
| 1008 | + |
| 1009 | + $defs = array(); |
| 1010 | + |
| 1011 | + foreach ( array_keys( $wgTranslateWorkflowStates ) as $state ) { |
| 1012 | + $titleString = "Translate-workflow-state-$state"; |
| 1013 | + |
| 1014 | + // Automatically create pages for workflow states in the original language |
| 1015 | + $title = Title::makeTitle( $this->getNamespace(), $titleString ); |
| 1016 | + if ( !$title->exists() ) { |
| 1017 | + $page = new WikiPage( $title ); |
| 1018 | + $page->doEdit( |
| 1019 | + $state, |
| 1020 | + wfMessage( 'translate-workflow-autocreated-summary', $state )->inContentLanguage()->text(), |
| 1021 | + EDIT_NEW |
| 1022 | + ); |
| 1023 | + } |
| 1024 | + |
| 1025 | + $defs[$titleString] = $state; |
| 1026 | + } |
| 1027 | + |
| 1028 | + return $defs; |
| 1029 | + } |
989 | 1030 | } |
990 | 1031 | |
991 | 1032 | /** |
— | — | @@ -1056,6 +1097,7 @@ |
1057 | 1098 | global $wgEnablePageTranslation, $wgTranslateGroupFiles; |
1058 | 1099 | global $wgTranslateAC, $wgTranslateEC, $wgTranslateCC; |
1059 | 1100 | global $wgAutoloadClasses; |
| 1101 | + global $wgTranslateWorkflowStates; |
1060 | 1102 | |
1061 | 1103 | $deps = array(); |
1062 | 1104 | $deps[] = new GlobalDependency( 'wgTranslateAddMWExtensionGroups' ); |
— | — | @@ -1091,6 +1133,10 @@ |
1092 | 1134 | } |
1093 | 1135 | } |
1094 | 1136 | |
| 1137 | + if ( $wgTranslateWorkflowStates ) { |
| 1138 | + $wgTranslateCC['translate-workflow-states'] = new WorkflowStatesMessageGroup(); |
| 1139 | + } |
| 1140 | + |
1095 | 1141 | $autoload = array(); |
1096 | 1142 | wfRunHooks( 'TranslatePostInitGroups', array( &$wgTranslateCC, &$deps, &$autoload ) ); |
1097 | 1143 | |
Index: trunk/extensions/Translate/_autoload.php |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | $wgAutoloadClasses['WikiPageMessageGroup'] = $dir . 'MessageGroups.php'; |
37 | 37 | $wgAutoloadClasses['AliasMessageGroup'] = $dir . 'MessageGroups.php'; |
38 | 38 | $wgAutoloadClasses['RecentMessageGroup'] = $dir . 'MessageGroups.php'; |
| 39 | +$wgAutoloadClasses['WorkflowStatesMessageGroup'] = $dir . 'MessageGroups.php'; |
39 | 40 | |
40 | 41 | $wgAutoloadClasses['MessageCollection'] = $dir . 'MessageCollection.php'; |
41 | 42 | $wgAutoloadClasses['MessageDefinitions'] = $dir . 'MessageCollection.php'; |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -407,8 +407,13 @@ |
408 | 408 | 'translate-workflow-set-do' => 'Set', |
409 | 409 | 'translate-workflow-set-doing' => 'Setting...', |
410 | 410 | 'translate-workflow-set-done' => 'Set!', |
| 411 | + 'translate-workflow-autocreated-summary' => 'Automatic creation of page for workflow state $1', |
411 | 412 | 'translate-stats-workflow' => 'Status', |
412 | 413 | |
| 414 | + 'translate-workflowgroup-label' => 'Workflow states', |
| 415 | + 'translate-workflowgroup-desc' => 'This message group shows the translation workflow states. |
| 416 | +The states are defined in the configuration variable $wgTranslateWorkflowStates.', |
| 417 | + |
413 | 418 | // Dynamic message groups |
414 | 419 | 'translate-dynagroup-recent-label' => 'Recent translations', |
415 | 420 | 'translate-dynagroup-recent-desc' => 'This message group shows all recent translations into this language. |
— | — | @@ -674,6 +679,7 @@ |
675 | 680 | 'translate-workflow-set-do' => 'Submit button text when active', |
676 | 681 | 'translate-workflow-set-doing' => 'Submit button text when waiting for reply from server', |
677 | 682 | 'translate-workflow-set-done' => 'Submit button text when submission completed succesfully', |
| 683 | + 'translate-workflow-autocreated-summary' => 'This is an edit summary for the automatic creation of a workflow state page.', |
678 | 684 | 'translate-stats-workflow' => 'Column header on Special:LanguageStats and Special:MessageGroupStats', |
679 | 685 | ); |
680 | 686 | |
— | — | @@ -9561,7 +9567,11 @@ |
9562 | 9568 | 'translate-workflow-set-do' => 'הגדרה', |
9563 | 9569 | 'translate-workflow-set-doing' => 'מתבצעת הגדרה...', |
9564 | 9570 | 'translate-workflow-set-done' => 'הוגדר!', |
| 9571 | + 'translate-workflow-autocreated-summary' => 'יצירה אוטומטית של דף עם מצב התרגום $1', |
9565 | 9572 | 'translate-stats-workflow' => 'מצב', |
| 9573 | + 'translate-workflowgroup-label' => 'מצבי תרגום', |
| 9574 | + 'translate-workflowgroup-desc' => 'קבוצת ההודעות הזאת מציגה את המצבים האפשריים של תרגום הודעות. |
| 9575 | +המצבים מוגדרים במשתנה $wgTranslateWorkflowStates בקובץ ההגדרות של ההרחבה Translate.', |
9566 | 9576 | 'translate-dynagroup-recent-label' => 'תרגומים אחרונים', |
9567 | 9577 | 'translate-dynagroup-recent-desc' => 'קבוצת ההודעות הזאת מציגה את כל התרגומים האחרונים לשפה הזאת. |
9568 | 9578 | זה שימושי בעיקר במצבים "{{int:translate-task-acceptqueue}}" ו"{{int:translate-task-reviewall}}".', |