Page MenuHomePhabricator

Add Toolhub to translatewiki.net
Closed, ResolvedPublic

Description

Project information

Name: Toolhub
Homepage: https://meta.wikimedia.org/wiki/Toolhub
Logo:

Project description:

Toolhub is an authoritative and well promoted catalog of Wikimedia tools. This web-based application is developed as a free and open source project under the umbrella of the Wikimedia Foundation for the benefit of the Wikimedia movement. The software project consists of a Django backend application, a Vue.js frontend application, and a web API to allow creation of additional tools to assist in registering tools with the catalog as well as displaying information from the catalog.

Project page:

NOTE: Section below will be filled by twn staff

Project setup checklist

Project configuration (for translation admins)

Namespace: NS_WIKIMEDIA
Prefix: toolhub- / toolhub-js-
Validators:
Django:

  • GettextNewline
  • GettextPlural

JavaScript:

  • Variables like: {action}, {target}

Concerns

  • Need to add message documentation for Django generated Gettext files once added to translatewiki.net
  • Front-end JSON files do not have banana-i18n plural format. I'm not sure if the format: "0 tools | 1 tool | {n} tools" can support languages that have multiple plural forms.

Event Timeline

Git hosting is at https://gerrit.wikimedia.org/r/admin/repos/wikimedia/toolhub

License is GPL-3.0-or-later

The project's Django generated Gettext message files are found under toolhub/locale.

The project's Vue frontend uses banana formatted json message files found under vue/src/assets/locales/i18n.

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

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

Hi @bd808

Thanks for your request, and sorry for the delay in responding to this. A few points,

  1. Note to add message documentation for the Gettext files after we add the project to translatewiki.net
  2. In the front-end JSON files do not have banana-i18n plural format. I'm not sure if the format: "0 tools | 1 tool | {n} tools" can support languages that have multiple plural forms. The vue-i18n library requires some custom changes to support Slavic and Russian languages: https://kazupon.github.io/vue-i18n/guide/pluralization.html#custom-pluralization
  3. I'll be submitting a separate patch to provide l10n-bot push access to the repo - https://www.mediawiki.org/wiki/Gerrit/L10n-bot

Change 651183 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[integration/config@master] Add gate-and-submit-l10n to Toolhub

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

Hi @bd808

Thanks for your request, and sorry for the delay in responding to this. A few points,

  1. Note to add message documentation for the Gettext files after we add the project to translatewiki.net

I was wondering how qqq messages work with the gettext format. Django has some magic comment ability to add hints to the generated po files, but this seems tricky to implement in all cases. Is it normal just to manually maintain the qqq hints on the TWN side for a gettext based project?

  1. In the front-end JSON files do not have banana-i18n plural format. I'm not sure if the format: "0 tools | 1 tool | {n} tools" can support languages that have multiple plural forms. The vue-i18n library requires some custom changes to support Slavic and Russian languages: https://kazupon.github.io/vue-i18n/guide/pluralization.html#custom-pluralization

Yes, we are aware that the vue-i18n plural support is not as robust as MediaWiki's banana format. I had read that upstream note previously but had not made a ticket to track up implementing the customization. I have now created T270633: Customize vue-i18n plural support for languages with complex pluralization rules as a reminder. In an ideal world we would upstream more robust rules to vue-i18n, but we can certainly start with local customizations.

  1. I'll be submitting a separate patch to provide l10n-bot push access to the repo - https://www.mediawiki.org/wiki/Gerrit/L10n-bot

I think the current repo config will allow l10n-bot to push and +2 because for the Toolhub gerrit repo "Rights Inherit From
wikimedia", but yes if more access is needed we can certainly add rights.

In T269469#6706143, @bd808 wrote:
I was wondering how qqq messages work with the gettext format. Django has some magic comment ability to add hints to the generated po files, but this seems tricky to implement in all cases.

I think it might be good to have magic comments when possible, but would not go out of your way to ensure that its added for all cases. We can then link them in the editor using this syntax: https://gerrit.wikimedia.org/r/plugins/gitiles/wikimedia/toolhub/+/refs/heads/main/%FILE%#%LINE%. An example of this is in the Dissemin project (GitHub).

Is it normal just to manually maintain the qqq hints on the TWN side for a gettext based project?

Yes, these will then be exported out to the repository in the qqq.po file.

Yes, we are aware that the vue-i18n plural support is not as robust as MediaWiki's banana format. I had read that upstream note previously but had not made a ticket to track up implementing the customization. I have now created T270633: Customize vue-i18n plural support for languages with complex pluralization rules as a reminder. In an ideal world we would upstream more robust rules to vue-i18n, but we can certainly start with local customizations.

Sounds good to me. I will check the patch that has been submitted.

I think the current repo config will allow l10n-bot to push and +2 because for the Toolhub gerrit repo "Rights Inherit From
wikimedia", but yes if more access is needed we can certainly add rights.

Yup this patch should be enough.

Change 651487 had a related patch set uploaded (by Hashar; owner: Hashar):
[wikimedia/toolhub@refs/meta/config] Permissions for l10n-bot

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

Change 651487 merged by Hashar:
[wikimedia/toolhub@refs/meta/config] Permissions for l10n-bot

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

Change 651183 merged by jenkins-bot:
[integration/config@master] Add gate-and-submit-l10n to Toolhub

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

Change 651180 merged by jenkins-bot:
[translatewiki@master] Add support for Toolhub

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

Change 651773 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[translatewiki@master] Toolhub: Fix sourcePattern for toolhub-js

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

Change 651773 merged by jenkins-bot:
[translatewiki@master] Toolhub: Fix sourcePattern for toolhub-js

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

Toolhub is now available on Translatewiki.net for translation: https://translatewiki.net/wiki/Translating:Toolhub

Exports from the repo will be done tomorrow.

abi_ updated the task description. (Show Details)

Exports are also working fine. Marking this as resolved.