Last modified: 2009-08-03 07:10:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19882, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17882 - Dutch month names empty on SMW displays
Dutch month names empty on SMW displays
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
PC Windows XP
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
login available on request
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-09 10:22 UTC by Lloyd.Rutledge@ou.nl
Modified: 2009-08-03 07:10 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Lloyd.Rutledge@ou.nl 2009-03-09 10:22:29 UTC
On displays of month names generated by SMW on my Dutch language wiki nothing appears.  For example "31 2009 11:00:00" instead of "januari 31 2009 11:00:00".  Dutch month names do show up on all non-semantic aspects of the wiki displays, such as history pages.  Dutch month names also show up on Semantic Form input interfaces.  Furthermore, in Semantic Forms, the correct (or last entered) month names shows, which means the data is stored, but SMW generates no month name for it.  Semantic Forms has its own translation, for which Dutch month names work.

The error message I get is

Notice: Undefined offset: 0 in D:\Inetpub\wwwroot\WikiSemanticweb\extensions\SemanticMediaWiki\languages\SMW_Language.php on line 113

Where 0 is the monthnumber minus 1.

SMW_Language.php line 113 is the return in:

	/**
	 * Return the name of the month with the given number.
	 */
	function getMonthLabel($number) {
	  return (($number>=1)&&($number<=12))?$this->m_months[(int)($number-1)]:'';
	}

Is there something I should change on my system?  Or can this be fixed on an upcoming release?  Or both?

Thanks!
Lloyd Rutledge
Comment 1 Lloyd.Rutledge@ou.nl 2009-03-09 12:50:49 UTC
I fixed this on my installation by adding the following month name table to the end of SMW_LanguageNl.php:

protected $m_months = array(
0 => 'januari',
1 => 'februari',
2 => 'maart',
3 => 'april',
4 => 'mei',
5 => 'juni',
6 => 'juli',
7 => 'augustus',
8 => 'september',
9 => 'oktober',
10 => 'november',
11 => 'december'
);

Is this the right place for this table?

-Lloyd
Comment 2 Markus Krötzsch 2009-03-09 14:19:42 UTC
Yes, this is fine. However, I am surprised that you need to add the numeric keys explicitly. The definition 

array('januari', 'februari', ..., 'december')

does the same thing on my machine. This seems to be the reason for the original problem, too. Even without specific Dutch translations, you should be able to access the English month names. I guess that this is some PHP characteristic that we are not aware of yet, and that might cause problems in many other cases if we do not find a more generic solution.
Comment 3 Markus Krötzsch 2009-03-09 14:20:58 UTC
P.S. Could you provide some details about your PHP distribution, version, and configuration?
Comment 4 Lloyd.Rutledge@ou.nl 2009-03-09 15:04:57 UTC
According to the version special page, the PHP version is 5.2.6 (isapi) 
Comment 5 Rowan Rodrik van der Molen 2009-06-12 08:32:07 UTC
Same problem, on PHP version 5.2.9 (Apache).
Comment 6 Markus Krötzsch 2009-08-01 17:09:07 UTC
The problem was actually not in PHP: the general language file actually had no default month names at all, so no months appeared since the Dutch language file had none.

I have now set the defaults properly and I have also included your above month name translations into the Dutch file. Is it true that the month names should be lowercase in Dutch? (Maybe I should actually make the whole check for month names case insensitive anyway)
Comment 7 Rowan Rodrik van der Molen 2009-08-03 07:10:28 UTC
Thanks for you effort, Markus. :-)

It is true that month names are lowercase in Dutch. We're weird like that. ;-)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links