i know it's depend the mediawiki language,but can i change it by my own?i use chinese mediawiki,but i wana the mediawiki signature time format use english.
sorry again,if this question should not ask in this maillist,plz let me know i should send which maillist...i very know to the maillist,and my english is pretty bad too.
On 11/29/13, Sen kik888@gmail.com wrote:
i know it's depend the mediawiki language,but can i change it by my own?i use chinese mediawiki,but i wana the mediawiki signature time format use english.
sorry again,if this question should not ask in this maillist,plz let me know i should send which maillist...i very know to the maillist,and my english is pretty bad too. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Hi.
This question is probably better suited to the mediawiki-l mailing list then this one, but in any case here is the answer:
There's two internationalization changes in play here. First of all, month names get translated. This is something that you cannot change without modifying core (as far as I know).
Second the date format changes (for example, where in the date the year is put). This one you can control. Just add to the bottom of LocalSettings.php:
$wgDefaultUserOptions['date'] = 'mdy';
and you will get something like "01:22, 11月 30, 2013 (UTC)" instead of "2013年11月30日 (六) 01:26 (UTC) ". As noted the month names are still shown in Chinese.
If you do something like:
$wgDefaultUserOptions['date'] = 'ISO 8601';
You will get dates that are all numeric like 2013-11-30T01:28:42 (UTC). Other options for the date format preference include dmy, ymd. By default it has the value "default" which is equivalent to the value "zh" in the chinese internationalization.
--Bawolff
On Fri, Nov 29, 2013 at 11:30 PM, Brian Wolff bawolff@gmail.com wrote:
On 11/29/13, Sen kik888@gmail.com wrote:
i know it's depend the mediawiki language,but can i change it by my own?i use chinese mediawiki,but i wana the mediawiki signature time format use english.
sorry again,if this question should not ask in this maillist,plz let me know i should send which maillist...i very know to the maillist,and my english is pretty bad too. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Hi.
This question is probably better suited to the mediawiki-l mailing list then this one, but in any case here is the answer:
There's two internationalization changes in play here. First of all, month names get translated. This is something that you cannot change without modifying core (as far as I know).
Second the date format changes (for example, where in the date the year is put). This one you can control. Just add to the bottom of LocalSettings.php:
$wgDefaultUserOptions['date'] = 'mdy';
and you will get something like "01:22, 11月 30, 2013 (UTC)" instead of "2013年11月30日 (六) 01:26 (UTC) ". As noted the month names are still shown in Chinese.
If you do something like:
$wgDefaultUserOptions['date'] = 'ISO 8601';
You will get dates that are all numeric like 2013-11-30T01:28:42 (UTC). Other options for the date format preference include dmy, ymd. By default it has the value "default" which is equivalent to the value "zh" in the chinese internationalization.
--Bawolff
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
To implement what he is asking for, I hacked Parser::pstPass2() in includes/parser/Parser.php as follows:
Change: $key = 'timezone-' . strtolower( trim( $tzMsg ) ); to: $key = 'signature-timezone-' . strtolower( trim( $tzMsg ) );
Change: $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tzMsg)"; to: $en = Language::factory ( 'en' ); $d = $en->timeanddate( $ts, false, false ) . " ($tzMsg)";
Next, write the following PHP script and run it:
<?php $abbreviations = array_keys ( DateTimeZone::listAbbreviations() ); foreach ( $abbreviations as $abbreviation ) { echo "MediaWiki:Signature-timezone-$abbreviation\n"; }
This will give you the list of MediaWiki: namespace pages you need to create, e.g. MediaWiki:Signature-timezone-utc, MediaWiki:Signature-timezone-est, etc. There's probably an easier way, though.
That's going to a crazy place:)I think I just use the lazy one by now.thx your hack,that's really cool to inside the core and with some mod for it.
Regrades Sen
From SLboat(http://see.sl088.com)
在 2013年11月30日,下午1:28,Nathan Larson nathanlarson3141@gmail.com 写道:
On Fri, Nov 29, 2013 at 11:30 PM, Brian Wolff bawolff@gmail.com wrote:
On 11/29/13, Sen kik888@gmail.com wrote: i know it's depend the mediawiki language,but can i change it by my own?i use chinese mediawiki,but i wana the mediawiki signature time format use english.
sorry again,if this question should not ask in this maillist,plz let me know i should send which maillist...i very know to the maillist,and my english is pretty bad too. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Hi.
This question is probably better suited to the mediawiki-l mailing list then this one, but in any case here is the answer:
There's two internationalization changes in play here. First of all, month names get translated. This is something that you cannot change without modifying core (as far as I know).
Second the date format changes (for example, where in the date the year is put). This one you can control. Just add to the bottom of LocalSettings.php:
$wgDefaultUserOptions['date'] = 'mdy';
and you will get something like "01:22, 11月 30, 2013 (UTC)" instead of "2013年11月30日 (六) 01:26 (UTC) ". As noted the month names are still shown in Chinese.
If you do something like:
$wgDefaultUserOptions['date'] = 'ISO 8601';
You will get dates that are all numeric like 2013-11-30T01:28:42 (UTC). Other options for the date format preference include dmy, ymd. By default it has the value "default" which is equivalent to the value "zh" in the chinese internationalization.
--Bawolff
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
To implement what he is asking for, I hacked Parser::pstPass2() in includes/parser/Parser.php as follows:
Change: $key = 'timezone-' . strtolower( trim( $tzMsg ) ); to: $key = 'signature-timezone-' . strtolower( trim( $tzMsg ) );
Change: $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tzMsg)"; to: $en = Language::factory ( 'en' ); $d = $en->timeanddate( $ts, false, false ) . " ($tzMsg)";
Next, write the following PHP script and run it:
<?php $abbreviations = array_keys ( DateTimeZone::listAbbreviations() ); foreach ( $abbreviations as $abbreviation ) { echo "MediaWiki:Signature-timezone-$abbreviation\n"; }
This will give you the list of MediaWiki: namespace pages you need to create, e.g. MediaWiki:Signature-timezone-utc, MediaWiki:Signature-timezone-est, etc. There's probably an easier way, though. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
To implement what he is asking for, I hacked Parser::pstPass2() in includes/parser/Parser.php as follows:
Change: $key = 'timezone-' . strtolower( trim( $tzMsg ) ); to: $key = 'signature-timezone-' . strtolower( trim( $tzMsg ) );
Change: $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tzMsg)"; to: $en = Language::factory ( 'en' ); $d = $en->timeanddate( $ts, false, false ) . " ($tzMsg)";
Next, write the following PHP script and run it:
<?php $abbreviations = array_keys ( DateTimeZone::listAbbreviations() ); foreach ( $abbreviations as $abbreviation ) { echo "MediaWiki:Signature-timezone-$abbreviation\n"; }
This will give you the list of MediaWiki: namespace pages you need to create, e.g. MediaWiki:Signature-timezone-utc, MediaWiki:Signature-timezone-est, etc. There's probably an easier way, though. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
[Standard disclaimer about we do not reccomend making hacks to core mediawiki, and such hacks are unsupported, yadda]
The timezone messages generally aren't translated (fun fact: the timezone UTC had its name chosen because it makes sense in no language, so no language was favoured), so he probably wouldn't need to touch that at all. But if that was a concern, the easier way would be to add ->inLanguage ( 'en' ) to the wfMessage function chain (replacing ->inContentLanguage () ).
-bawolff
This's my first time talk at a open source mail list,I got say this is very feel great,I personally use mediawiki to record what I seeing,what I think,I really like it,maybe first it's kind hard to learn like about the wired wiki text language,special the table syntax ,I still this it's suck,to many [|] in it,but after that,I just can't help myself to love it,it have a lot expend way to use,I can just add a js gadget (which I had add a lot),and if I WANA go far,I can make a PHP extension,it's very easy to expend,just never like other web program I have use. Sure,the mediawiki may look like past time(old ui like a text editor),not fashion,but for me,it's good enough to back the simple easy way. But the most magic I just have seen by now,the guy who make mw,are bunch stronger guy,but just make it work ,and just better and better:)
Regrades Sen
From SLboat(http://see.sl088.com)
在 2013年11月30日,下午1:54,Brian Wolff bawolff@gmail.com 写道:
To implement what he is asking for, I hacked Parser::pstPass2() in includes/parser/Parser.php as follows:
Change: $key = 'timezone-' . strtolower( trim( $tzMsg ) ); to: $key = 'signature-timezone-' . strtolower( trim( $tzMsg ) );
Change: $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tzMsg)"; to: $en = Language::factory ( 'en' ); $d = $en->timeanddate( $ts, false, false ) . " ($tzMsg)";
Next, write the following PHP script and run it:
<?php $abbreviations = array_keys ( DateTimeZone::listAbbreviations() ); foreach ( $abbreviations as $abbreviation ) { echo "MediaWiki:Signature-timezone-$abbreviation\n"; }
This will give you the list of MediaWiki: namespace pages you need to create, e.g. MediaWiki:Signature-timezone-utc, MediaWiki:Signature-timezone-est, etc. There's probably an easier way, though. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
[Standard disclaimer about we do not reccomend making hacks to core mediawiki, and such hacks are unsupported, yadda]
The timezone messages generally aren't translated (fun fact: the timezone UTC had its name chosen because it makes sense in no language, so no language was favoured), so he probably wouldn't need to touch that at all. But if that was a concern, the easier way would be to add ->inLanguage ( 'en' ) to the wfMessage function chain (replacing ->inContentLanguage () ).
-bawolff _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Sat, Nov 30, 2013 at 1:12 AM, Sen Slybe kik888@gmail.com wrote:
This's my first time talk at a open source mail list,I got say this is very feel great,I personally use mediawiki to record what I seeing,what I think,I really like it,maybe first it's kind hard to learn like about the wired wiki text language,special the table syntax ,I still this it's suck,to many [|] in it,but after that,I just can't help myself to love it,it have a lot expend way to use,I can just add a js gadget (which I had add a lot),and if I WANA go far,I can make a PHP extension,it's very easy to expend,just never like other web program I have use. Sure,the mediawiki may look like past time(old ui like a text editor),not fashion,but for me,it's good enough to back the simple easy way. But the most magic I just have seen by now,the guy who make mw,are bunch stronger guy,but just make it work ,and just better and better:)
Oh good, another testimonialhttps://www.mediawiki.org/wiki/MediaWiki_testimonials. Yes, MediaWiki is a beautiful and wonderful product; some people criticize the codebase (particularly the UI; I have to admit, it's not all that intuitive, but those who stick around typically learn to, or have learned to, love it) but I personally find it to be much better-documented (and more fun to work with and contribute to) than some of the software I had to help develop in the corporate world. Of course, any endeavor in which you can choose to pursue your interests rather than being tied down to what the employer demands tends to be more fun. Welcome to the 20%http://www.codinghorror.com/blog/2007/11/the-two-types-of-programmers.html, if that's the direction you choose to go in!
The only major downer is the code review backlog, but you can often get around that by writing as much of your code as possible as extensions and choosing the direct-push instead of code review option for the repository. I guess in a way, I'm probably contributing to the problem by not doing many code reviews, but I haven't contributed enough code to show up very often in git blame, so people don't add me as a reviewer very often. When they do add me (seemingly randomly), I often think "This is a complicated change, I know nothing about this part of the codebase, and it would take hours/days to ramp up my level of knowledge to the point where I'd be able to make an informed comment or decision" so I remove myself.
There's two internationalization changes in play here. First of all, month names get translated. This is something that you cannot change without modifying core (as far as I know).
Actually what am I talking about. The obvious solution to this is to just create the page MediaWiki:January on your wiki (and the other months), editing the month names to whatever you want.
MediaWiki will use whatever is on the page MediaWiki:January as the word for January, which allows you to modify the output without editing mediawiki source code.
-bawolff
On Sat, Nov 30, 2013 at 1:09 AM, Brian Wolff bawolff@gmail.com wrote:
There's two internationalization changes in play here. First of all, month names get translated. This is something that you cannot change without modifying core (as far as I know).
Actually what am I talking about. The obvious solution to this is to just create the page MediaWiki:January on your wiki (and the other months), editing the month names to whatever you want.
MediaWiki will use whatever is on the page MediaWiki:January as the word for January, which allows you to modify the output without editing mediawiki source code.
I was going to do it that way but he said that he only wanted the signature timestamps to be in English and the rest of the site in Chinese, and I was concerned that maybe MediaWiki:January might be used for other purposes as well.
Maybe I can hook the content before mediawiki take care the magi word ,and I replace it first by the time I want ,so I will never heart the core code,and just make my thought work,and can use what ever time format u like by change it in my own extension
Regrades Sen
From SLboat(http://see.sl088.com)
在 2013年11月30日,下午2:15,Nathan Larson nathanlarson3141@gmail.com 写道:
On Sat, Nov 30, 2013 at 1:09 AM, Brian Wolff bawolff@gmail.com wrote:
There's two internationalization changes in play here. First of all, month names get translated. This is something that you cannot change without modifying core (as far as I know).
Actually what am I talking about. The obvious solution to this is to just create the page MediaWiki:January on your wiki (and the other months), editing the month names to whatever you want.
MediaWiki will use whatever is on the page MediaWiki:January as the word for January, which allows you to modify the output without editing mediawiki source code.
I was going to do it that way but he said that he only wanted the signature timestamps to be in English and the rest of the site in Chinese, and I was concerned that maybe MediaWiki:January might be used for other purposes as well. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Is too crazy to make this can be config ,just for this magi world ? $Wgsigntimefomat="yyyy-dd-mm hh:ss"
Sure,maybe too less people to need it,but if I run a Chinese mediawiki,I WANA make a English wiki page,now the signature is become a problem,ain't i?
Regrades Sen
From SLboat(http://see.sl088.com)
在 2013年11月30日,下午2:09,Brian Wolff bawolff@gmail.com 写道:
There's two internationalization changes in play here. First of all, month names get translated. This is something that you cannot change without modifying core (as far as I know).
Actually what am I talking about. The obvious solution to this is to just create the page MediaWiki:January on your wiki (and the other months), editing the month names to whatever you want.
MediaWiki will use whatever is on the page MediaWiki:January as the word for January, which allows you to modify the output without editing mediawiki source code.
-bawolff _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
2013/11/30 Sen kik888@gmail.com
i know it's depend the mediawiki language,but can i change it by my own?i use chinese mediawiki,but i wana the mediawiki signature time format use english.
This is the best way to confuse bots and make their task impossible. I think time format in a given wiki is not some fancy motive but a basic kind of information to be standardized. Sorry to controverse you, but I think like a programmer and not like a designer. But if your wiki is some private one and not a WikiMedia wiki, this opinion makes no sens, of course.
wikitech-l@lists.wikimedia.org