Odder has uploaded a new change for review.
https://gerrit.wikimedia.org/r/99641
Change subject: Add a LanguageAng.php file for Old English projects
......................................................................
Add a LanguageAng.php file for Old English projects
This commit adds a LanguageAng.php file so that the
{{GRAMMAR:}} parser function can be used on Old
English projects to produce correct forms of words;
in this case, to enable the usage of {{SITENAME}} in
various grammatical forms for Old English Wikipedia
and Wiktionary projects.
The file has been created by PiRSquared17, who has
kindly attached it as a patch to bug 56634; I'm only
submitting it to Gerrit.
Bug: 56634
Change-Id: If93797ff6832e4ba66a806f2479055a3fcec63ce
---
A languages/classes/LanguageAng.php
1 file changed, 27 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/41/99641/1
diff --git a/languages/classes/LanguageAng.php
b/languages/classes/LanguageAng.php
new file mode 100644
index 0000000..18dc6c8
--- /dev/null
+++ b/languages/classes/LanguageAng.php
@@ -0,0 +1,27 @@
+<?php
+
+/** Old English (Ænglisc)
+ *
+ * @ingroup Language
+ */
+class LanguageAng extends Language {
+ # Convert from the nominative form of a noun to some other case
+ # Invoked with {{GRAMMAR:case|word}}
+ /**
+ * Cases: nemniendlīc (nom), wrēgendlīc (acc), forgifendlīc (dat),
geāgniendlīc (gen), tōllīc (ins)
+ *
+ * @param $word string
+ * @param $case string
+ *
+ * @return string
+ */
+ function convertGrammar( $word, $case ) {
+ global $wgGrammarForms;
+ if ( isset( $wgGrammarForms['ang'][$case][$word] ) ) {
+ return $wgGrammarForms['ang'][$case][$word];
+ }
+
+ return $word; # this will return the original value for all
words without set grammar forms
+ }
+
+}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/99641
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If93797ff6832e4ba66a806f2479055a3fcec63ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Odder <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits