Page MenuHomePhabricator

Merge the LanguageUtf8 class into the Language class
Closed, ResolvedPublic

Description

Author: avarab

Description:
Since we'll be going UTF8-only for 1.5 the LanguageUtf8 will become redundant,
it should be merged into the main Language class.


Version: 1.7.x
Severity: minor

Details

Reference
bz2069

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:26 PM
bzimport set Reference to bz2069.
bzimport added a subscriber: Unknown Object (MLST).

Not a 1.5 blocker, as it makes no functional difference.

  • Bug 6173 has been marked as a duplicate of this bug. ***

rotemliss wrote:

Patch (trunk)

See Bug 6173 for explanations. When applying the patch, also delete
languages/LanguageUtf8.php.

attachment patch ignored as obsolete

rotemliss wrote:

Second Patch (trunk)

The first patch was partially applied, this patch includes the changes in all
the other language files. LanguageUtf8.php may be deleted.

attachment patch ignored as obsolete

rotemliss wrote:

I've checked it carefully.

rotemliss wrote:

Patch (trunk)

Brion has reverted the patch in r14693, saying:

"Revert bad patch for (bug 2069) Merge the LanguageUtf8 class into the Language
class"

The most updated patch, which I have carefully checked and which is suited to
the current revision – r14697 (the patch will be updated if other language
files are restructured), is is now available for checking. As usual, the file
"languages/LanguageUtf8.php" should be deleted when checking the patch.

Brion: what is wrong with this patch (or with the commit in r14684), and what
is to do in order to fix it?

attachment patch ignored as obsolete

It caused fatal errors when running Special:Version (and likely
elsewhere, though we reverted it right quick after several
thousand fatal errors spewed through the log).

rotemliss wrote:

(In reply to comment #7)

It caused fatal errors when running Special:Version (and likely
elsewhere, though we reverted it right quick after several
thousand fatal errors spewed through the log).

Ah, the following line is the problem (SpecialVersion::compare,
includes/SpecialVersion.php):

return LanguageUtf8::lc( $a['name'] ) > LanguageUtf8::lc( $b['name']

) ? 1 : -1;

LanguageUtf8 should be replaced with Language. I will create a patch includes
that fix later, and will look at the code to see if there are other problems.

rotemliss wrote:

Patch v2 (trunk)

OK, *this* patch was carefully checked by me (I've visited each of the special
pages and action pages – action=delete, action=history, etc. – to see if
there are some errors), and now produces no error in Special:Version. Also,
I've carefully searched the whole code (all the pages in each folder) and fixed
each occurrence of LanguageUtf8, so now there should be no problem.

attachment patch ignored as obsolete

rotemliss wrote:

Patch v3 (trunk)

Updating the patch for LanguageLa.php and LanguageBe.php.

attachment patch ignored as obsolete

rotemliss wrote:

Patch v4 (trunk)

Updating the patch for LanguageNl.php.

attachment patch ignored as obsolete

rotemliss wrote:

Patch v5 (trunk)

Updates, so that the patch will not cause failures when using the "patch"
utility.

attachment patch ignored as obsolete

rotemliss wrote:

Patch v6 (trunk)

Fixing the line numbers.

Attached:

rotemliss wrote:

Already done by Tim Starling in the localisation-work branch, added to trunk in
r15823.