Page MenuHomePhabricator

Hardcoded colons in translatable strings - Non-breaking space needed in French for Quiz
Closed, ResolvedPublic

Description

Hello,
The French typographic rules impose to add a non-breaking space before each colon.

However the quiz extension doesn't provide it in its introduction about the points, and I can't find any Mediawiki or TranslateWiki page for it.

As discussed here:
https://fr.wikiversity.org/wiki/Wikiversit%C3%A9:La_salle_caf%C3%A9/27_2014#Balise_quiz


Version: unspecified
Severity: minor

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:41 AM
bzimport set Reference to bz67375.
bzimport added a subscriber: Unknown Object (MLST).

However the quiz extension doesn't provide it in its introduction about the points

Where and how to see that (URL)? (Code is at https://git.wikimedia.org/tree/mediawiki%2Fextensions%2FQuiz.git if you feel like taking a look.)

The discussion on my URL displays it in French, but I must be able to check /i18n/fr.json and submit it this evening...

The problem is the TODO here: https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FQuiz.git/b23418d4903d448f7a478403925230400249c668/Quiz.class.php#L140

A really ugly hack might be to change the French translations in Quiz.i18n.php to end with an nbsp but I have no idea if our translation format supports entering and processing that. Somehow.

I had removed the three colons in this file (rather not than without space, to initiate any Translatewiki colons addition after), but I can't push by using my Gerrit account:

$ git push --set-upstream quiz master
Username for 'https://git.wikimedia.org': JackPotte
Password for 'https://[email protected]':
fatal: Authentication failed for 'https://git.wikimedia.org/git/mediawiki/extensions/Quiz.git/'

$ git push --set-upstream quiz master
Username for 'https://gerrit.wikimedia.org': JackPotte
Password for 'https://[email protected]':
fatal: Authentication failed for 'https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Quiz.git/'

https://gerrit.wikimedia.org/r/#/settings/group-memberships indicates that I'm
Anonymous Users
Registered Users
mediawiki-training
So it seems I don't have the right to submit any modification for now.

(In reply to JackPotte from comment #6)

So it seems I don't have the right to submit any modification for now.

Did you follow the steps in https://www.mediawiki.org/wiki/Developer_access ?

I've got a Wikitech shell account since the beginning, but my groups are:
Registered users, Users, shell

JackPotte: If you think that you don't have sufficient rights, please do paste the commands and error messages here when you follow https://www.mediawiki.org/wiki/Gerrit/Tutorial

I've regenerated an SSH key, re-added it into Git Bash, Gerrit and Wikitech, and recloned Quiz. But finally the same error occurred during the push:
/Git/quiz (master)
$ git push https://gerrit.wikimedia.org/r/mediawiki/extensions/Quiz HEAD:refs/f
or/master
Username for 'https://gerrit.wikimedia.org': JackPotte
Password for 'https://[email protected]':
fatal: Authentication failed for 'https://gerrit.wikimedia.org/r/mediawiki/exten
sions/Quiz/'

/Git/quiz (master)

The password I've entered several times works on https://gerrit.wikimedia.org/

It may be simpler if someone else could proceed, Quiz.class.php took me less than one minute to be modified.

You must set a separate password to push via HTTPS: https://gerrit.wikimedia.org/r/#/settings/http-password .

But I'm not aware of anyone who has successfully uses that, people usually push via SSH after adding public key at https://gerrit.wikimedia.org/r/#/settings/ssh-keys .

Thank you, the authentication has worked in HTTPS, but now I've got "prohibited by Gerrit", by pushing in HTTPS or SSH, with the branch "master" or another:

/Git/quiz (master)
$ git push
Username for 'https://gerrit.wikimedia.org': jackpotte
Password for 'https://[email protected]':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 352 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Branch refs/heads/master:
remote: You are not allowed to perform this operation.
remote: To push into this reference you need 'Push' rights.
remote: User: jackpotte
remote: Please read the documentation and contact an administrator
remote: if you feel the configuration is incorrect
remote: Processing changes: refs: 1, done
To https://gerrit.wikimedia.org/r/mediawiki/extensions/Quiz
! [remote rejected] master -> master (prohibited by Gerrit)
error: failed to push some refs to 'https://gerrit.wikimedia.org/r/mediawiki/ext
ensions/Quiz'

/Git/quiz (master)
$ git push origin master
Enter passphrase for key '/c/Users/jackpotte/.ssh/id_rsa':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 352 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Branch refs/heads/master:
remote: You are not allowed to perform this operation.
remote: To push into this reference you need 'Push' rights.
remote: User: jackpotte
remote: Please read the documentation and contact an administrator
remote: if you feel the configuration is incorrect
remote: Processing changes: refs: 1, done
To ssh://[email protected]:29418/mediawiki/extensions/Quiz
! [remote rejected] master -> master (prohibited by Gerrit)
error: failed to push some refs to 'ssh://[email protected]:29418/m
ediawiki/extensions/Quiz'

You still need to push to 'refs/for/master', like in the command you had in comment 10. You can't directly push to 'master' unless you have "Push" rights, like the error message explains (which no one has for most of our repositories, as far as I know).

Now it seems to refuse my Change-Id, I tried to follow the hint below without success:

$ git push ssh://[email protected]:29418/mediawiki/extensions/Quiz
HEAD:refs/for/master
Enter passphrase for key '/c/Users/hbossot/.ssh/id_rsa':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 352 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: refs: 1, done
remote: ERROR: missing Change-Id in commit message footer
remote: Suggestion for commit message:
remote: https://bugzilla.wikimedia.org/show_bug.cgi?id=67375
remote:
remote: Change-Id: I6d592bddb47ada1e221e3d6921a1b62484ee3e04
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 [email protected]
kimedia.org:hooks/commit-msg ${gitdir}/hooks/
remote:
remote:
To ssh://[email protected]:29418/mediawiki/extensions/Quiz
! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit messag
e footer)
error: failed to push some refs to 'ssh://[email protected]:29418/m
ediawiki/extensions/Quiz'

I've posted the summary of my process:
https://www.mediawiki.org/w/index.php?title=User%3AJackPotte&diff=1222023&oldid=1014645

Finally it seems to work by manually inserting the change ID above:

$ git push ssh://[email protected]:29418/mediawiki/extensions/Quiz
HEAD:refs/for/master
Enter passphrase for key '/c/Users/hbossot/.ssh/id_rsa':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 398 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: new: 1, refs: 1, done
remote:
remote: New Changes:
remote: https://gerrit.wikimedia.org/r/166284
remote:
To ssh://[email protected]:29418/mediawiki/extensions/Quiz

  • [new branch] HEAD -> refs/for/master

Change 166284 had a related patch set uploaded by Bartosz Dziewoński:
Do not hardcode colons outside of translatable strings

https://gerrit.wikimedia.org/r/166284

I was wondering, if Gerrit is up-to-date for two years, but not the Wikiversity, does it mean that I have to open another ticket to make it install?

I was wondering, if Gerrit is up-to-date for two years, but not the Wikiversity, does it mean that I have to open another ticket to make it install?

The change is still open on gerrit, per @Shirayuki comment, that changes also need to be made to en.json (in the i18n folder) to add the colon in.

This comment was anterior to mine, explaining that the colon is a part of the sentences translated with https://translatewiki.net/wiki/MediaWiki:Quiz_addedPoints/fr.
And I can do these colon additions in Translatewiki.

This comment was anterior to mine, explaining that the colon is a part of the sentences translated with https://translatewiki.net/wiki/MediaWiki:Quiz_addedPoints/fr.
And I can do these colon additions in Translatewiki.

Yes, you can make the changes in French on translatewiki. However, you have to change en.json in the gerrit change in order to trigger the message for re-translation on translatewiki, I believe. If there are no changes in the source to the i18n files they will not be presented for re-translation.

@siebrand knows more about it than I though.

Change 166284 had a related patch set uploaded (by JackPotte):
Do not hardcode colons outside of translatable strings

https://gerrit.wikimedia.org/r/166284

Change 166284 merged by jenkins-bot:
Do not hardcode colons outside of translatable strings

https://gerrit.wikimedia.org/r/166284

Mvolz removed a project: Patch-For-Review.
Mvolz removed subscribers: gerritbot, wikibugs-l-list.