Page MenuHomePhabricator

Add convenient-discussions to translatewiki.net
Closed, ResolvedPublic

Description

Project setup checklist

Project information

Name: Convenient Discussions
Logo:

  • Optional, SVG format recommended. Add filename in commons or translatewiki.net

Project description: Convenient Discussions is a JavaScript tool providing a shell over the existing MediaWiki discussion system that allows the user to post and edit comments without switching to a separate page.

Project page:

Project configuration (for translation admins)

Namespace: NS_WIKIMEDIA
Prefix: convenientdiscussions-
Validators:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 18 2020, 4:47 PM
Iniquity updated the task description. (Show Details)May 18 2020, 5:06 PM

@Nikerabbit Do we need to create a qqq.json now, or can we add it after creating the project? :)

It's okay to do it after creation (you can fill it in translatewiki.net).

Ok, thanks :)

Nikerabbit updated the task description. (Show Details)May 19 2020, 7:35 AM

Change 597268 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[translatewiki@master] Add support for Convenient Discussions

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

abi_ added a subscriber: abi_.May 19 2020, 1:04 PM

I've added the,

  1. Project page - https://translatewiki.net/wiki/Translating:Convenient_Discussions
  2. Translation description

@abi_ Sorry, I had no time to update the repository properly. The path for translations has moved from src/js/i18n/%CODE%.json to i18n/%CODE%.json (there is the old path in the patch).

So, as for messages, you can see the example here: https://github.com/jwbth/convenient-discussions/blob/master/i18n/en.json. Messages can have everything that the MediaWiki messages API allows ({{int:}}, {{gender:}}, {{plural:}}).

After the script has run on a wiki page, the translation messages get the prefix convenientdiscussions- if retrieved by the mw.msg() function. In other cases of assigning a code to the script, it is probably better to keep the hyphen between the words: convenient-discussions.

As for activity, if I manage to set up a (semi-)automatic system to do the releases (or make a repository on Gerrit to load the messages from there right away), the releases should be as frequent as possible. If not, they won't take longer than a month, I hope.

Do I need to name the localization threshold also?

Does order of keys in en.json matter in any way?

abi_ added a comment.May 19 2020, 5:10 PM

@Jack_who_built_the_house - I'll go through and answer your questions tomorrow, but couple of things that we wanted to call out,

  1. The English strings have double quotes used as apostrophe, any specific reason why? Eg: Show a link to edit other users\" comments
  2. English only has two plural forms, but we noticed that there are messages that have three forms specified. Eg: "notification-newcomments": "$1 new {{plural:$1|comment|comments|comments}}$2$3

@abi_

  1. No, sorry, just an artifact of a sloppy conversion from JS to JSON. Fixed.
  2. Thanks, fixed.
abi_ claimed this task.May 20 2020, 5:03 AM
abi_ triaged this task as Medium priority.
abi_ added a comment.May 20 2020, 2:17 PM

@Jack_who_built_the_house:

@abi_ Sorry, I had no time to update the repository properly. The path for translations has moved from src/js/i18n/%CODE%.json to i18n/%CODE%.json (there is the old path in the patch).

Thanks. Updated the path.

After the script has run on a wiki page, the translation messages get the prefix convenientdiscussions- if retrieved by the mw.msg() function. In other cases of assigning a code to the script, it is probably better to keep the hyphen between the words: convenient-discussions.

The prefix that we use as a MANGLER is internal to translatewiki.net, when we import, we add this prefix, and remove them when exporting them out to the repository.

As for activity, if I manage to set up a (semi-)automatic system to do the releases (or make a repository on Gerrit to load the messages from there right away), the releases should be as frequent as possible. If not, they won't take longer than a month, I hope.

We will be pushing out updates to the current Github repository every week on Monday and Thursday. Once a month for release is fine.

Do I need to name the localization threshold also?

No, we will use the default 25.

Does order of keys in en.json matter in any way?

No, they don't they can be in any order.

Iniquity moved this task from Backlog to i18n on the Convenient-Discussions board.May 21 2020, 2:05 PM
Iniquity updated the task description. (Show Details)May 22 2020, 10:23 PM
Iniquity updated the task description. (Show Details)May 22 2020, 10:27 PM

I guess everything is ready on my part. Is there anything else needed?

abi_ added a comment.May 26 2020, 4:25 AM

@Jack_who_built_the_house - No nothing pending from your side as of now. We will add the project to twn, and comment here.

Change 597268 merged by jenkins-bot:
[translatewiki@master] Add support for Convenient Discussions

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

Change 598715 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[translatewiki@master] Convenient Discussions: Add prefix for optional messages

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

Change 598715 merged by jenkins-bot:
[translatewiki@master] Convenient Discussions: Add prefix for optional messages

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

Thanks! Two questions:

  1. At https://translatewiki.net/w/i.php?title=Special:Translate&group=convenient-discussions&language=ru&filter=%21translated&action=translate, I see 4 "outdated" messages and 1 "untranslated" while they in fact are OK. What should I do with them?
    1. For the "outdated" messages, the following notice is shown: "Following parameter is unknown: $2". In fact, the $2 parameter is not used in the English translation because it's not needed there. But I will include it in the message documentation.
    2. The 1 "untranslated" message (containing the word to) is in fact translated, it's just an empty string.
  2. Can I and/or other users edit the English source on the site? English is not my native language, so it's quite possible that the translation would benefit from other users' improvements too.

Change 598726 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[translatewiki@master] Convenient Discussions: Add messages to blacklist for unknown variable usage

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

abi_ added a comment.May 26 2020, 12:05 PM

As you noticed, the patch has been deployed and messages are ready to be translated.

For the "outdated" messages, the following notice is shown: "Following parameter is unknown: $2". In fact, the $2 parameter is not used in the English translation because it's not needed there. But I will include it in the message documentation.

The validator expects a certain variable used in translations to be present in the source string but that can be circumvented by adding the language code to a validation blacklist that we have.

The 1 "untranslated" message (containing the word to) is in fact translated, it's just an empty string.

Not quite sure what to do here. I spoke to Niklas, and he said that instead of the string being just "to", it should be something like "$1 to $2" so that words can be reordered.

Can I edit the English source on the site? English is not my native language, so it's quite possible that the translation would benefit from other users' improvements.

Editing the source language on the translatewiki.net site is not possible. I can review the English source string once you've added the message documentation and offer some comments.

that can be circumvented by adding the language code to a validation blacklist that we have

Thanks.

I spoke to Niklas, and he said that instead of the string being just "to", it should be something like "$1 to $2" so that words can be reordered.

I just noticed that after Iniquity's patch this message is no longer needed. Sorry for disturb.

Editing the source language on the translatewiki.net site is not possible. I can review the English source string once you've added the message documentation and offer some comments.

I will appreciate! I will notify when I complete the documentation. BTW, how often are changes of the source language file in the source repository checked?

Also, what happens when a message with some key is removed from the source language file? Is it removed from the site also? What about its translations?

abi_ added a comment.May 26 2020, 3:01 PM

BTW, how often are changes of the source language file in the source repository checked?

Changes are pulled from the source repository twice a day.

Also, what happens when a message with some key is removed from the source language file? Is it removed from the site also? What about its translations?

You'll find information about this in the FAQ here.

I had added some more messages that look like this in English source: "reply to $1", but in translations those messages would need to use {{gender:$2}}. So, either I should ask you to add more exceptions to this commit, or I should use some kind of a placeholder ("reply to {{gender:$2|}} $1"), and then remove two spaces produced by this code for English in the code of my script. What do you think is better? Currently I've added such placeholders, so if we stick to that, the commit is no longer needed.

The problem with {{gender:$2}} is that, in the jquerymsg format, not a user name is passed to the {{gender:}} function, but a mw.user-like object or a gender (see the documentation, the relevant mediawiki.jqueryMsg code). As a result, I have to use two distinct variables for the name and for the gender. Actually, I would really love to have the parser automatically use mw.user.toString() to get the user name out of mw.user, but currently neither mw.user has that method, nor mediawiki.jqueryMsg utilizes it. I'll create a phabricator task for that case.

Separate variable is okay, and having {{GENDER:$2}} be always present in English when supported, even if not needed there, is the recommended practice. In this case {{GENDER:$2|$1}} would probably be cleanest.

Nikerabbit updated the task description. (Show Details)Jun 1 2020, 2:16 PM
Iniquity added a comment.EditedJun 7 2020, 10:18 PM

Hi, is it possible to add https://phabricator.wikimedia.org/diffusion/MGCD/repository/master/ this repo like a mirror for translatewiki bot? :)

Sorry, I do not understand the request. We only deal with primary repositories. If you needs mirrors, that's something you need to figure out yourself.

Ok, thanks :)

Change 598726 abandoned by Abijeet Patro:
Convenient Discussions: Add messages to blacklist for unknown variable usage

Reason:
This is no longer needed.

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

abi_ closed this task as Resolved.Jun 15 2020, 9:24 AM

This has been deployed and translations are being pushed out to the repository.