Follow up for #1804688: Download and import interface translations

Problem/Motivation

admin/config/regional/translate/import and other pages have help text that was improved when #1804688: Download and import interface translations was committed. This is tricky since it needs to take into consideration many possible configurations and use cases.

Proposed resolution

No suggested new wording yet.

Remaining tasks

  • List the pages that have help text dealing with downloading or importing translation files.
  • Copy the current text examples into comments below.
  • Discuss new wording.

Pages and txt files:

  • admin/config/regional/translate/import
  • core/INSTALL.txt

User interface changes

Yes, changes to user interface text, this is a ui issue, screenshots in #16.

API changes

No API changes anticipated.

Related

#1861930: Use "Drupal translations website" instead of Drupal translation server or Community translation server

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

Status: Postponed » Active
Issue tags: +medium, +needs initial patch
Kristen Pol’s picture

Assigned: Unassigned » Kristen Pol

I'll look at this one.

Kristen Pol’s picture

Issue summary: View changes

Updated issue summary.

Kristen Pol’s picture

Status: Needs review » Active
Issue tags: -Novice +medium, +needs initial patch

Text change from Kristin Tkoch (@K2-hook42) for admin/config/regional/translate/import:

For custom situations where translations need to be manually imported, this page imports the translated strings contained in a Gettext Portable Object (.po) file. 

You can customize .po files offline by editing them in a Gettext translation editor, then importing them here. Templates of original language .po files can downloaded from the Drupal translation server.
 
Importing an individual .po file may be a lengthy process.

I'm checking the code for any other places that we might need to change.

pixelite’s picture

Status: Active » Needs review
FileSize
1.62 KB

I've integrated this help into a patch to change the text on this page. I would recommend keeping it to 2 paragraphs, the first one about importing .po files and the second about how to go about producing .po files for Drupal.

Status: Needs review » Needs work

The last submitted patch, locale-import-help-text-1861934-4.patch, failed testing.

Kristen Pol’s picture

There is also some text in the INSTALL.txt file that needs work or maybe this should just be removed:

2. Optionally, download a translation.

   By default, Drupal is installed in English, and further languages may be
   installed later. If you prefer to install Drupal in another language
   initially:

   - Download a translation file for the correct Drupal version and language
     from the translations website providing your translation files. By default,
     the Drupal translations website provides these files:

     http://localize.drupal.org/translate/downloads

   - Place the file into the dedicated translations directory. By default this
     directory is:

       sites/default/files/translations/

     If the directory doesn't exist, you should create it. Make sure your file
     is named drupal-VERSION.LANGCODE.po (for example, the German
     translation for Drupal 8.0 should be named drupal-8.0.de.po).

   For detailed instructions, visit http://drupal.org/localize
Kristen Pol’s picture

Issue summary: View changes

Updated issue summary.

Kristen Pol’s picture

Issue summary: View changes

Updated issue summary.

Kristen Pol’s picture

I'm making a patch that removes section 2 and adds a small new section after the multisites section.

Kristen Pol’s picture

Status: Needs work » Needs review
Issue tags: -medium, -needs initial patch +Novice
FileSize
5.41 KB

Attached a patch. This is a combination of pixelite's patch and changes to the INSTALL.txt file.

YesCT’s picture

Status: Active » Needs review
Issue tags: -medium, -needs initial patch +Novice
+++ b/core/modules/locale/locale.moduleundefined
@@ -172,7 +172,8 @@ function locale_help($path, $arg) {
+      $output .= '<p>' . t('You can customize .po files offline by editing them in a Gettext translation editor. Templates of original language .po files can downloaded from the <a href="@url">Drupal translation server</a>.', array('@url' => 'http://localize.drupal.org')) . '</p>';

I think we don't use phrases like "You ..."

Hm. Can't find guideline on helptext standard: https://drupal.org/node/632280

Content style doesn't appear to say one way or the other. https://drupal.org/node/338208

So, on reading it again, I think "you" might actually be good here since it's pointing out they can be done by individuals... not just that it can be done.

----

Why does it say "original langauge .po files"?
How about:
"Templates of .po files can be.."

Kristen Pol’s picture

How about changing:

You can customize .po files offline by editing them in a Gettext translation editor

to

Custom .po files can be created by editing them in a Gettext translation editor

?

Getting rid of "original language" seems fine.

YesCT’s picture

heh, I dont think we can create something by editing it. But I know what you mean (I think).

How about:

.po files can be customized by editing them in a Gettext translation editor

but starting a sentence with .po looks weird.

Customize .po files by editing them in a Gettext translation editor.

Kristen Pol’s picture

How about switching the order of the sentences... download them first and edit them afterwards:

Template .po files can downloaded from the <a href="@url">Drupal translation server</a>. These can be customized by editing them in a Gettext translation editor. 
YesCT’s picture

trying out

Template .po files can downloaded from the Drupal translation server, then/and customized by editing them in a Gettext translation editor.

Kristen Pol’s picture

What about the export/import stuff?

Default .po files can be downloaded from the <a href="@url">Drupal translation server</a> or <a href="@export_url">exported from the site</a>. The .po files can be customized by editing them in a Gettext translation editor, and then can be <a href="@import_url">imported into the site</a>.

This could be made into one sentence:

Default .po files can be downloaded from the <a href="@url">Drupal translation server</a> or <a href="@export_url">exported from the site</a>, then customized in a Gettext translation editor, and <a href="@import_url">imported into the site</a>.
YesCT’s picture

I wasn't sure what the import url should be. I think the page where that text shows is the import url, and linking to the current page seemed odd.
I used @export since that same url is named like that also in this function.

YesCT’s picture

FileSize
98.73 KB
265.56 KB

old

Here is the old text on
admin/config/regional/translate/import

<p>Translation files are automatically downloaded and imported when <a href="/d8-patch/admin/config/regional/language">languages</a> are added, or when modules or themes are enabled.</p><p>For situations where translations need to be manually imported, this page imports the translated strings contained in a Gettext Portable Object (.po) file, which can be downloaded from the <a href="http://localize.drupal.org">Drupal translation server</a>. Alternatively, a .po file may need to be imported after offline editing in a Gettext translation editor. Importing an individual .po file may be a lengthy process.</p>

old-text.png

new

Here is the new text on
admin/config/regional/translate/import

<p>Translation files are automatically downloaded and imported when <a href="/d8-patch/admin/config/regional/language">languages</a> are added, or when modules or themes are enabled.</p><p>For custom situations where translations need to be manually imported, this page imports the translated strings contained in a Gettext Portable Object (.po) file. Importing an individual .po file may be a lengthy process.</p><p>Default .po files can be downloaded from the <a href="http://localize.drupal.org">Drupal translation server</a> or <a href="/d8-patch/admin/config/regional/translate/export"> exported from the site</a>, then customized in a Gettext translation editor, and imported here.</p>

po_helptext.png

YesCT’s picture

Issue summary: View changes

Updated issue summary.

Kristen Pol’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works, text makes sense to me, and code looks good. Since I helped with the patch, maybe I can't RTBC? I will anyway ;)

Dries’s picture

Overall, I like this but I have two questions:

1. Is the first sentence of the help text telling me that normally I shouldn't have to use this screen? If so, I think we could be even more explicit about it.

2. As a user, what am I supposed to do with "it may be a lengthy process"? It sounds scary and I'm not sure it is all that useful to know. I'm not sure how to act on that information. I guess it is telling me to be patient?

Kristen Pol’s picture

Thanks for the review, @Dries!

Regarding 1: Yes, they don't normally need to come here unless they have custom strings. Perhaps something like:

This page is only needed when importing custom interface strings. The translated strings must be contained in a Gettext Portable Object (.po) file.

Regarding 2: This text was there before, but, yeah, it does sound scary. The upshot is that it might take awhile to import the strings in. So, "be patient" is good ;) Perhaps something along the lines of:

Importing an individual .po file sometimes takes awhile for it load into the system.

I don't like that wording but something to indicate that you shouldn't stress if the import is taking awhile, i.e. "be patient".

alexpott’s picture

Just wondering... when is someone's situation custom or not? I think For custom situations where translations need to be manually imported, could be simply put like this... If translations need to be manually imported,

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Oh and due to #18 and #20... this is needs work

Kristen Pol’s picture

@alexpott - Do you have any feedback on the wording for item 2 in #19? I was hoping to get feedback before changing it.

Kristen Pol’s picture

Status: Needs work » Needs review
FileSize
1.82 KB
5.48 KB

I've included a patch with some new wording.

penyaskito’s picture

If translations need to be manually imported, this page imports the translated strings contained in a Gettext Portable Object (.po) file. Be patient as it may take awhile for some imported .po files to be processed by the site.
Default .po files can be downloaded from the Drupal translation server or exported from the site, customized in a Gettext translation editor, and imported here.

As a user, I miss the information about custom translations. Maybe this will help or makes things more complex?

This page imports the translated strings contained in a Gettext Portable Object (.po) file. In some situations, translations could need to be manually imported, like if you want to customize a translation and don't update it automatically from the default source. Be patient as it may take awhile for some imported .po files to be processed by the site.
Default .po files can be downloaded from the Drupal translation server or exported from the site, customized in a Gettext translation editor, and imported here.

Sutharsan’s picture

What about this:

This page allows translators to manually import translated strings contained in a Gettext Portable Object (.po) file. Manual import may be used for customized translations or translation of custom modules or themes. To customize translations you can download a translation file from the Drupal translation server or export translations from the site, customize the translations using a Gettext translation editor, and import the result using this page.

Note that importing large .po files may take several minutes.

I've created one paragraph about the use of this page, and about customized strings. The notice about the duration of the import is moved into a separate paragraph, since it is a separate subject.

Kristen Pol’s picture

Status: Needs review » Reviewed & tested by the community

Most excellent! Thanks @Sutharsan for the clear and helpful wording :)

Kristen Pol’s picture

Assigned: Kristen Pol » Unassigned

Unassigning ;)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/INSTALL.txtundefined
@@ -384,6 +365,14 @@ settings, consult http://drupal.org/getting-started/6/install/multi-site
+For detailed instructions, visit http://drupal.org/documentation/multilingual
+
 MORE INFORMATION
 ----------------

+++ b/core/modules/locale/locale.moduleundefined
@@ -166,7 +166,8 @@ function locale_help($path, $arg) {
+      $output .= '<p>' . t('This page allows translators to manually import translated strings contained in a Gettext Portable Object (.po) file. Manual import may be used for customized translations or translation of custom modules or themes. To customize translations you can download a translation file from the <a href="@url">Drupal translation server</a> or <a href="@export">export</a> translations from the site, customize the translations using a Gettext translation editor, and import the result using this page.', array('@url' => 'http://localize.drupal.org', '@export' => url('admin/config/regional/translate/export'))) . '</p>';

I think we need some commas:
Manual import may be used for customized translations, translation of custom modules, or themes.

Kristen Pol’s picture

Thanks for the review!

Hmmm.... not sure I agree. The way this reads:

Manual import may be used for customized translations, translation of custom modules, or themes.

It makes it sound like it can be read as:

  • Manual import may be used for customized translations.
  • Manual import may be used for translation of custom modules.
  • Manual import may be used for themes.

The first two are fine. The last doesn't sound right ;)

What about:

Manual import may be used for customized translations or for the translation of custom modules and themes.

?

Gábor Hojtsy’s picture

Yeah it intended to mean custom modules and themes AFAIS indeed.

Kristen Pol’s picture

YesCT’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal8.translation_download_text_changes.1861934-31.patch, failed testing.

Outi’s picture

Status: Needs work » Needs review

Drupal\user\Tests\UserPasswordResetTest
One-time link is no longer valid.
UserPasswordResetTest.php 81 Drupal\user\Tests\UserPasswordResetTest->testUserPasswordReset()

This looks like unrelated failure.

Outi’s picture

Kristen Pol’s picture

All green... would love a RTBC :)

Sutharsan’s picture

Status: Needs review » Needs work

$output .= '

' . t('Note that importing large .po files may take several minutes.') . '

';
return $output;
I like the suggestion to add a "Please be patient." (#18, #19) to the last sentence.

Outi’s picture

Assigned: Unassigned » Outi

I tried to follow the instructions of the help text to see if they are useful. I have a minor experience of using .po files a long time ago but I think that if I hadn't have any experience I would have been much more unsure. Now everything went more or less ok, besides a couple of errors that are not related to this issue.
____________________

The unrelated errors:

1.) After exporting the translation from the site, I got an error message that is documenter in this issue: #1789090: Warnings when exporting templates: addcslashes() expects parameter 1 to be string

2.) After importing the .po file, I got this warning message (I didn't find an issue for it):

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /drupal/batch?id=6&op=do_nojs&op=do
StatusText: OK
ResponseText: Recoverable fatal error: Argument 2 passed to Drupal\Component\Utility\String::format() must be of the type array, null given, called in /Users/outimunter/Sites/drupal/core/lib/Drupal/Component/Gettext/PoStreamReader.php on line 522 and defined in Drupal\Component\Utility\String::format() (line 89 of /Users/outimunter/Sites/drupal/core/lib/Drupal/Component/Utility/String.php).

The translation was anyway imported.
____________________

Next, I'm going to make the patch asked for in #37.

Kristen Pol’s picture

Thanks @Outi! Would you report issue 2 from #38 once you are done updating this patch? :)

Outi’s picture

I added the "Please be patient" suggested on the #37.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Moving back to RTBC as per fixes since #28.

Gábor Hojtsy’s picture

Discussed in person that "please be patient" is the kind of wording that we worked on removing earlier. The prior sentence explains the situation well. So #31 should be RTBC then.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2faba60 and pushed to 8.x. Thanks!

See #1970068: Remove all please(s) from the views UI about using please in the UI

Outi’s picture

Outi’s picture

Assigned: Outi » Unassigned

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

linked to screenshots in a comment. later can embed right in issue summary when text is finalized.