Page MenuHomePhabricator

Translation classes repository: Spanish translation available?
Closed, ResolvedPublic

Description

Hello.

I am starting implementing Phabricator into my company and I am amazed by its potential and its ease of use. The problem? Some of our workers don't speak english.

I have read this document: https://secure.phabricator.com/book/phabcontrib/article/internationalization/ but I am sure another person will have translated previously Phabricator to Spanish: Does anyone have the translation classes for this language? I have found deustch translation in fhis Maniphest but not the spanish one.

Having something like this "Translation files" in Drupal Site would be really useful https://localize.drupal.org/download
Thanks a lot.

Event Timeline

There are a few parts to this. The good news is everything, or at least 98% of everything is translatable, the bad news is we don't ship anything other than silly translations like Pirate. Basically if you want to start and share a Spanish (international?) version, we can help you get started. Let me write this up as a wiki doc, so it's more easily found by others.

I've added the base language to libphutil, This should make things a little easier. Your next steps would be, if you've already set up Phabricator, to add a new file with your translations.

Go to src/internationalization/translation/ and add a new file PhabricatorSpanishSpanishTranslation.php. I've pre-made this in P1970 for you, with English copy. Any string in Phabricator can be added and will be picked up automatically, you can browse the translation folder for other examples. Once you've added the file to Phabricator and modified your translations, run arc liberate in your Phabricator root folder to pick up the new class.

Feel free to contribute back to the Paste file in P1970 so others may benefit.

Amazing quickness with your comments. Will start translating most used sentences, and when I reach something useful for others I will upload it.

Thanks.

Not managing to get it working. I see the locale, but when creating the PhabricatorSpanishSpainTranslation (I think you put Spanish instead of Spain by error), and renaming the class that way, translations aren't shown.

It shows this error when the file in /libphutil/src/internationalization/translation contains a sentence which is being translated in the page the user visits:

Attempt to read from undeclared property PhutilTranslator::language.

Problem solved, had to add a:
case "es_ES"
on line 166 of PhutilTranslator.php. Otherwise it fails, and the catch Exception also fails as Language is not initialised.

Thanks! Sorry I missed those, should be cleared up.

Advancing quite a lot, but not being able to translate the sentences which explain the different status changes of a task:

aaa21.jpg (1×1 px, 403 KB)

Do you know where could I translate those?

That file I shared is just for strings with plurality, for all other strings, you can manually add them or run the string extractor. At some point we'll have this all automated, but it's manual right now.

./bin/i18n extract ./src/ extract pretty much everything
./bin/i18n extract ./src/applications/maniphest/ would be for Maniphest.

You can also just manually add stings you want translated as you see them, like for Submit, Close, etc. As long as they are in your string array, we'll pick them up and apply.

Personally for Pirate (English) I usually git-grep for the string, so I know how it shows up in the code.

macbook:phabricator chad$ ff 'closed this task'
src/applications/maniphest/storage/ManiphestTransaction.php:                '%s closed this task as a duplicate by committing %s.',
src/applications/maniphest/storage/ManiphestTransaction.php:                '%s closed this task as a duplicate.',
src/applications/maniphest/storage/ManiphestTransaction.php:                '%s closed this task as "%s" by committing %s.',
src/applications/maniphest/storage/ManiphestTransaction.php:                '%s closed this task as "%s".',
src/applications/maniphest/storage/ManiphestTransaction.php:          '%s closed this task as a duplicate of %s.',
macbook:phabricator chad$ ff 'opened this task'
src/applications/maniphest/storage/ManiphestTransaction.php:              '%s reopened this task as "%s" by committing %s.',
src/applications/maniphest/storage/ManiphestTransaction.php:              '%s reopened this task as "%s".',