Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/213538
Change subject: Add message checker for iNaturalist ...................................................................... Add message checker for iNaturalist Copy of checker for Encyclopedia of Life. Checks for %{...}. Change-Id: I4130bcaabdcb4e0852fab90bc6c67e39254ac56c --- A groups/iNaturalist/Checker.php M groups/iNaturalist/iNaturalist.yaml 2 files changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/38/213538/1 diff --git a/groups/iNaturalist/Checker.php b/groups/iNaturalist/Checker.php new file mode 100644 index 0000000..f7307d0 --- /dev/null +++ b/groups/iNaturalist/Checker.php @@ -0,0 +1,26 @@ +<?php +/** + * Implements MessageChecker for iNaturalist. + * + * @file + * @author Niklas Laxström, Siebrand Mazeland + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + */ + +/** + * Message checks for iNaturalist + * + * @ingroup MessageCheckers + */ +class INaturalistMessageChecker extends MessageChecker { + /** + * Checks for missing and unknown variables in translations. + * + * @param $messages \array Iterable list of TMessage objects. + * @param $code \string Language code of the translations. + * @param $warnings \array Array where warnings are appended to. + */ + protected function INaturalistVariablesCheck( $messages, $code, &$warnings ) { + return parent::parameterCheck( $messages, $code, $warnings, '/%{[a-zA-Z_]+}/' ); + } +} diff --git a/groups/iNaturalist/iNaturalist.yaml b/groups/iNaturalist/iNaturalist.yaml index c8cc206..3c8ce8d 100644 --- a/groups/iNaturalist/iNaturalist.yaml +++ b/groups/iNaturalist/iNaturalist.yaml @@ -22,3 +22,11 @@ zh-hans: zh-CN zh-hant: zh-TW codeAsRoot: true + +CHECKER: + class: INaturalistMessageChecker + checks: + - INaturalistVariablesCheck + +AUTOLOAD: + EOLMessageChecker: Checker.php -- To view, visit https://gerrit.wikimedia.org/r/213538 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4130bcaabdcb4e0852fab90bc6c67e39254ac56c Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@kitano.nl> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits