[go: up one dir, main page]

Page MenuHomePhabricator

Use translatewiki.net to localize Phabricator
Closed, ResolvedPublic

Assigned To
Authored By
flimport
Jun 5 2014, 5:23 AM
Referenced Files
None
Tokens
"The World Burns" token, awarded by vintprox."Like" token, awarded by Volker_E."Like" token, awarded by xSavitar."Party Time" token, awarded by Qgil."Orange Medal" token, awarded by Aklapper."Like" token, awarded by Liuxinyu970226."Like" token, awarded by Elitre."Like" token, awarded by Reception123."Pterodactyl" token, awarded by Ash_Crow."Like" token, awarded by He7d3r.

Description

Reported upstream

Opportunity: Phabricator is ready to be localized.

Problem: it comes without any translations.

Requirement: Wikimedia needs at least the strings visible to users of a bare bones Phabricator instance with Legalpad.

Possibility: create a Phabricator project at https://translatewiki.net and let our community contribute some translations. If there are translations available somewhere, they could be integrated as well. At some point Phabricator could get the fresh translations directly merged to your code base, just like we do with MediaWiki (probably the most localized piece of software in the World).

Can someone involved in translatewiki.net take this task and help them create the Phabricator project? We had a meeting today with @epriestley, Phabricator's lead developer, and he liked the idea.

Compare: https://www.bugzilla.org/download/#localizations

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

This project is selected for the Developer-Wishlist voting round and will be added to a MediaWiki page very soon. To the subscribers, or proposer of this task: please help modify the task description: add a brief summary (10-12 lines) of the problem that this proposal raises, topics discussed in the comments, and a proposed solution (if there is any yet). Remember to add a header with a title "Description," to your content. Please do so before February 5th, 12:00 pm UTC.

Aklapper changed the task status from Stalled to Open.Mar 15 2017, 7:42 PM

T136071: Get Phabricator i18n ready for translatewiki.net is resolved so Phabricator should in theory be ready for translatewiki.net.

Anybody interested is free to follow https://translatewiki.net/wiki/Translating:New_project and give this a shot.

If there are still any obstacles to fix in the Phabricator code base, please file specific issues as separate tasks blocking this task T225. Thanks!

Anybody interested is free to follow https://translatewiki.net/wiki/Translating:New_project and give this a shot.

The first step is for Phabricator to give translatewiki.net staff push access to their repository.

Anybody interested is free to follow https://translatewiki.net/wiki/Translating:New_project and give this a shot.

The first step is for Phabricator to give translatewiki.net staff push access to their repository.

Is the Phabricator team aware of that?

More generally, I want to work on the French translation, what can I do at that point to help?

Anybody interested is free to follow https://translatewiki.net/wiki/Translating:New_project and give this a shot.

The first step is for Phabricator to give translatewiki.net staff push access to their repository.

I'm not sure why that is necessary. I'd be happy to accept patches. We may be able to set up a branch that accepts pushes but the current deployment process is manual so the translations would need to go through code review or a manual merge.

Is the Phabricator team aware of that?

Requirements/assumptions have been (re)stated (also) in https://secure.phabricator.com/T5267#199218 , for instance the second last paragraph.

@Nemo_bis I don't know where I could check if the push access was granted, nor who to contact to know that, let alone make the access granted if it's not already grandted… Do you have hints about that ?

Is the Phabricator team aware of that?

Requirements/assumptions have been (re)stated (also) in https://secure.phabricator.com/T5267#199218 , for instance the second last paragraph.

I did not say such thing there, I believe you are misinterpreting my words. Phabricator has not agreed to give us push access to their main repository. What they agreed to is either WMF hosting an extension repository for translators, and someone responsible for pushing those upstream, or possibly having extension repository directly in their system.

I am quite sure that if we start providing translations, they will want to use and promote those as the "official" ones, if there aren't obvious quality issues. Frankly, I think it would be best for WMF to set up such repository now, to see if the thing (file formats etc.) even works.

Who's responsibility would it be to start setting up said extension repository?

Great. Can we have one file in the JSON format discussed in the upstream task in the repository? That allows me to start working on translatewiki.net side.

@Nikerabbit: I have given you push privileges so you can add the json file if you would like.

I can also help with translations and anything else that is needed.

I have made a pull request for en.json and qqq.json (but aren't WMF repositories supposed to be on Gerrit?); it just needs to be merged now and then I guess it can be added to translatewiki.net

I have made a pull request for en.json and qqq.json (but aren't WMF repositories supposed to be on Gerrit?); it just needs to be merged now and then I guess it can be added to translatewiki.net

It's mirrored to github, like all repos. It is primarily hosted on Phabricator, see https://phabricator.wikimedia.org/T225#3557552

Yes, @Nikerabbit told me in the meantime, as I wasn't aware that repos could be directly hosted on Phabricator.

Since Arcanist/Differential is used by very few projects for now, could someone that has it installed maybe submit a patch including https://secure.phabricator.com/source/translatewiki/browse/master/projects/;00108900457eda804c9c786dd76ff96620a05195 to the repo? Or if not maybe also create a Gerrit project for it? I'm not exactly sure what the status of integration with Differential is at translatewiki.net, but from what I understood there is no integration yet.

If it is possible for @L10n-bot to skip code review and push directly to the git repository, then there is no need for any further development as we already support git repositories.

I believe upstream made some scripts to convert between the different formats. (I or someone else) should check those that we can generate and process the files in the right formats.

Please note that the JSON files will have to be generated by the WMF: https://secure.phabricator.com/T13013#233220

So someone will need to do that regularly and document the new strings.

I think I can do that. Where should I put the projects/**/*.json files that are generated by the translatewiki export command? I guess in rPHTR Phabricator Translations at the root, just add a folder called /projects/?

The path is configurable on our side, so feel free to use whatever is simplest.

Phabricator strings have been imported to translatewiki.net.

Now I am stuck on exports. It seems L10n-bot is not configured in Phabricator so that it could push translations to the repository and I am unable to change that. I didn't look at Arcanist. @mmodell can you suggest how to proceed?

hmm.. L10n-bot already has permission to push to the rPHTR repo. @Nikerabbit: It seems that @L10n-bot does not have an ssh key configured in phabricator. Can you provide me with a public key that l10n-bot will use to push? I can add the key in phabricator and that should resolve the issue.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCzwR/pw2jmhVCn8aIgmFoq0ya1qHn4ZSweeWxUTwYl8hyUSvW8JqjWV+pq1SCGebTE4dNiITk9oNTuKaPWUAYlr5RgdNrtSWZ/iiF4EgWCrDB2aeKGE8oFkCiGliF3gAohe3Mpr8doGiXber/GYa8NgFyeAST+K1qKEmRiKEseKDVqW7PYGZqslilAbrvB8MWjR66Enzk02FmlCZQzmz7CnZjjgj9dMlisqOM1BaGUqCFkq1YPYpCXoTf/WPLQ7aN685tak4wslMDUfTqx4vChmKVCQoW5/8IUyK3gk8FhXx+RXGaKx+b6gF4YePCI3G9tJh5jIgNQQodQAnLp1lexRjuA/vW5bXHUU12IDDXIlkRS+GR0PE7pXusEcLUiO/kx4zlYUjjc3QueDNvQjh7wPBWEJ/Rr2TttYzLurC4cHv6W5hhN7pA73LZ61G5ph8x3lfZYsWfpw7R3MKh8LbuT+xbBrvNZAHfpeqlhrRUsWMskBKLu5TYcG8Fv1c2TG3Y8ELYq45ABoXRu5ypKWFvdy0p29qwqsu0CWHxqxIQfSTHoycGYTAgztUzFai01CcDMKPorGdHYaKzB/3npUFoEZ3OEPMbhViOy4xFmUKx0qkI3NZvzwmH/D7Xxp2BkRTKPndsXfKhP/0w5p0ngLk9bmY08Y7akdPbTl5Kiw9VC7w== l10n-bot@translatewiki.net

@Nikerabbit ok I've added the key, it should now be possible to push to rPHTR using l10n-bot@translatewiki.net's key.

I made 0c604f3. What would be the next step to see how these translations can be used in our Phabricator? Translation progress can be seen at https://translatewiki.net/w/i.php?title=Special:MessageGroupStats&language=fi&group=phabricator#sortable:3=desc

@Nikerabbit: I guess we need to try deploying to https://phab.wmflabs.org. I think Phabricator will need a bit of configuration to find the translations. I'll work on that

ok I ran the translation generator to convert the json files back into php source, which can be seen at rPHTRab6322077e8e: Generated PHP source from translatewiki json

@mmodell Nice! Are you also working on deploying that on labs, or is something expected from me at this point?

@Nikerabbit: I'm on it. I ran into just one code change that's required to make the languages show up in the UI for selection. You shouldn't have to do anything, I'll have it deployed this evening.

(That change is : rPHABecb8dbb02a88 )

I'd say you can probably close this one as resolved.

Change 404887 had a related patch set uploaded (by 20after4; owner: 20after4):
[operations/puppet@production] Phabricator: Add translations library to phabricator profile

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

Change 404887 merged by Dzahn:
[operations/puppet@production] Phabricator: Add translations library to phabricator profile

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

@mmodell Great. Do we have sufficient automation for all the steps? When/who does the following steps? I can put this up on some documentation page.

  1. Rebuild the English source files (???)
  2. Import those to translatewiki.net (multiple times a day)
  3. Export translations to the repo (twice a week)
  4. Convert JSON to PHP (???)
  5. Deploy to production (???)

Are new languages picked up automatically?

@mmodell Great. Do we have sufficient automation for all the steps? When/who does the following steps? I can put this up on some documentation page.

  1. Rebuild the English source files (???)

Not automated, I'm not sure how often these will need to change.

  1. Import those to translatewiki.net (multiple times a day)
  2. Export translations to the repo (twice a week)
  3. Convert JSON to PHP (???)

I can do this as part of the production deployment process

  1. Deploy to production (???)

This happens approximately every two weeks on Wednesday evenings in the US. (Just after Midnight UTC - so that is actually Thursday AM).

Are new languages picked up automatically?

Currently, no. And unfortunately, Phabricator requires a new class to be created for each language which simply defines the Language Code and the Language Name (for the dropdown in the settings UI).

I created some classes for the languages that already had translations, you can see them here: https://phabricator.wikimedia.org/source/phabricator-translations/browse/wmf%252Fstable/src/locales/

The addition of new language classes looks like something that can be scripted. Language names can be taken from MediaWiki core, the cldr extension, CLDR upstream data or even from https://github.com/wikimedia/language-data – is the locale (country) mandatory or just a practice Phabricator developers adopted? We (in MediaWiki) usually don't add explicit country locales for translations, because translations usually don't change, only the other data like time formats. There are exceptions of course like Portuguese in Portugal and Portuguese in Brazil.

is the locale (country) mandatory

No I'm pretty sure that it's just a text label so we can put anything there that makes sense or omit the parenthesis entirely.

I'm not sure whether I should create separate task for it, but let's see... while translations are being exported at least once per week at phabricator.wikimedia.org, there is no way to fully check these. 😒 I mean I've made whole Russian translation for Phriction, but I cannot see it exported for real test here (there are no Phriction documents to start with).

@vintprox: phabricator.wikimedia.org intentionally does not use Phriction, hence there cannot and will not be a "test case" in phabricator.wikimedia.org.

@vintprox: phabricator.wikimedia.org intentionally does not use Phriction, hence there cannot and will not be a "test case" in phabricator.wikimedia.org.

OK. What solutions exist to export translations from TranslateWiki, let's say, to CSV? Or should I consider localizing Phabricator via PHP? (Hm, now when I think of it, this option seems more legit to me.)

That is a question for a TranslateWiki support channel, I'd say...