r70168 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70167‎ | r70168 | r70169 >
Date:19:28, 29 July 2010
Author:mah
Status:resolved (Comments)
Tags:
Comment:
follow-up r70126 — better warnings
Modified paths:
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -848,29 +848,34 @@
849849 * will properly normalize. This normalization was found at
850850 * http://www.unicode.org/versions/Unicode5.2.0/#Character_Additions
851851 * Note that we use the hex representation to create the code
852 - * points in order to avoid any Unicode-destroying during transite.
 852+ * points in order to avoid any Unicode-destroying during transit.
853853 */
854854 $not_normal_c = $this->unicodeChar("FA6C");
855855 $normal_c = $this->unicodeChar("242EE");
856856
857857 $useNormalizer = 'config-unicode-php';
 858+ $needsUpdate = false;
858859
859860 /**
860861 * We're going to prefer the pecl extension here unless
861862 * utf8_normalize is more up to date.
862863 */
863864 if( $utf8 ) {
 865+ $useNormalizer = 'config-unicode-utf8';
864866 $utf8 = utf8_normalize( $not_normal_c, UNORM_NFC );
865 - $useNormalizer = 'config-unicode-utf8';
 867+ if ( $utf8 !== $normal_c ) $needsUpdate = true;
866868 }
867869 if( $intl ) {
 870+ $useNormalizer = 'config-unicode-intl';
868871 $intl = normalizer_normalize( $not_normal_c, Normalizer::FORM_C );
869 - $useNormalizer = 'config-unicode-intl';
 872+ if ( $intl !== $normal_c ) $needsUpdate = true;
870873 }
871874
872 - $this->showMessage( $useNormalizer );
 875+ $this->showMessage( 'config-unicode-using', wfMsg( $useNormalizer ) );
873876 if( $useNormalizer === 'config-unicode-php' ) {
874877 $this->showMessage( 'config-unicode-pure-php-warning' );
 878+ } elseif( $needsUpdate ) {
 879+ $this->showMessage( 'config-unicode-update-warning' );
875880 }
876881 }
877882
Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -79,10 +79,12 @@
8080 'config-env-latest-old' => "'''Warning:''' You are installing an outdated version of Mediawiki.",
8181 'config-env-latest-help' => 'You are installing version $1, but the latest version is $2.
8282 You are advised to use the latest release, which can be downloaded from [http://www.mediawiki.org/wiki/Download mediawiki.org]',
83 - 'config-unicode-php' => "Using pure PHP to normalize Unicode characters.",
84 - 'config-unicode-pure-php-warning' => "'''Warning''': Either the PECL Intl extension is not available, or it uses an older version of [http://site.icu-project.org/ the ICU project's] library for handling Unicode normalization. If you run a high-traffic site, you should read a little on [http://www.mediawiki.org/wiki/Unicode_normalization_considerations Unicode normalization].",
85 - 'config-unicode-utf8' => "Using Brion Vibber's utf8_normalize.so for UTF",
86 - 'config-unicode-intl' => "Using the [http://pecl.php.net/intl intl PECL extension] for UTF-8 normalization.",
 83+ 'config-unicode-php' => "the slow PHP implementation",
 84+ 'config-unicode-utf8' => "Brion Vibber's utf8_normalize.so",
 85+ 'config-unicode-intl' => "the [http://pecl.php.net/intl intl PECL extension]",
 86+ 'config-unicode-using' => 'Using $1 for Unicode normalization.',
 87+ 'config-unicode-pure-php-warning' => "'''Warning''': The [http://pecl.php.net/intl intl PECL extension] is not available to handle Unicode normalization. If you run a high-traffic site, you should read a little on [http://www.mediawiki.org/wiki/Unicode_normalization_considerations Unicode normalization].",
 88+ 'config-unicode-update-warning' => "'''Warning''': The installed version of the Unicode normalization wrapper uses an older version of [http://site.icu-project.org/ the ICU project's] library. You should [http://www.mediawiki.org/wiki/Unicode_normalization_considerations upgrade] if you are at all concerned about using Unicode.",
8789 'config-no-db' => 'Could not find a suitable database driver!',
8890 'config-no-db-help' => 'You need to install a database driver for PHP.
8991 The following database types are supported: $1.

Follow-up revisions

RevisionCommit summaryAuthorDate
r70329* Update r70168 to remove patchwork messages [1]...siebrand11:54, 2 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70126Add detection for unicode normalization. Next step: use what we find! :)...mah02:44, 29 July 2010

Comments

#Comment by Nikerabbit (talk | contribs)   20:37, 29 July 2010

It's better now. I think config-unicode-using is needless complication and you can just use full sentences like originally.

Status & tagging log