Extension:Translate/Namespaces

This is a plan for moving Translate to PSR-4. All code except entry points will be moved to src/ and will be under a namespace tree starting from \MediaWiki\Extension\Translate. Command line script entry points will be kept under maintenance/scripts, but the classes would be moved under src/ for consistency.

Classes are grouped by features, not by functionality.

For consistency, I have done these changes

  • Use type-suffixes instead of prefixes (e.g. SpecialTranslate -> TranslateSpecialPage)
  • Suffixes: SpecialPage, ActionApi, MaintenanceScript, Job...
  • For special pages, action apis, jobs and maintenance scripts, place verb first (if any)
  • Changed all upper case acronyms to camel case
  • Avoid abbreviations (exception: stats)

Classes to deprecate or removeEdit

  1. !DELETE: FuzzyBot
  2. !DEPRECATE: RevTag
  3. !DELETE?: SyncGroup (integrate with ImportExternalTranslationsMaintenanceScript)
  4. TranslatePreferences (move to translatewiki repo)
  5. HTMLJsSelectToInputField (used by TranslatePreferences)
  6. TranslateToolbox (integrate with Hooks?)

\MediaWiki\Extension\TranslateEdit

Classes that do not belong to anywhere else. They integrate with MediaWiki core.

  1. Hooks <- TranslateHooks
  2. LogFormatter <- TranslateLogFormatter
  3. RecentChangesTranslationFilter <- TranslateRcFilter


DiagnosticsEdit

  1. ComparePluralImplementationsMaintenanceScript <- PluralCompare
  2. CompareYamlImplementationsMaintenanceScript <- YamlTests
  3. CreateLanguageFallbackGraphMaintenanceScript <- FallbacksCompare
  4. MigrateRevisionTagTableSchemaMaintenanceScript <- TSchema2
  5. PopulateFuzzyRevisionTagMaintenenanceScript <- PopulateFuzzy
  6. RemoveOrphanedActorsMaintenanceScript <- RemoveOrphanedActors
  7. TestWebServiceMaintenanceScript <- TestMT
  8. ValidateTranslationsMaintenanceScript <- CreateCheckIndex


FileFormatSupportEdit

This requires moving to id-based loaders in message group configurarion.

  1. AmdFfs <- AmdFFS
  2. AndroidFfs <- AndroidXmlFFS
  3. AppleFfs <- AppleFFS
  4. AppleInfoPlistFfs
  5. BaseFfs <- SimpleFFS
  6. DtdFfs <- DtdFFS
  7. GettextFfs <- GettextFFS
  8. IniFfs <- IniFFS
  9. JavaPropertiesFfs <- JavaFFS
  10. JsonFfs <- JsonFFS
  11. MalformedPlural <- GettextPluralException
  12. PhpVariablesFfs <- FlatPhpFFS
  13. XliffFfs <- XliffFFS
  14. YamlFfs <- YamlFFS
  15. interface FileFormatHandler <- interface FFS


MessageGroupEdit

  1. AggregateMessageGroup
  2. FileBasedMessageGroup
  3. MediaWikiExtensionMessageGroup
  4. RecentAdditionsMessageGroup
  5. RecentMessageGroup
  6. SandboxMessageGroup
  7. WikiMessageGroup
  8. WorkflowStatesMessageGroup
  9. interface MessageGroup


MessageGroupProcessingEdit

  1. AggregateGroupsActionApi <- ApiAggregateGroups
  2. AggregateGroupsSpecialPage <- SpecialAggregateGroups
  3. AggregateMessageGroupLoader
  4. FileBasedMessageGroupLoader
  5. GroupReviewActionApi <- ApiGroupReview
  6. ManageMessageGroupsActionApi <- ApiManageMessageGroups
  7. MessageGroupCache
  8. MessageGroupStates
  9. MessageGroupStatesUpdaterJob
  10. MessageGroupWANCache
  11. MessageGroups
  12. QueryManageMessageGroupsActionApi <- ApiQueryManageMessageGroups
  13. QueryMessageGroupsActionApi <- ApiQueryMessageGroups
  14. TranslateMetadata
  15. WorkflowStatesMessageGroupLoader
  16. interface CachedMessageGroupLoader


MessageGroupConfigurationEdit

  1. MessageGroupConfigurationParser
  2. PremadeIntuitionTextdomains
  3. PremadeMediawikiExtensionGroups
  4. interface MetaYamlSchemaExtender


MessageLoadingEdit

  1. QueryMessageCollectionActionApi <- ApiQueryMessageCollection
  2. QueryMessageTranslationsActionApi <- ApiQueryMessageTranslations
  3. CdbMessageIndex <- CDBMessageIndex
  4. CachedMessageIndex
  5. CreateMessageIndexMaintenanceScript <- CreateMessageIndex
  6. DatabaseMessageIndex
  7. FatMessage
  8. HashMessageIndex
  9. MessageCollection
  10. MessageDefinitions
  11. MessageHandle
  12. RebuildMessageIndexJob <- MessageIndexRebuildJob
  13. SerializedMessageIndex
  14. ThinMessage


MessageProcessingEdit

  1. ArrayFlattener
  2. GettextPlural
  3. SimpleStringComparator <- StringComparators\
  4. SmartFormatPlural
  5. StringMatcher
  6. UnicodePlural
  7. interface StringComparator <- StringComparators\
  8. interface StringMangler


PageTranslationEdit

  1. DeleteTranslatablePageJob <- TranslateDeleteJob
  2. DeleteTranslatablePageSpecialPage <- SpecialPageTranslationDeletePage
  3. Hooks <- PageTranslationHooks
  4. LogFormatter <- PageTranslationLogFormatter
  5. MigrateTranslatablePageSpecialPage <- SpecialPageMigration
  6. MoveTranslatablePageJob <- TranslatablePageMoveJob
  7. MoveTranslatablePageSpecialPage <- SpecialPageTranslationMovePage
  8. PageTranslationSpecialPage <- SpecialPageTranslation
  9. PrepareTranslatablePageSpecialPage <- SpecialPagePreparation
  10. RefreshTranslatablePagesMaintenanceScript <- RefreshTranslatablePages
  11. RenderTranslationPageJob <- TranslateRenderJob
  12. TranslatablePage
  13. TranslatablePageException <- TPException (XXX: needs refactoring in the future)
  14. TranslatablePageInsertablesSuggester
  15. TranslatablePageMessageGroup <- WikiPageMessageGroup
  16. TranslatablePageMessageGroupStore
  17. TranslatablePageParse <- TPParse
  18. TranslatablePageSection <- TPSection
  19. UpdateTranslationsJob <- TranslationsUpdateJob


StatisticsEdit

  1. CharacterEditStatsMaintenanceScript <- CharacterEditStats
  2. LanguageEditStatsMaintenanceScript <- Languageeditstats
  3. LanguageStatsSpecialPage <- SpecialLanguageStats
  4. MessageGroupStats
  5. MessageGroupStatsMaintenanceScript <- GroupStatistics
  6. MessageGroupStatsSpecialPage <- SpecialMessageGroupStats
  7. QueryLanguageStatsActionApi <- ApiQueryLanguageStats
  8. QueryMessageGroupStatsActionApi <- ApiQueryMessageGroupStats
  9. RebuildMessageGroupStatsJob <- MessageGroupStatsRebuildJob
  10. ReviewPerLanguageStats
  11. StatsTable
  12. SupportedLanguageSpecialPage <- SpecialSupportedLanguages
  13. TranslatePerLanguageStats
  14. TranslateRegistrationStats
  15. TranslateStatsOutput
  16. TranslationStats
  17. TranslationStatsSpecialPage <- SpecialTranslationStats
  18. interface TranslationStatsInterface


SynchronizationEdit

  1. ChangeSyncer
  2. ExpandGroupSpecificationMaintenanceScript <- TranslateExpandGroupSpec
  3. ExportTranslationsMaintenanceScript <- CommandlineExport
  4. ExportTranslationsSpecialPage <- SpecialExportTranslations
  5. ExternalMessageSourceStateComparator
  6. ExternalMessageSourceStateImporter
  7. ImportExternalTranslationsMaintenanceScript <- ProcessMessageChanges
  8. ImportOfflineTranslationsMaintenanceScript <- Poimport
  9. ImportTranslationsSpecialPage <- SpecialImportTranslations
  10. ManageGroupsSpecialPage <- SpecialManageGroups
  11. MessageChangeStorage
  12. MessageSourceChange <- MessageSync\MessageSourceChange
  13. MessageWebImporter
  14. OfflineTranslationsImporter <- WikiWriter
  15. OfflineTranslationsParser <- PoImporter
  16. RenameExternalLanguageMaintenanceScript <- ExportRenameLanguage
  17. UpdateMessageJob <- MessageUpdateJob

TranslatorInterfaceEdit

  1. MessageTable <- TuxMessageTable
  2. ReviewTranslationActiveApi <- ApiTranslationReview
  3. StatsBar
  4. TranslateEditAddons
  5. TranslateSpecialPage <- SpecialTranslate
  6. TranslationHelperException
  7. TranslationHelpers
  8. TranslationsSpecialPage <- SpecialTranslations

AidEdit

  1. CurrentTranslationAid
  2. DocumentationAid
  3. GettextDocumentationAid
  4. InOtherLanguagesAid
  5. InsertablesAid
  6. MachineTranslationAid
  7. MessageDefinitionAid
  8. SupportAid
  9. TTMServerAid
  10. TranslationAidDataProvider
  11. TranslationAidsActionApi <- ApiTranslationAids
  12. UnsupportedTranslationAid
  13. UpdatedDefinitionAid

InsertableEdit

  1. CombinedInsertablesSuggester
  2. HtmlTagInsertablesSuggester
  3. Insertable
  4. MediaWikiInsertablesSuggester
  5. NumericalParameterInsertablesSuggester
  6. RegexInsertablesSuggester
  7. interface InsertablesSuggester


TranslatorSandboxEdit

User visible api and special page names would not change.

  1. ManageTranslatorSandboxSpecialPage <- SpecialManageTranslatorSandbox
  2. TranslationStashActionApi <- ApiTranslationStash
  3. TranslationStashSpecialPage <- SpecialTranslationStash
  4. StashedTranslation
  5. StatisticsCollectionMaintenanceScript <- TS
  6. StatisticsProcessingMaintenanceScript <- TSP
  7. TranslateSandbox
  8. TranslateSandboxEmailJob
  9. TranslationStashStorage
  10. TranslatorSandboxActionApi <- ApiTranslateSandbox


TtmServerEdit

  1. BootstrapTtmServerMaintenanceScript <- TTMServerBootstrap
  2. CrossLanguageTranslationSearchQuery
  3. DatabaseTtmServer <- DatabaseTTMServer
  4. ElasticSearchTtmServer <- ElasticSearchTTMServer
  5. FakeTtmServer <- FakeTTMServer
  6. FuzzyLikeThis
  7. RemoteTtmserver <- RemoteTTMServer
  8. SearchTranslationsActionApi <- ApiSearchTranslations
  9. SearchTranslationsSpecialPage <- SpecialSearchTranslations
  10. TtmServer <- TTMServer
  11. TtmServerActionApi <- ApiTTMServer
  12. TtmServerException <- TTMServerException
  13. TtmServerMessageUpdateJob <- TTMServerMessageUpdateJob
  14. interface ReadableTtmServer <- ReadableTTMServer
  15. interface SearchableTtmServer <- SearchableTTMServer
  16. interface WritableTtmServer <- WritableTTMServer


UtilitiesEdit

  1. CommandLineLogger <- TranslateCliLogger
  2. FCFontFinder
  3. FuzzyTranslationsMaintenanceScript <- Fuzzy
  4. JsSelectToInput
  5. PHPVariableLoader
  6. SystemUsers <- SystemUsers\TranslateUserManager
  7. TranslateReplaceTitle
  8. TranslationFuzzer <- FuzzyScript
  9. Utilities <- TranslateUtils (should be split)
  10. Yaml <- TranslateYaml


ValidationEdit

  1. CheckTranslationActionApi <- ApiTranslationCheck
  2. MessageValidator
  3. ValidationResult
  4. ValidatorFactory
  5. interface Validator

ValidatorEdit

  1. BraceBalanceValidator
  2. EscapeCharacterValidator
  3. GettextNewlineValidator
  4. GettextPluralValidator
  5. InsertableRegexValidator
  6. InsertableRubyVariableValidator
  7. IosVariableValidator
  8. MatchSetValidator
  9. MediaWikiMiscValidator
  10. MediaWikiPageNameValidator
  11. MediaWikiPluralValidator
  12. NewlineValidator
  13. NumericalParameterValidator
  14. PrintfValidator
  15. PythonInterpolationValidator
  16. SmartFormatPluralValidator
  17. UnicodePluralValidator
  18. WikiLinkValidator
  19. WikiParameterValidator


WebServiceEdit

  1. ApertiumWebService
  2. CaighdeanWebService
  3. CxserverWebService
  4. MicrosoftWebService
  5. QueryAggregator
  6. RESTBaseWebService
  7. RemoteTTMServerWebService
  8. TranslationQuery
  9. TranslationQueryResponse
  10. TranslationWebServiceConfigurationException
  11. TranslationWebServiceException
  12. TranslationWebServiceInvalidInputException
  13. YandexWebService
  14. interface QueryAggregatorAware