* @param string $key
* @return string
*/
- function getMonthAbbreviation( $key ) {
+ public function getMonthAbbreviation( $key ) {
return $this->getMessageFromDB( self::$mMonthAbbrevMsgs[$key - 1] );
}
/**
* @return array
*/
- function getMonthAbbreviationsArray() {
+ public function getMonthAbbreviationsArray() {
$monthNames = [ '' ];
for ( $i = 1; $i < 13; $i++ ) {
$monthNames[] = $this->getMonthAbbreviation( $i );
* @param string $key
* @return string
*/
- function getWeekdayName( $key ) {
+ public function getWeekdayName( $key ) {
return $this->getMessageFromDB( self::$mWeekdayMsgs[$key - 1] );
}
* @throws MWException
* @return string
*/
- function sprintfDate( $format, $ts, DateTimeZone $zone = null, &$ttl = null ) {
+ public function sprintfDate( $format, $ts, DateTimeZone $zone = null, &$ttl = null ) {
$s = '';
$raw = false;
$roman = false;
*
* @param string $ts
*
- * @return string
+ * @return int[]
*/
private static function tsToIranian( $ts ) {
$gy = substr( $ts, 0, 4 ) -1600;
*
* @param string $ts
*
- * @return string
+ * @return int[]
*/
private static function tsToHijri( $ts ) {
$year = substr( $ts, 0, 4 );
*
* @param string $ts
*
- * @return string
+ * @return int[]
*/
private static function tsToHebrew( $ts ) {
# Parse date
* get user timecorrection setting)
* @return int
*/
- function userAdjust( $ts, $tz = false ) {
+ public function userAdjust( $ts, $tz = false ) {
global $wgUser, $wgLocalTZoffset;
if ( $tz === false ) {
* validateTimeZone() in Special:Preferences
* @return string
*/
- function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
+ public function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
$ts = wfTimestamp( TS_MW, $ts );
if ( $adj ) {
$ts = $this->userAdjust( $ts, $timecorrection );
* validateTimeZone() in Special:Preferences
* @return string
*/
- function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
+ public function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
$ts = wfTimestamp( TS_MW, $ts );
if ( $adj ) {
$ts = $this->userAdjust( $ts, $timecorrection );
* validateTimeZone() in Special:Preferences
* @return string
*/
- function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
+ public function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
$ts = wfTimestamp( TS_MW, $ts );
if ( $adj ) {
$ts = $this->userAdjust( $ts, $timecorrection );
* @param string $key
* @return array|null
*/
- function getMessage( $key ) {
+ public function getMessage( $key ) {
return self::$dataCache->getSubitem( $this->mCode, 'messages', $key );
}
* @param string $string
* @return string
*/
- function iconv( $in, $out, $string ) {
+ public function iconv( $in, $out, $string ) {
# This is a wrapper for iconv in all languages except esperanto,
# which does some nasty x-conversions beforehand
*
* @return string
*/
- function ucfirst( $str ) {
+ public function ucfirst( $str ) {
$o = ord( $str );
if ( $o < 96 ) { // if already uppercase...
return $str;
*
* @return string
*/
- function uc( $str, $first = false ) {
+ public function uc( $str, $first = false ) {
if ( $first ) {
if ( $this->isMultibyte( $str ) ) {
return mb_strtoupper( mb_substr( $str, 0, 1 ) ) . mb_substr( $str, 1 );
return $lang;
}
+ /**
+ * Compare with an other language object
+ *
+ * @since 1.28
+ * @param Language $lang
+ * @return boolean
+ */
+ public function equals( Language $lang ) {
+ return $lang->getCode() === $this->mCode;
+ }
+
/**
* Get the internal language code for this language object
*