diff options
Diffstat (limited to 'includes/language')
30 files changed, 94 insertions, 112 deletions
diff --git a/includes/language/LCStore.php b/includes/language/LCStore.php index dbd996e537c7..9f1216e38833 100644 --- a/includes/language/LCStore.php +++ b/includes/language/LCStore.php @@ -34,6 +34,8 @@ * * The values stored are PHP variables suitable for serialize(). Implementations * of LCStore are responsible for serializing and unserializing. + * + * @ingroup Language */ interface LCStore { diff --git a/includes/language/LCStoreCDB.php b/includes/language/LCStoreCDB.php index e9cac7c08ba9..c6554ffa19a0 100644 --- a/includes/language/LCStoreCDB.php +++ b/includes/language/LCStoreCDB.php @@ -30,6 +30,8 @@ use Cdb\Writer; * available than it is with the PHP port. * * See Cdb.php and https://cr.yp.to/cdb.html + * + * @ingroup Language */ class LCStoreCDB implements LCStore { diff --git a/includes/language/LCStoreDB.php b/includes/language/LCStoreDB.php index d6a9866bb711..8ca5cf96d2df 100644 --- a/includes/language/LCStoreDB.php +++ b/includes/language/LCStoreDB.php @@ -25,7 +25,8 @@ use Wikimedia\ScopedCallback; /** * LCStore implementation which uses the standard DB functions to store data. - * This will work on any MediaWiki installation. + * + * @ingroup Language */ class LCStoreDB implements LCStore { /** @var string|null Language code */ diff --git a/includes/language/LCStoreNull.php b/includes/language/LCStoreNull.php index 62f88ebf2d73..2587cfb0eaf8 100644 --- a/includes/language/LCStoreNull.php +++ b/includes/language/LCStoreNull.php @@ -19,7 +19,9 @@ */ /** - * Null store backend, used to avoid DB errors during install + * Null store backend, used to avoid DB errors during install. + * + * @ingroup Language */ class LCStoreNull implements LCStore { diff --git a/includes/language/LCStoreStaticArray.php b/includes/language/LCStoreStaticArray.php index ca7c997d1bcd..a91bf4aa3f1f 100644 --- a/includes/language/LCStoreStaticArray.php +++ b/includes/language/LCStoreStaticArray.php @@ -1,7 +1,5 @@ <?php /** - * Localisation cache storage based on PHP files and static arrays. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -23,7 +21,10 @@ use Wikimedia\StaticArrayWriter; /** + * Localisation cache storage based on PHP files and static arrays. + * * @since 1.26 + * @ingroup Language */ class LCStoreStaticArray implements LCStore { /** @var string|null Current language code. */ diff --git a/includes/language/Language.php b/includes/language/Language.php index 16f07fd07270..2a31467cad89 100644 --- a/includes/language/Language.php +++ b/includes/language/Language.php @@ -19,7 +19,14 @@ */ /** - * @defgroup Language Language + * @defgroup Language Internationalisation + * + * See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information. + */ + +/** + * @defgroup Languages Languages + * @ingroup Language */ use CLDRPluralRuleParser\Evaluator; @@ -37,7 +44,8 @@ use Wikimedia\AtEase\AtEase; use Wikimedia\RequestTimeout\TimeoutException; /** - * Internationalisation code + * Base class for language-specific code. + * * See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information. * * @ingroup Language diff --git a/includes/language/LanguageFactory.php b/includes/language/LanguageFactory.php index 3fe52af6c106..7661642033df 100644 --- a/includes/language/LanguageFactory.php +++ b/includes/language/LanguageFactory.php @@ -18,10 +18,6 @@ * @file */ -/** - * @defgroup Language Language - */ - namespace MediaWiki\Languages; use Config; diff --git a/includes/language/LanguageNameUtils.php b/includes/language/LanguageNameUtils.php index d02b9c9ac1a9..879130a6e2a6 100644 --- a/includes/language/LanguageNameUtils.php +++ b/includes/language/LanguageNameUtils.php @@ -18,10 +18,6 @@ * @file */ -/** - * @defgroup Language Language - */ - namespace MediaWiki\Languages; use BagOStuff; diff --git a/includes/language/LocalisationCache.php b/includes/language/LocalisationCache.php index 92615d9867d9..e03929690a23 100644 --- a/includes/language/LocalisationCache.php +++ b/includes/language/LocalisationCache.php @@ -1,7 +1,5 @@ <?php /** - * Cache of the contents of localisation files. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -30,8 +28,10 @@ use MediaWiki\MainConfigNames; use Psr\Log\LoggerInterface; /** - * Class for caching the contents of localisation files, Messages*.php - * and *.i18n.php. + * Caching for the contents of localisation files. + * + * Including for i18n JSON files under `/languages/messages`, `Messages*.php`, + * and `*.i18n.php`. * * An instance of this class is available using MediaWikiServices. * @@ -40,6 +40,8 @@ use Psr\Log\LoggerInterface; * zh-hans -> en ). Some common errors are corrected, for example namespace * names with spaces instead of underscores, but heavyweight processing, such * as grammatical transformation, is done by the caller. + * + * @ingroup Language */ class LocalisationCache { public const VERSION = 4; diff --git a/includes/language/LocalisationCacheBulkLoad.php b/includes/language/LocalisationCacheBulkLoad.php index 5c962d3a040e..8f685b264ddf 100644 --- a/includes/language/LocalisationCacheBulkLoad.php +++ b/includes/language/LocalisationCacheBulkLoad.php @@ -19,8 +19,11 @@ */ /** - * A localisation cache optimised for loading large amounts of data for many - * languages. Used by rebuildLocalisationCache.php. + * LocalisationCache optimised for loading many languages at once. + * + * Used by maintenance/rebuildLocalisationCache.php. + * + * @ingroup Language */ class LocalisationCacheBulkLoad extends LocalisationCache { diff --git a/includes/language/MessageCache.php b/includes/language/MessageCache.php index ced9810caa76..1b0efe2dd0c2 100644 --- a/includes/language/MessageCache.php +++ b/includes/language/MessageCache.php @@ -1,7 +1,5 @@ <?php /** - * Localisation messages cache. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,7 +16,6 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Cache */ use MediaWiki\HookContainer\HookContainer; @@ -47,10 +44,9 @@ use Wikimedia\ScopedCallback; define( 'MSG_CACHE_VERSION', 2 ); /** - * Cache of messages that are defined by MediaWiki namespace pages or by hooks + * Cache messages that are defined by MediaWiki-namespace pages or by hooks. * - * Performs various MediaWiki namespace-related functions - * @ingroup Cache + * @ingroup Language */ class MessageCache implements LoggerAwareInterface { /** diff --git a/includes/language/converters/BanConverter.php b/includes/language/converters/BanConverter.php index 80d06bd10517..359376d90996 100644 --- a/includes/language/converters/BanConverter.php +++ b/includes/language/converters/BanConverter.php @@ -1,7 +1,5 @@ <?php /** - * Balinese specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,19 +16,19 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** + * Balinese specific code. * - * @ingroup Language + * @ingroup Languages */ class BanConverter extends LanguageConverterIcu { /** * Get Main language code. - * @since 1.36 * + * @since 1.36 * @return string */ public function getMainCode(): string { @@ -39,8 +37,8 @@ class BanConverter extends LanguageConverterIcu { /** * Get supported variants of the language. - * @since 1.36 * + * @since 1.36 * @return array */ public function getLanguageVariants(): array { @@ -49,8 +47,8 @@ class BanConverter extends LanguageConverterIcu { /** * Get language variants fallbacks. - * @since 1.36 * + * @since 1.36 * @return array */ public function getVariantsFallbacks(): array { diff --git a/includes/language/converters/CrhConverter.php b/includes/language/converters/CrhConverter.php index 56f788ad0a87..3e80b336316a 100644 --- a/includes/language/converters/CrhConverter.php +++ b/includes/language/converters/CrhConverter.php @@ -1,9 +1,5 @@ <?php /** - * Crimean Tatar (Qırımtatarca) specific code. - * - * Adapted from https://crh.wikipedia.org/wiki/Qullan%C4%B1c%C4%B1:Don_Alessandro/Translit - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -20,13 +16,14 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** - * Crimean Tatar (Qırımtatarca) converter routines + * Crimean Tatar (Qırımtatarca) converter routines. + * + * Adapted from https://crh.wikipedia.org/wiki/Qullan%C4%B1c%C4%B1:Don_Alessandro/Translit * - * @ingroup Language + * @ingroup Languages */ class CrhConverter extends LanguageConverterSpecific { // Defines working character ranges diff --git a/includes/language/converters/EnConverter.php b/includes/language/converters/EnConverter.php index ed8d5ae1faf0..a1acf5aedc0b 100644 --- a/includes/language/converters/EnConverter.php +++ b/includes/language/converters/EnConverter.php @@ -1,7 +1,5 @@ <?php /** - * English specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -21,7 +19,9 @@ */ /** - * @ingroup Language + * English specific converter routines. + * + * @ingroup Languages */ class EnConverter extends LanguageConverter { diff --git a/includes/language/converters/GanConverter.php b/includes/language/converters/GanConverter.php index e195710ddeee..837e23b80a2c 100644 --- a/includes/language/converters/GanConverter.php +++ b/includes/language/converters/GanConverter.php @@ -1,7 +1,5 @@ <?php /** - * Gan Chinese specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -21,7 +19,9 @@ */ /** - * @ingroup Language + * Gan Chinese specific code. + * + * @ingroup Languages */ class GanConverter extends LanguageConverter { diff --git a/includes/language/converters/IuConverter.php b/includes/language/converters/IuConverter.php index f3cb6d38f549..98cbe925840c 100644 --- a/includes/language/converters/IuConverter.php +++ b/includes/language/converters/IuConverter.php @@ -1,7 +1,5 @@ <?php /** - * Inuktitut specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,10 +16,11 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** + * Inuktitut specific code. + * * Conversion script between Latin and Syllabics for Inuktitut. * - Syllabics -> lowercase Latin * - lowercase/uppercase Latin -> Syllabics @@ -31,7 +30,7 @@ * - https://commons.wikimedia.org/wiki/Image:Inuktitut.png * - LanguageSr.php * - * @ingroup Language + * @ingroup Languages */ class IuConverter extends LanguageConverterSpecific { public $mToLatin = [ diff --git a/includes/language/converters/KkConverter.php b/includes/language/converters/KkConverter.php index 7b0625c0f3d4..3573ce01b2eb 100644 --- a/includes/language/converters/KkConverter.php +++ b/includes/language/converters/KkConverter.php @@ -1,7 +1,5 @@ <?php /** - * Kazakh (Қазақша) specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,7 +16,6 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase @@ -32,7 +29,7 @@ define( 'H_HAMZA', 'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA /** * Kazakh (Қазақша) converter routines * - * @ingroup Language + * @ingroup Languages */ class KkConverter extends LanguageConverterSpecific { diff --git a/includes/language/converters/KuConverter.php b/includes/language/converters/KuConverter.php index f793e39d9cb8..f8d555f6d16c 100644 --- a/includes/language/converters/KuConverter.php +++ b/includes/language/converters/KuConverter.php @@ -1,7 +1,5 @@ <?php /** - * Kurdish specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,13 +16,12 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** - * Kurdish converter routines + * Kurdish converter routines. * - * @ingroup Language + * @ingroup Languages */ class KuConverter extends LanguageConverterSpecific { diff --git a/includes/language/converters/ShiConverter.php b/includes/language/converters/ShiConverter.php index b5a50d4cb35a..b5527d9a63cf 100644 --- a/includes/language/converters/ShiConverter.php +++ b/includes/language/converters/ShiConverter.php @@ -1,7 +1,5 @@ <?php /** - * Shilha specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,10 +16,11 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** + * Shilha specific code. + * * Conversion script between Latin and Tifinagh for Tachelhit. * - Tifinagh -> lowercase Latin * - lowercase/uppercase Latin -> Tifinagh @@ -31,7 +30,7 @@ * - https://en.wikipedia.org/wiki/Shilha_language * - LanguageSr.php * - * @ingroup Language + * @ingroup Languages */ class ShiConverter extends LanguageConverterSpecific { // The Tifinagh alphabet sequence is based on diff --git a/includes/language/converters/SrConverter.php b/includes/language/converters/SrConverter.php index 6470ef8da8ed..7d7c1ae261ef 100644 --- a/includes/language/converters/SrConverter.php +++ b/includes/language/converters/SrConverter.php @@ -1,7 +1,5 @@ <?php /** - * Serbian (Српски / Srpski) specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,17 +16,18 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** + * Serbian (Српски / Srpski) specific code. + * * There are two levels of conversion for Serbian: the script level * (Cyrillics <-> Latin), and the variant level (ekavian * <->iyekavian). The two are orthogonal. So we really only need two * dictionaries: one for Cyrillics and Latin, and one for ekavian and * iyekavian. * - * @ingroup Language + * @ingroup Languages */ class SrConverter extends LanguageConverterSpecific { diff --git a/includes/language/converters/TgConverter.php b/includes/language/converters/TgConverter.php index a16c90650a48..bac76cfd08c5 100644 --- a/includes/language/converters/TgConverter.php +++ b/includes/language/converters/TgConverter.php @@ -1,7 +1,5 @@ <?php /** - * Tajik (Тоҷикӣ) specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,13 +16,12 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** - * Converts Tajiki to Latin orthography + * Tajik (Тоҷикӣ) specific code, converting Tajiki to Latin orthography. * - * @ingroup Language + * @ingroup Languages */ class TgConverter extends LanguageConverter { diff --git a/includes/language/converters/TlyConverter.php b/includes/language/converters/TlyConverter.php index 9fd522f6b70b..53f507dbe352 100644 --- a/includes/language/converters/TlyConverter.php +++ b/includes/language/converters/TlyConverter.php @@ -1,7 +1,5 @@ <?php /** - * Talysh specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -17,14 +15,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * - * @author Amir E. Aharoni - * * @file - * @ingroup Language + * @author Amir E. Aharoni */ /** - * @ingroup Language + * Talysh specific code. + * + * @ingroup Languages */ class TlyConverter extends LanguageConverter { /** diff --git a/includes/language/converters/UzConverter.php b/includes/language/converters/UzConverter.php index 32bb77c22ba6..c30c13b03f83 100644 --- a/includes/language/converters/UzConverter.php +++ b/includes/language/converters/UzConverter.php @@ -1,7 +1,5 @@ <?php /** - * Uzbek specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,11 +16,12 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** - * @ingroup Language + * Uzbek specific code. + * + * @ingroup Languages */ class UzConverter extends LanguageConverter { public $toLatin = [ diff --git a/includes/language/converters/ZhConverter.php b/includes/language/converters/ZhConverter.php index d8ed096a16d5..bafe6fab4b03 100644 --- a/includes/language/converters/ZhConverter.php +++ b/includes/language/converters/ZhConverter.php @@ -1,7 +1,5 @@ <?php /** - * Chinese specific code. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,11 +16,12 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Language */ /** - * @ingroup Language + * Chinese converter routine. + * + * @ingroup Languages */ class ZhConverter extends LanguageConverter { diff --git a/includes/language/dependency/CacheDependency.php b/includes/language/dependency/CacheDependency.php index 9bc71ea845be..bd376faac301 100644 --- a/includes/language/dependency/CacheDependency.php +++ b/includes/language/dependency/CacheDependency.php @@ -1,7 +1,5 @@ <?php /** - * Data caching with dependencies. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,12 +16,13 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Cache */ /** + * Base class to represent dependencies for LocalisationCache entries. + * * @stable to extend - * @ingroup Cache + * @ingroup Language */ abstract class CacheDependency { /** diff --git a/includes/language/dependency/ConstantDependency.php b/includes/language/dependency/ConstantDependency.php index 1f62093640f4..1087777a11d6 100644 --- a/includes/language/dependency/ConstantDependency.php +++ b/includes/language/dependency/ConstantDependency.php @@ -1,7 +1,5 @@ <?php /** - * Data caching with dependencies. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,11 +16,12 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Cache */ /** - * @ingroup Cache + * Depend on a PHP constant. + * + * @ingroup Language */ class ConstantDependency extends CacheDependency { private $name; diff --git a/includes/language/dependency/DependencyWrapper.php b/includes/language/dependency/DependencyWrapper.php index 789a24a0b095..a7220dbd0b25 100644 --- a/includes/language/dependency/DependencyWrapper.php +++ b/includes/language/dependency/DependencyWrapper.php @@ -1,7 +1,5 @@ <?php /** - * Data caching with dependencies. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,14 +16,15 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Cache */ /** - * This class stores an arbitrary value along with its dependencies. - * Users should typically only use DependencyWrapper::getValueFromCache(), + * Store an arbitrary value whilst representing several CacheDependency objects as one. + * + * You should typically only use DependencyWrapper::getValueFromCache(), * rather than instantiating one of these objects directly. - * @ingroup Cache + * + * @ingroup Language */ class DependencyWrapper { private $value; diff --git a/includes/language/dependency/FileDependency.php b/includes/language/dependency/FileDependency.php index 1cc2379ff668..997ab58dd4e8 100644 --- a/includes/language/dependency/FileDependency.php +++ b/includes/language/dependency/FileDependency.php @@ -1,7 +1,5 @@ <?php /** - * Data caching with dependencies. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,14 +16,15 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Cache */ use Wikimedia\AtEase\AtEase; /** + * Depend on a file. + * * @newable - * @ingroup Cache + * @ingroup Language */ class FileDependency extends CacheDependency { private $filename; diff --git a/includes/language/dependency/GlobalDependency.php b/includes/language/dependency/GlobalDependency.php index 15a3e90b113d..03eccc2b0c39 100644 --- a/includes/language/dependency/GlobalDependency.php +++ b/includes/language/dependency/GlobalDependency.php @@ -1,7 +1,5 @@ <?php /** - * Data caching with dependencies. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,11 +16,12 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Cache */ /** - * @ingroup Cache + * Depend on a PHP global variable. + * + * @ingroup Language */ class GlobalDependency extends CacheDependency { private $name; diff --git a/includes/language/dependency/MainConfigDependency.php b/includes/language/dependency/MainConfigDependency.php index 4eab7268eee6..00332a058976 100644 --- a/includes/language/dependency/MainConfigDependency.php +++ b/includes/language/dependency/MainConfigDependency.php @@ -1,7 +1,5 @@ <?php /** - * Data caching with dependencies. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,12 +16,13 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup Cache */ use MediaWiki\MediaWikiServices; /** - * @ingroup Cache + * Depend on a MW configuration variable. + * + * @ingroup Language */ class MainConfigDependency extends CacheDependency { private $name; |