Template:Dir is one of the most used templates in Wikimedia Commons,
this tries to provide parts of its functionality in hope we can
perhaps simplify or get rid of the template eventually for clarity and
performance reasons.
As a convenience, `{{#dir}}` and `{{#dir:}}` are synonyms for
`{{#dir:{{PAGELANGUAGE}}}}`: they return the direction of the target
language. For articles, the target language is the content language;
for messages, the target language is the user language.
In addition, to avoid confusion between BCP-47 language codes and
MediaWiki-internal language codes, an optional second parameter can be
supplied. If the second parameter is the (localizable) string
'bcp47', the language code given in the first parameter will be
treated as a BCP-47 code. For example: `{{#dir:sr-Cyrl|bcp47}}`.
(See LanguageCode::bcp47ToInternal() for a description of the
differences and overlaps between MediaWiki internal and BCP-47
codes. These overlaps *so far* don't result in any case where
encouraging editors to be precise about which set of enumerated
string values they are using for consistency with other
language-related functions, and because MediaWiki internally
differentiates between BCP-47 codes and internal codes.)
Bug: T359761
Change-Id: I19c3e91a924e080f37dc95a0d4e61493583b533e
|
||
|---|---|---|
| .. | ||
| AnsiTermColorer.php | ||
| badCharacters.txt | ||
| comments.txt | ||
| DbTestPreviewer.php | ||
| DbTestRecorder.php | ||
| definitionLists.txt | ||
| DjVuSupport.php | ||
| DummyTermColorer.php | ||
| editTests.php | ||
| extLinks.txt | ||
| fuzzTest.php | ||
| headings.txt | ||
| indentPre.txt | ||
| indicators.txt | ||
| interlanguageLinks.txt | ||
| interwikiLinks.txt | ||
| langParserTests.txt | ||
| legacyHeadings.txt | ||
| legacyMedia.txt | ||
| magicLinks.txt | ||
| magicWords.txt | ||
| media.txt | ||
| MultiTestRecorder.php | ||
| ParserTestMockParser.php | ||
| ParserTestParserHook.php | ||
| ParserTestPrinter.php | ||
| ParserTestResult.php | ||
| ParserTestResultNormalizer.php | ||
| ParserTestRunner.php | ||
| parserTests.php | ||
| parserTests.txt | ||
| pfeqParserTests.txt | ||
| PhpunitTestRecorder.php | ||
| preprocessor.txt | ||
| preTags.txt | ||
| pst.txt | ||
| pWrapping.txt | ||
| quotes.txt | ||
| README | ||
| redirects.txt | ||
| tables.txt | ||
| TestFileEditor.php | ||
| TestRecorder.php | ||
| wtEscaping.txt | ||
Parser tests can be run either via PHPUnit or by using the standalone parserTests.php in this directory. The standalone version provides more options. To run parser tests via PHPUnit: $ composer phpunit -- --testsuite parsertests You can optionally filter by title using --filter, e.g. composer phpunit -- --testsuite parsertests --filter="T6400"