Commit graph

1114 commits

Author SHA1 Message Date
Sam Reed
b2bfcc788a Documentation addition/tweaks 2011-01-10 04:44:33 +00:00
Niklas Laxström
15faf878e1 New method for making it easier for developers to get localised language names.
For now the core itself doesn't provide those, but extension can use the hook
to provide them. Callers should not except full coverage in every language.
2010-12-31 18:18:57 +00:00
Sam Reed
8068fe8cf9 Remove another usage of extract() 2010-12-30 03:00:45 +00:00
Chad Horohoe
c491085fd8 Revert r78903, r78904, r78905, r78906 (changing opendir() to use sfFinder class) per CR and wikitech-l objections.
It's arguable whether the code is cleaner either way, and adding all this code for the (relatively few) places we do file listings just isn't worth it.
2010-12-23 21:49:01 +00:00
X!
c4bdc6f4a1 Per discussion on mailing list, modifying some uses of opendir()/readdir()/closedir() to use new sfFinder class. 2010-12-23 18:20:13 +00:00
Mark A. Hershberger
aa08646a71 Misc whitespace changes, mostly EOL w/s and indention fixes so TAB = 4 spaces 2010-12-19 04:31:15 +00:00
Niklas Laxström
39cfb5a1d6 Typo 2010-12-18 14:34:29 +00:00
Platonides
1920363bde Follow up r71459
Deprecate Language::convertLinkToAllVariants() now.
2010-12-01 00:30:35 +00:00
Sam Reed
5369be9e82 Qualify call to autoConvertToAllVariants from convertLinkToAllVariants in FakeConverter 2010-11-30 18:55:03 +00:00
Philip Tzou
881214d130 Select a friendly sub-language while acquiring system messages if the uselang has multiple variants available for use. 2010-11-30 03:04:47 +00:00
Alexandre Emsenhuber
7646fa870c Follow-up r65654:
* Per Hashar: added test cases
* Added some more round() to be really correct
2010-11-07 21:05:01 +00:00
Sam Reed
604ae0ca1c Update deprecated method calls
Remove some unused stuff
2010-10-31 16:20:48 +00:00
Philip Tzou
e6c51a4143 1. Revert the complicated redirection I made in r59754;
2. Add more Accept-Language XVO cache name for IE;
3. Use hreflang to specify canonical and alternate links, it's search engine friendly
   when a wiki has multiple variant languages.
2010-10-28 16:58:39 +00:00
Aaron Schulz
8947566ec1 truncateHtml() comment tweaks 2010-10-28 02:47:48 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Niklas Laxström
9ad58598da * (Bug 25451) Language::time() and ::date() misfunction when given timestamps in wrong format
Convert given times to correct format like ::timeandate() already does.
Based on patch by Thorsten Glaser <tg@debian.org>.
2010-10-14 15:59:20 +00:00
Siebrand Mazeland
f11d7ed6b1 Follow-up r74173: remove more PHP pre-5.1.0 comments, including two TODOs. Yay. 2010-10-02 22:49:41 +00:00
Siebrand Mazeland
5b6e452020 Remove comment related to PHP pre-5.1 version. 2010-10-02 22:45:28 +00:00
Aryeh Gregor
980ed5d2b1 Get rid of Language::usesFirstLettersInLists()
Added by me in r69810, but never used.  It's not clear to me if it's
needed, but if so, it can be re-added later.
2010-09-05 20:43:00 +00:00
Sam Reed
e6da69f0f2 Followup r72207, uc isn't static 2010-09-02 21:38:45 +00:00
Ryan Kaldari
b40de88cf7 Adding helpful comments 2010-09-02 18:05:58 +00:00
Chad Horohoe
9e6c7cc8ef Get rid of PHP4-style constructors 2010-08-30 16:52:51 +00:00
Andrew Garrett
2c50a8b9aa Unmerging r71867. Merge-conflicts with some things Nikerabbit was doing. He broke it, leaving him to fix it for now :-) 2010-08-29 03:08:15 +00:00
Andrew Garrett
41a7f65ee1 Fix bug introduced in untested r71576. getNamespaces() did not use getCanonicalNamespaces for backwards-compatibility with 1.16wmf4 :-) 2010-08-29 03:03:28 +00:00
Philip Tzou
0f6c992519 follow up r69134. Change all of convertLinkToAllVariants()'s callers to call autoConvertToAllVariants(). 2010-08-23 02:07:31 +00:00
Niklas Laxström
8cdd3034d5 Fix translated core namespaces broken in r71342.
The parser tests don't fail anymore (after I was able to run them in the first place)
2010-08-21 08:05:16 +00:00
Alexandre Emsenhuber
2d078552de * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-20 20:39:04 +00:00
Niklas Laxström
b7824e03cf Trying to clean up the mess with $wgCanonicalNamespaceNames and $wgExtraNamespaces.
Now those two together define the set of namespaces used in the wiki.
$wgExtraNamespaces is for user configuration and overrides, while
$wgCanonicalNamespaceNames is for extension adding their own namespaces.
No code should access those two directly for reading. Instead they should use
MWNamespace::getCanonicalNamespaces.

Also fixed indentation with spaces to tabs in Language.php
2010-08-20 10:25:10 +00:00
Andrew Garrett
d67ab7f70f Apply hack from 1.16wmf4 in r71329 to trunk (follow-up to r71327). The version in r71327 breaks special pages. 2010-08-20 06:19:37 +00:00
Andrew Garrett
7fe16d59a7 (bug 24837) Fix issue where namespaces which were localised but not defined were returned by Language::getNamespaces() 2010-08-20 05:32:24 +00:00
Sam Reed
721ecb6d2d Remove some more unused variables
Remove srvus() from Parser, unused, and calling testSrvus wrongly
2010-08-19 11:21:14 +00:00
Aryeh Gregor
f0d75be7d9 Use firstChar() in firstLetterForLists()
This will hopefully avoid regression in non-English languages when this
stub starts being used.
2010-08-03 17:47:10 +00:00
Sam Reed
e476b51e3a Stylize languages/*, languages/classes/*, but not languages/messages/* 2010-07-29 09:43:18 +00:00
Aryeh Gregor
2ffa5e4876 Fix bug in prefixing scheme
As Bawolff pointed out at [[mw:User talk:Simetrical/Collation]], the
prefixing scheme I was using meant that the page "Z" with sort key of
"F" would sort after a page named "A" with a sort key of "FF", since the
first one's raw sort key would compute to "FZ", and the second's would
compute to "FFA".  I've fixed this by separating the prefix from the
unprefixed part by a null byte (cl_sortkey is eventually going to be
totally binary anyway, may as well start now).
2010-07-26 22:04:19 +00:00
Aryeh Gregor
022b7ba140 Reconcept cl_raw_sortkey as cl_sortkey_prefix
In response to feedback by Phillipe Verdy on bug 164.  Now if a bunch of
pages have [[Category:Foo| ]], they'll sort amongst themselves according
to page name, instead of in basically random order as it is currently.
This also makes storage more elegant and intuitive: instead of giving
NULL a magic meaning when there's no custom sortkey specified, we just
store an empty string, since there's no prefix.

This means {{defaultsort:}} really now means {{defaultsortprefix:}},
which is slightly confusing, and a lot of code is now slightly
misleading or poorly named.  But it should all work fine.

Also, while I was at it, I made updateCollation.php work as a transition
script, so you can apply the SQL patch and then run updateCollation.php
and things will work.  However, with the new schema it's not trivial to
reverse this -- you'd have to recover the raw sort keys with some PHP.
Conversion goes at about a thousand rows a second for me, and seems to
be CPU-bound.  Could probably be optimized.

I also adjusted the transition script so it will fix rows with collation
versions *greater* than the current one, as well as less.  Thus if some
site wants to use their own collation, they can call it 137 or
something, and if they later want to switch back to MediaWiki stock
collation 7, it will work.

Also fixed a silly bug in updateCollation.php where it would say "1000
done" if it did nothing, and changed $res->numRows() >= self::BATCH_SIZE
to == so people don't wonder how it could be bigger (since it can't, I
hope).
2010-07-26 19:27:13 +00:00
Sam Reed
8b8500c121 More self:: to $this-> 2010-07-25 18:13:56 +00:00
Aryeh Gregor
3783aa2a3c Add non-identity collation, with migration script
It seemed to work correctly, with the newly-created page "bob" sorting
as "BOB", but then I nuked all my cl_sortkey by running the migration
script before refreshLinks.php had finished running, so I'll have to
wait a while to see if it works properly with a non-messed-up database.
It's possible there's something wrong with the display of section
letters in the categories, but otherwise I think this is working right.
2010-07-23 20:58:11 +00:00
Aryeh Gregor
907695c56a Initial commit for category collation framework
Hidden behind $wgExperimentalCategorySort until it's reasonably
complete.  If that's false, no behavior should change (but I didn't test
carefully, so poke me if there's a bug).  See DefaultSettings.php for
documentation on setting it to true.  Currently you should not do this
except if you're working on the feature, since functionality is not
close to reasonable yet and will change rapidly.

Bug 1211 is already fixed with this commit for me.  However, many other
things still need to be done, so this is all very much a
proof-of-concept.
2010-07-23 19:52:02 +00:00
Niklas Laxström
f14cc4dd1d Added $wgAllUnicodeFixes to replace live-hack at twn 2010-07-08 09:15:53 +00:00
Max Semenik
b68c6ae083 Revert r64063, will use a different approach for selected languages later 2010-07-04 16:35:33 +00:00
Aryeh Gregor
74a21f3bd1 Remove most named character references from output
Recommit of r66254 to trunk.  This was just

find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/&nbsp;/\&#160;/g;s/&mdash;/―/g;s/&bull;/•/g;s/&aacute;/á/g;s/&acute;/´/g;s/&agrave;/à/g;s/&alpha;/α/g;s/&auml;/ä/g;s/&ccedil;/ç/g;s/&copy;/©/g;s/&darr;/↓/g;s/&deg;/°/g;s/&eacute;/é/g;s/&ecirc;/ê/g;s/&euml;/ë/g;s/&egrave;/è/g;s/&euro;/€/g;s/&harr;//g;s/&hellip;/…/g;s/&iacute;/í/g;s/&igrave;/ì/g;s/&larr;/←/g;s/&ldquo;/“/g;s/&middot;/·/g;s/&minus;/−/g;s/&ndash;/–/g;s/&oacute;/ó/g;s/&ocirc;/ô/g;s/&oelig;/œ/g;s/&ograve;/ò/g;s/&otilde;/õ/g;s/&ouml;/ö/g;s/&pound;/£/g;s/&prime;/′/g;s/&Prime;/″/g;s/&raquo;/»/g;s/&rarr;/→/g;s/&rdquo;/”/g;s/&Sigma;/Σ/g;s/&times;/×/g;s/&uacute;/ú/g;s/&uarr;/↑/g;s/&uuml;/ü/g;s/&yen;/¥/g' {} +

followed by reading over every single line of the resulting diff and
fixing a whole bunch of false positives.  The reason for this change is
given in <http://lists.wikimedia.org/pipermail/wikitech-l/2010-April/047617.html>.
I cleared it with Tim and Brion on IRC before committing.  It might
cause a few problems, but I tried to be careful; please report any
issues.

I skipped all messages files.  I plan to make a follow-up commit that
alters wfMsgExt() with 'escapenoentities' to sanitize all the entities.
That way, the only messages that will be problems will be ones that
output raw HTML, and we want to get rid of those anyway.

This should get rid of all named entities everywhere except messages.  I
skipped a few things like &nbsp that I noticed in manual inspection,
because they weren't well-formed XML anyway.

Also, to everyone who uses non-breaking spaces when they could use a
normal space, or nothing at all, or CSS padding: I still hate you.  Die.
2010-05-30 17:33:59 +00:00
Niklas Laxström
0b1d23d84c Get rid of wfMsg() in Language 2010-05-27 14:24:34 +00:00
Alexandre Emsenhuber
65658d7066 * (bug 23284) Times are now rounded correctly 2010-04-29 15:09:22 +00:00
Tim Starling
3a2345fe1c Proposed cleanup of recent LanguageConverter-related commits:
* Moved the responsibility for calling $wgOut->setPageTitle() from OutputPage::addParserOutputNoText() to the OutputPage/Parser caller. Previously, every call to $wgOut->addWikiText() (or any other message parsing function) was resulting in the title being reset to a converted version of $wgTitle, producing bug 23124. Moving responsibility to the caller seems to work fairly well, since there are apparently only two callers that really want {{DISPLAYTITLE}} etc. to work (EditPage and Article::view). 
* Reverted data flow obfuscation in OutputPage::setHTMLTitle() from r64851, replaced by the above. The caller decides what overrides what.
* Reverted inappropriate, cache-polluting references to $wgUser and $wgRequest in Parser::parse(), introduced in r64819.
* Reverted incomprehensible boolean parameter to Language::convert() from r64851, reintroduced Language::convertTitle() instead. Gave it a simpler implementation than before.
* Fixed broken {{DISPLAYTITLE}} feature, was being unconditionally overwritten by the ParserOutput::setTitleText() call in Parser::parse(). Give {{DISPLAYTITLE}} precedence over autoconverted title, like we do for -{T|...}-.
* Tested extensively (perhaps not exhaustively)
2010-04-10 13:38:50 +00:00
Jack Phoenix
7cc970edc5 coding style tweaks (spacing, braces, etc.) to Language.php 2010-04-08 20:19:03 +00:00
Alexandre Emsenhuber
98b7af8d12 * (bug 22876) Avoid possible PHP Notice if $wgDefaultUserOptions is not correctly set
Per Nikerabbit, use User::getDefaultOption()
2010-03-27 16:15:17 +00:00
Mark A. Hershberger
560b72c4ab * Implement normalization of fullwidth latin characters for all Languages, not just Japanese and Chinese.
* Tune Language::convertDoubleWidth() so that it is 8-10x faster.  (See http://xrl.us/bg2mon)
2010-03-23 19:50:59 +00:00
Max Semenik
02729fedab Tweaked LanguageConverter to use spaces in formatTimePeriod, things like "1h23m45s" look really ugly 2010-03-23 08:57:59 +00:00
Mark A. Hershberger
b0e1bc1b19 off-by-one error: the fullwidth z was not being converted. 2010-03-15 17:31:29 +00:00
Mark A. Hershberger
54badce2d8 Follow-up r61856
* Rename wordSegmentation() to segmentByWord().
* Consolidate search index locking and iteration to Maintenance.php
* Add maintenance/updateDoubleWidthSearch.php to take care of new
  format for normalized double-width roman characters.
* Add error checking to updateSearchIndex.php for creating $posFile.
* Add note to UPGRADE about running updateDoubleWidthSearch.php.
2010-03-10 21:54:23 +00:00