Page MenuHomePhabricator

Add Anvesha application to translatewiki.net
Closed, ResolvedPublic

Description

Project setup checklist

  • Repository: https://github.com/sahajsk21/Anvesha
  • Content fit
  • OS License: GPL-3.0 License
  • Quality of strings
  • Message documentation
  • Activity
  • File format: JSON
  • Project information (see template below)
  • Commit access
  • News

Project information

Name: Anvesha
Homepage: https://wikidatawalkabout.org/
Logo:

Project description:
Anvesha lets the user drill down through the data of any Wikibase installation, including Wikidata.

Project page:

Copy from example, such as https://translatewiki.net/wiki/Translating:Global_Search

Project configuration (for translation admins)

Namespace: NS_WIKIMEDIA
Prefix: anvesha-
Validators:

  1. MediaWikiParameterValidator for variables like $1

Concerns

  • Plurals are currently being handled like this: "itemCount": "There are $1 items that match this description. | There is $1 item that matches this description.", - Improved by changing to use banana-i18n plural format, but more than 2 plural forms are ignored.
  • Update project contact on https://translatewiki.net/wiki/Translating:Anvesha - AP: Set the email accounts from GitHub README

Event Timeline

abi_ triaged this task as Medium priority.
abi_ updated the task description. (Show Details)

@abi_ - thank you for looking into this. I should have specified this before, but the "translatewiki" account does in fact have push access to the GitHub repository, as requested.

Also - what is wrong with that i18n message?

Nikerabbit subscribed.

@abi_ - thank you for looking into this. I should have specified this before, but the "translatewiki" account does in fact have push access to the GitHub repository, as requested.

If you were wondering about the unticked checkbox, that's because we do not tick it before I have accepted the invite.

Also - what is wrong with that i18n message?

@Yaron_Koren - Couple of things,

  1. Lot of languages have more than 2 plural forms. Hebrew or Arabic for example.
  2. That is not a standard way of doing things, so from Translatewiki.net end, we cannot validate that translators provided proper pluralization. Currently if a user does not provide proper pluralization then Translatewiki.net warns them:

image.png (416×981 px, 49 KB)

@abi_ - I speak Hebrew, and I'm still not sure I understand. :) What should the message look like instead?

Yaron, most of the time Hebrew needs only two forms, but for examples of where more than two plural forms are needed, see https://translatewiki.net/wiki/Localisation_guidelines/he . TL;DR: for hours, days, and years.

MediaWiki localization is smart enough to guess that when you don't supply all the forms, the last form should be used for everything else. Unfortunately, not all localization formats are so smart and sometimes you need to repeat yourself.

I... still don't understand. Please, just someone tell me what the message should look like. :)

@Yaron_Koren - The problem with the current system on Anvesha is that it can handle 2 plural forms fine, but anything more than that I expect it will have problems.

"itemCount": "There are $1 items that match this description. | There is $1 item that matches this description.",

If the user is translating the above message (or other future messages) into a language than they would have:

"itemCount": "Plural form 1 | Plural form 2 | Plural form 3",

The above approach also has a lot of repetition.

Instead if you see this message as an example: https://translatewiki.net/w/i.php?title=Special:Translate&showMessage=bs-expiry-text-delete&group=ext-bluespiceexpiry&language=ar

Do you really want to delete {{PLURAL:$1|this expiry|these $1 expiries}}?

That's a format that Translatewiki.net understands, and only the parts that are plurals are repeated. See how banana-i18n handles this: https://github.com/wikimedia/banana-i18n#plurals

So if you were using banana-i18n that message would be written as:

There are {{PLURAL:$1|one item that matches|$1 items that match}} this description.

I hope that clarifies things.

@abi_ I have changed the format to match the one in banana-i18n. Are there any other concerns?

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

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

@abi_ I have changed the format to match the one in banana-i18n. Are there any other concerns?

Thanks for changing it. Everything else looks fine.

I'm currently seeing this logo: https://github.com/sahajsk21/Anvesha/blob/master/images/logo.png

Would it be possible to get a bigger logo? Its not mandatory, just something good to have.

Change 644190 merged by jenkins-bot:
[translatewiki@master] Add support for Anvesha

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

@Sahajsk / @Yaron_Koren :

Anvesha is now available for translations on translatewiki.net: https://translatewiki.net/wiki/Special:Translate?group=anvesha&language=fr&filter=&action=translate

The French translations have been imported.

Couple of more concerns,

1. Message documentation (qqq.json)

In the qqq.json file we have parameters defined as follows:

"filterTimeout": "Note displayed on filter values page when fallback results are given due to timeout of SPARQL query.Parameters: $1 - filter name,like genre",

The formatting can be improved:

"filterTimeout": "Note displayed on filter values page when fallback results are given due to timeout of SPARQL query.\n\nParameters:\n* $1 - filter name,like genre",\n* $2 - Hello World

That way the documentation appears properly formatted on translatewiki.net:

image.png (635×1 px, 103 KB)

You can modify this on translatewiki.net if you want, and these will be updated in the JSON file when exports happen tomorrow. Exports are done on Mondays's and Thursday's.

2. More than 2 plural forms are ignored

If I see the commit that adds support for the new PLURAL format, https://github.com/sahajsk21/Anvesha/commit/6ecb5c4c45a99be9089bf2a588d8f4f35fd3ede3

I see that more than 2 plural forms will be ignored.

str = matches[1].split('|')[(totalValues > 1 ? 1 : 0)]

Parsing of plural forms requires knowledge of the specific language.

@Yaron_Koren / @Sahajsk - Do either one of you have an account on translatewiki.net? It will be used on https://translatewiki.net/wiki/Translating:Anvesha

We can also use the contact information on the GitHub README.md, but it would be ideal if it is a translatewiki.,net account.

@abi_

  1. Can I make the changes directly in the repository's qqq.json? It seems like I need permission to make any change using translatewiki.net.
  2. We are working on this, but hopefully, it won't affect the translations, will it?

I don't have translatewiki.net account, but I'll ask if Yaron has one and let you know.

@abi_ and @Nikerabbit - thank you very much for accepting Anvesha! This is great news.

I've explained the whole qqq handling to @Sahajsk, and we're already working on making the fixes you suggested. (As well as increasing the logo size.)

@Yaron_Koren, @Sahajsk ,

1. Message Documentation

Can I make the changes directly in the repository's qqq.json? It seems like I need permission to make any change using translatewiki.net.

Feel free to make changes directly to the repositories qqq.json files but only for the the messages where the parameter format needs to be updated.

2. More than 2 plural forms are ignored

We are working on this, but hopefully, it won't affect the translations, will it?

No it will not affect submitted translations.

3. Translatewiki account account

If you have an translatewiki account, great, otherwise we can live with the contact information on GitHub README.

Closing this for now. We will create a separate issue to track plural functionality implementation