1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Xomw: Implement Interwiki part of GetTitleCodec

This commit is contained in:
gnosygnu
2017-03-25 08:54:59 -04:00
parent 0b762933b2
commit dcdc69e374
12 changed files with 278 additions and 253 deletions

View File

@@ -546,21 +546,21 @@ public class XomwTitle {
// return null;
// }
// }
//
// /**
// * Create a new Title for the Main Page
// *
// * @return Title The new Object
// */
// public static function newMainPage() {
// $title = Title::newFromText(wfMessage('mainpage').inContentLanguage().text());
// // Don't give fatal errors if the message is broken
// if (!$title) {
// $title = Title::newFromText('Main Page');
// }
// return $title;
// }
//
/**
* Create a new Title for the Main Page
*
* @return Title The new Object
*/
public static XomwTitle newMainPage(XomwEnv env) {
XomwTitle title = XomwTitle.newFromText(env, XomwGlobalFunctions.wfMessage(env, "mainpage").inContentLanguage().text());
// Don't give fatal errors if the message is broken
if (title == null) {
title = XomwTitle.newFromText(env, Bry_.new_a7("Main Page"));
}
return title;
}
// /**
// * Get the prefixed DB key associated with an ID
// *
@@ -898,19 +898,19 @@ public class XomwTitle {
return this.mDbkeyform;
}
// /**
// * Get the DB key with the initial letter case as specified by the user
// *
// * @return String DB key
// */
// function getUserCaseDBKey() {
// if (!is_null(this.mUserCaseDBKey)) {
// return this.mUserCaseDBKey;
// } else {
// // If created via makeTitle(), this.mUserCaseDBKey is not set.
// return this.mDbkeyform;
// }
// }
/**
* Get the DB key with the initial letter case as specified by the user
*
* @return String DB key
*/
public byte[] getUserCaseDBKey() {
if (this.mUserCaseDBKey != null) {
return this.mUserCaseDBKey;
} else {
// If created via makeTitle(), this.mUserCaseDBKey is not set.
return this.mDbkeyform;
}
}
/**
* Get the namespace index, i.e. one of the NS_xxxx constants.