r66452 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66451‎ | r66452 | r66453 >
Date:22:35, 14 May 2010
Author:neilk
Status:deferred (Comments)
Tags:
Comment:
pluralizations, time messages
Modified paths:
  • /trunk/extensions/UploadWizard/js/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/styles/uploadWizard.css (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/styles/uploadWizard.css
@@ -502,5 +502,4 @@
503503
504504 a.mwe-upwiz-tooltip-link {
505505 cursor: pointer;
506 - color: red;
507506 }
Index: trunk/extensions/UploadWizard/js/mw.UploadWizard.js
@@ -4,7 +4,8 @@
55 "mwe-upwiz-step-details": "3. Add descriptions",
66 "mwe-upwiz-step-thanks": "4. Use your files",
77 "mwe-upwiz-intro": "Welcome to Wikimedia Commons, a repository of images, sounds, and movies that anyone can freely download and use. Add to humanity's knowledge by uploading files that could be used for an educational purpose.",
8 -
 8+
 9+ // XXX maybe use mediawiki PLURAL here
910 "mwe-upwiz-add-file-n": "Add another file",
1011 "mwe-upwiz-add-file-0": "Click here to add a file for upload",
1112 "mwe-upwiz-browse": "Browse...",
@@ -15,12 +16,17 @@
1617 "mwe-upwiz-remove-upload": "Remove this file from the list of files to upload",
1718 "mwe-upwiz-remove-description": "Remove this description",
1819 "mwe-upwiz-upload": "Upload",
19 - "mwe-upwiz-upload-count": "$1 {{PLURAL:$1|file|files}} of $2 {{PLURAL:$2|file|files}} uploaded",
 20+ "mwe-upwiz-upload-count": "$1 {{PLURAL:$1|file|files}} of $2 uploaded",
2021 "mwe-upwiz-progressbar-uploading": "uploading",
21 - "mwe-upwiz-remaining": "$1 {{PLURAL:$1|file|files}} remaining",
 22+ "mwe-upwiz-hrs-mins-secs-remaining": "$1 {{PLURAL:$1|hour|hours}}, $2 {{PLURAL:$2|minute|minutes}}, $3 {{PLURAL:$3|second|seconds}} remaining",
 23+ "mwe-upwiz-mins-secs-remaining": "$1 {{PLURAL:$1|minute|minutes}}, $2 {{PLURAL:$2|second|seconds}} remaining",
 24+ "mwe-upwiz-secs-remaining": "$1 {{PLURAL:$1|second|seconds}} remaining",
 25+ // XXX use mediawiki plurals
2226 "mwe-upwiz-deeds-intro": "Thank you! Now we need to set a license for these files, so everyone can legally view or modify them. First, we'll have to know where you got them.",
 27+ // XXX use mediawiki plurals
2328 "mwe-upwiz-details-intro": "Now we need some basic information about the files.",
2429 "mwe-upwiz-source-ownwork": "This file is my own work.",
 30+ // XXX use mediawiki plurals
2531 "mwe-upwiz-source-ownwork-plural": "These files are my own work.",
2632 "mwe-upwiz-source-ownwork-assert": "I, $1, the copyright holder of this work, hereby grant anyone the right to use this work for any purpose, as long as they credit me and share derivative work under the same terms.",
2733 "mwe-upwiz-source-ownwork-assert-plural": "I, $1, the copyright holder of these works, hereby grant anyone the right to use these works for any purpose, as long as they credit me and share derivative work under the same terms.",
@@ -29,16 +35,19 @@
3036 "mwe-upwiz-source-ownwork-assert-note": "This means you release your work under a double Creative Commons Attribution ShareAlike and GFDL license.",
3137 "mwe-upwiz-source-permission": "Their author gave you explicit permission to upload them",
3238 "mwe-upwiz-source-thirdparty": "This file is not my own work.",
 39+ // XXX use mediawiki plurals
3340 "mwe-upwiz-source-thirdparty-plural": "These files are not my own work.",
3441 "mwe-upwiz-source-thirdparty-intro" : "Please enter the address where you found each file.",
3542 "mwe-upwiz-source-thirdparty-custom-plural-intro" : "If all files have the same source, author, and copyright status, you may enter them only once for all of them.",
3643 "mwe-upwiz-source-thirdparty-license" : "The copyright holder of this work published it under the following license(s):",
 44+ // XXX use mediawiki plurals
3745 "mwe-upwiz-source-thirdparty-license-plural" : "The copyright holder of these works published them under the following license(s):",
3846 "mwe-upwiz-source-thirdparty-accept": "OK",
3947 "mwe-upwiz-source-custom": "Did you know? You can <a href=\"$1\">customize</a> the default options you see here.",
4048 "mwe-upwiz-more-options": "more options...",
4149 "mwe-upwiz-fewer-options": "fewer options...",
4250 "mwe-upwiz-desc": "Description in",
 51+ // XXX use mediawiki PLURAL
4352 "mwe-upwiz-desc-add-n": "add a description in another language",
4453 "mwe-upwiz-desc-add-0": "add a description",
4554 "mwe-upwiz-title": "Title",
@@ -216,9 +225,21 @@
217226 }
218227
219228 if ( remainingTime !== null ) {
220 - _this.$selector
221 - .find( '.mwe-upwiz-etr' )
222 - .html( gM( 'mwe-upwiz-remaining', mw.seconds2npt( parseInt( remainingTime / 1000 ), 10 ) ) );
 229+ var tm = mw.seconds2tm( parseInt( remainingTime / 1000, 10 ) );
 230+ var seconds = tm[0];
 231+ var minutes = tm[1];
 232+ var hours = tm[2];
 233+ var timeString;
 234+ if (hours == 0) {
 235+ if (minutes == 0) {
 236+ timeString = gM( 'mwe-upwiz-secs-remaining', seconds )
 237+ } else {
 238+ timeString = gM( 'mwe-upwiz-mins-secs-remaining', minutes, seconds )
 239+ }
 240+ } else {
 241+ timeString = gM( 'mwe-upwiz-hrs-mins-secs-remaining', hours, minutes, seconds );
 242+ }
 243+ _this.$selector.find( '.mwe-upwiz-etr' ).html( timeString )
223244 }
224245 },
225246

Comments

#Comment by Siebrand (talk | contribs)   23:47, 14 May 2010

Can you plese also update the .i18n.php file if you update source messages?

#Comment by NeilK (talk | contribs)   09:14, 15 May 2010

This will happen soon. I'm waiting for a commit by mdale to the JS2Support extension, which will make string handling much easier for me. Sorry that it was somewhat confusing for you.

When that happens, the .i18n.php file will be the authoritative source for the strings in this project, more like common Mediawiki practice.

Status & tagging log