Follow-up to #1804688: Download and import interface translations. See comment #99 also.

Problem/Motivation

admin/config/regional/translate/import
has help text 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 Drupal translation server.
and in #1804702-81: Display interface translation status @Sutharsan mentions

Re. rewording: I have avoided using "the community translation server". l.d.o is the default translation server but can be replaced for example in case of distributions which have their own server. And l.d.o calls itself "Drupal Translations" Perhaps better to call it "Drupal translations website" instead of "... server".

There are other pages that also use "Drupal translation server" as well.

We should focus on UI strings and not the use of "translation server" in the comments and code.

Proposed resolution

Use "Drupal translations website" instead of "Drupal translation server" in UI strings and text files (e.g. INSTALL.txt)

Remaining tasks

  • (done) Write patch to make that change.
  • (done) Review patch.

Files that need changing:

  • For installation process:
    • core/INSTALL.txt
    • core/includes/install.core.inc (for installation process)
  • Import UI translations:
    • core/modules/locale/locale.module
    • core/modules/locale/locale.install

User interface changes

Yes, changes to user interface text, this is a ui issue, see above.

Pages that have UI change:

  • installation process
  • admin/config/regional/translate/import
  • admin/config/regional/translate/settings

API changes

No API changes anticipated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

If people don't mind, this small change could be done and not be postponed. It makes a nice novice issue.

tstoeckler’s picture

I'm wondering whether we shouldn't utilize drupal_install_profile_distribution_name() here for distribution-friendliness. I haven't checked recently whether that is actually the case, but in theory a distribution should be able to wipe the term "Drupal" completely from the user interface. I think the pattern that we usually use would be:

t('@Drupal translations website', array('@Drupal' => drupal_install_profile_distribution_name()));

Of course not every distribution will create its own translation server, so this might be misleading as well...

YesCT’s picture

I think in this case it really is the Drupal server. If it's another server they configure... it would have a different name.
I'm not sure at what point another translation server can be specified.
Had the same question as part of looking at the flow charts on #1848490: Import translations automatically during installation

tstoeckler’s picture

Well, e.g. OpenAtrium has its own translation server, so they would definitely want that string to read "OpenAtrium translations website" or whatever. AFAIK Drupal Commons does not have such a thing, so they might want it to read "Drupal translations website" or not, I don't know.

Just to be clear, I personally think the only consistent way to do this is to use drupal_install_profile_distribution_name(). That way we keep to our contract that we give install profile developers: "Put something in 'distribution name' and that will replace the word 'Drupal' everywhere in the UI." But, as mentioned above there might be cases where install profiles actually do want this to say "Drupal". It's not optimal, but I guess in those cases resorting to string overrides or whatever should be OK.

YesCT’s picture

Can we check if the translation server is not equal to the drupal one (that a distribution overrode it) and if so, then do the replace of Drupal?

What would that code look like to check if the server is overridden?

YesCT’s picture

YesCT’s picture

Status: Postponed » Active

trying to really make it active this time.

YesCT’s picture

Issue summary: View changes

added issue number for general help text issue.

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

Issue summary: View changes

Updated issue summary.

Kristen Pol’s picture

I updated the issue summary with some info on files that need to be changing and what pages are affected.

Note: I am assuming that we don't want to change the *internal* (developer) use of the term in comments and code that is not shown to the person installing/configuring Drupal. If we need to change the use of the "translation server" term *everywhere* (including internally-consumed text) then this will be a bigger issue and might not be suitable for a novice.

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

Assigned: Unassigned » Kristen Pol

I made a list of files that need changing. I'll make a patch.

Kristen Pol’s picture

Issue tags: -Novice

Looking in the code for localize.drupal.org, I find that it is not even used directly so localize.drupal.org is only referenced from within the comments and documentation. The translation files are grabbed using the server_pattern setting:

    // An array of server variables that will be substituted into the global
    // $_SERVER array via drupal_override_server_variables(). Used by
    // non-interactive installations only.
    'server' => array(),
    // The server URL where the interface translation files can be downloaded.
    // Tokens in the pattern will be replaced by appropriate values for the
    // required translation file.
    'server_pattern' => 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po',

It seems logical to me to add a 'server_name' to the config (defaulted to "Drupal translations website") and then use that in any t()/st() functions where the translation server is mention.

Thoughts?

attiks’s picture

#10 Adding server_name sounds like a good idea.

Kristen Pol’s picture

I'm working on a patch. Thanks!

Gábor Hojtsy’s picture

Maybe we want to make it "the translations website" then and use the pattern set in config to link, and *that* would be general enough on the UI and flexible enough in terms of the link. However the pattern/url looks like would not lead to anything useful in itself, ha!

Kristen Pol’s picture

Yeah, the "server_pattern" goes off to ftp.drupal.org so that's not useful. What about making a "server_url" config setting and then using the generic "the translations website" text and linking to the "server_url"? As a side note, it is confusing that "server_pattern" is used for the config name... it is not obvious that it is for translations. Maybe I should open an issue?

Gábor Hojtsy’s picture

I think we used to want to have the human facing server URL as well, but then cut it back to only the necessity items. So that is how we ended up with only the download URL and not the nicely formatted real website URL.

Kristen Pol’s picture

So, then, I shouldn't add it because it won't be accepted?

YesCT’s picture

I'm confused..
Kristen, maybe work up a version in a patch so I can see better what is being discussed?

Kristen Pol’s picture

Status: Active » Postponed

I'm waiting until:

#1861934: Rework help text for UI translations and importing po files

lands because there is some overlap in the text.

Kristen Pol’s picture

Assigned: Kristen Pol » Unassigned

Unassigning from me in case the other issue gets resolved quickly and someone wants to do this during the sprint.

Kristen Pol’s picture

Issue tags: +sprint

#1861934: Rework help text for UI translations and importing po files was just committed.... adding sprint tag in case someone wants to work on it :) Otherwise, I'll try to look at it again in a couple days.

Kristen Pol’s picture

Issue summary: View changes

Updated issue summary.

Gábor Hojtsy’s picture

Issue summary: View changes
Status: Postponed » Active

Sounds like this should not be postponed anymore. Keeping on sprint as a simple task for someone (for now) :)

manningpete’s picture

Assigned: Unassigned » manningpete

Working on a patch on this today.

manningpete’s picture

Status: Active » Needs review
FileSize
5.35 KB

The files which needed to be edited are different than those stated in the issue summary due to other changes that have been made in the interim.

The two files which contained non-genericized references to the Drupal translation server, and which I edited were :
/core/modules/locale/locale.module
/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php

None of these files currently contain the "Drupal translation server" language, so I did not make any changes to them:
/core/INSTALL.txt
/core/includes/install.core.inc
/core/modules/locale/locale.install

I verified that the correct language "Drupal translation website" occurs during installation and on the following two pages:

/admin/config/regional/translate/import
/admin/config/regional/translate/settings

manningpete’s picture

Noticed the word "Translation" was capitalized on install page, so lowercased it for consistency.

Gábor Hojtsy’s picture

Status: Needs review » Needs work

@manningpete: thank you! There has been some discussion above from #2 as to whether it would be better to use the distribution name in place of 'Drupal' (which we do elsewhere). Can you look into updating the patch to have that suggestion incorporated? Basically using the pattern outlined in #2. Thanks again!

diego21’s picture

Assigned: manningpete » diego21
Status: Needs work » Needs review
FileSize
6.44 KB

This is my first patch for D8. Hope it helps :D

Thanks!!

Status: Needs review » Needs work

The last submitted patch, 26: change-server-to-website-1861930-26.patch, failed testing.

diego21’s picture

FileSize
6.43 KB

My first interdiff, although it seems the same that the patch file. I must have done something wrong.

diego21’s picture

Status: Needs work » Needs review
mr.york’s picture

I didn't apply the last patch.
I created new patch.

Status: Needs review » Needs work

The last submitted patch, 30: change-server-to-website-1861930-30.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 30: change-server-to-website-1861930-30.patch, failed testing.

Gábor Hojtsy’s picture

While fixing the bug, let's also get back to one of the original goals and replace "server" with "website" in the test too.

mr.york’s picture

Add drupal_get_distribution_name() function in common.inc and replace "server" with "website".

mr.york’s picture

Status: Needs work » Needs review
nonsie’s picture

FileSize
81 KB
143.37 KB
95.22 KB

Here are the screenshots of the modifications in place.

Installer screen:
Installer

Import screen:
Import

Help screen:
Help

nonsie’s picture

FileSize
121.44 KB

Shouldn't the copy be updated during install in requirements fail case as well?
Install requirements problem

YesCT’s picture

Status: Needs review » Needs work

Yes I think we should change it in the requirements also.

nonsie’s picture

Assigned: diego21 » nonsie

Assigning to myself to work on incorporating #39 into this as well.

mr.york’s picture

Status: Needs work » Needs review
FileSize
11.03 KB
3.25 KB

Replaced "server" with "website" in all message.

The last submitted patch, 41: change-server-to-website-1861930-41.patch, failed testing.

Gábor Hojtsy’s picture

The last submitted patch, 41: change-server-to-website-1861930-41.patch, failed testing.

Gábor Hojtsy’s picture

The last submitted patch, 41: change-server-to-website-1861930-41.patch, failed testing.

YesCT’s picture

Assigned: nonsie » Unassigned

tl;dr Thanks everyone! Keep on, we appreciate you.
-----
unassigning this.

It's not a huge deal, but usually, we use the assigned field to mean "I'm working on a patch". If it has been awhile since someone assigned it to themselves, sometimes another person will ask "SoAndSo, are you still working on this?" and then wait a day or two for a response before posting a patch. We do this because sometimes someone assigns it, but then doesn't work on it for whatever reason, like forgot, got busy, etc... in which case it is totally cool after a day to unassign it, or assign it to yourself and post a patch.

But... sometimes it might take the person it is assigned to several hours our days (because they are new, or because they are trying to do something new to them that is challenging), and we want to give them a chance to respond with something like: I'm almost done, patch coming soon.

It can be heart crushing to work for hours and hours on something new and difficult (for some individual) and to come back to an issue to post the result, only to find someone has already done quickly what they have just struggled to do.

The best outcome of that is that one of the persons can do a good review since they understand the problem. But sometimes people get discouraged and just give up contributing.

I hope *everyone* here in this issue knows that their efforts are *much* appreciated and continue to jump in when they feel they can help with something.

I'll look into putting some kind of instructions next to the assigned field so that this community knowledge is more exposed and people can know what it means when an issue is assigned.

Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

@tstoeckler: how do you like this code, especially the newly added function? :) It looks to me it is as good as it can get, given the functions it uses...

YesCT’s picture

since this issue was about replacing translation server with translation website, I think we have done that.

I made another issue to handle any specifics about distributions (since that was pre-existing problem anyway). #2143615: No "Drupal" in UI text -- config_translation, content_translation, locale, language, and translation server parts of installer

(Also removed the summary of the summary... didn't know issues could even have that. seemed to be the same as the beginning of the issue summary anyway. And dont want people updating the summary of the summary instead of the issue summary itself... like I almost just did. See #2142525: Disable the issue summary summary)

YesCT’s picture

Assigned: Unassigned » YesCT

I went to check if this still applied and read it through again.

And ran into some questions.

Why was the function added in #35?
Why not just use drupal_install_profile_distribution_name() ?

Is the @see there because drupal_get_distribution_name() gets its code from there?

Also, the summary on drupal_get_distribution_name()
says: Loads installation profile...
and it's irrelevant that the way it gets the name, or at least should not be first in the summary.
and @return needs a type. https://drupal.org/node/1354#return

And then, it doesn't set a default here... so I'm not sure why we mention the default.

-----
and nit:

+++ b/core/includes/install.core.inc
@@ -1651,8 +1651,9 @@ function install_select_language_form($form, &$form_state, $files = array()) {
-      '#markup' => '<p>Translations will be downloaded from the <a href="http://localize.drupal.org">Drupal Translation website</a>. ' .
-      'If you do not want this, select <em>English</em>.</p>',
+      '#markup' => '<p>' . t('Translations will be downloaded from the <a href="@drupal-localize">@Drupal translation website</a>
+        If you do not want this, select <em>English</em>.', array('@drupal-localize' => 'http://localize.drupal.org',
+        '@Drupal' => drupal_install_profile_distribution_name())) . '</p>',

line wrapping in the t() is weird. but https://drupal.org/coding-standards#linelength didn't give me a definitive answer.

====

patch coming.

YesCT’s picture

Assigned: YesCT » Unassigned
Status: Reviewed & tested by the community » Needs review
FileSize
1.75 KB
10.98 KB

found a missing period also.

Note. Maybe we should strip out the profile stuff from this issue and do it in the other issue.
I'm not sure if anyone has actually tried this with a profile to see if it works.

YesCT’s picture

this is just the website/server change.

replacing Drupal with profile is more tricky and I suggest should be in the other issue.
also complicating that is #1386394: Add back the ability for install profiles (or at least distros) to pre-select a language or modify the language-selection screen

Gábor Hojtsy’s picture

Issue tags: -sprint

@tstoeckler asked for the profile stuff in #2/#4. The drupal_install_profile_distribution_name() code is install only (see https://api.drupal.org/api/drupal/core%21includes%21install.inc/function...), although it may work on a runtime site as well, it is placed in install.inc which is not loaded on a runtime site. So if we want to display the distro name later on, there seems to be no function for that.

Not doing the distro name change would basically ignore #2/#4. It is fine to break this up even more but its already not a big change and mostly text anyway.

I thought this would be easy to do, and its definitely not worth our time debating this and making it hard for ourselves, so removing from our sprint to keep us focused on more important things.

sun’s picture

Instead of addressing #2143615: No "Drupal" in UI text -- config_translation, content_translation, locale, language, and translation server parts of installer later on...

Can't we simply remove the word "Drupal" from all of these instances?

That way, the completely internal detail of what exact translation server/website is used for downloading translations by an installation profile or distro is no longer an issue.

It's unnecessary repetition to begin with: You know that you are installing this product called "Drupal" or "OpenAtrium" or whatnot. It uses a translation server/website. Isn't it obvious that this (whichever) translation server/website belongs to the product?

I assume that the prefix "Drupal" only exists to clarify that the referred to translation server/website is external; i.e., it is not something that exists on your local website.

If that is the intention, then let's simply call it "external translation website"

(or "server", or "service", or perhaps ideally "repository" — not sure whether I agree that "website" is really the appropriate term)

That would be the most elegant solution IMHO.

On top, it would completely eliminate the need for distros/install profiles to replace a whole bunch of strings (+ translate into a dozen of languages), just to conditionally remove/replace the word "Drupal" — conditionally, because that depends on whether l.d.o is used or not.

sun’s picture

Priority: Minor » Normal
Issue tags: +Sunrise Sanity Cruise, +distributions
FileSize
13.17 KB
11.34 KB
10.19 KB

Alright, attached patch implements #55. I've kept the proposed wording of "website", but consistently using "external translation website".

In addition, wording in the very first installer screen is simplified and reduced to the max:

Before:

After:

Despite the changes in this patch, the user interface is apparently still littered with the string "Drupal" all over the place. We can re-purpose #2143615: No "Drupal" in UI text -- config_translation, content_translation, locale, language, and translation server parts of installer to fix/remove all of the other instances.

Also (this has been discussed before in here), the system does not allow installation profiles to supply a custom translation website URL yet. We will need to add a new installation profile .info.yml property to support that. However, that's a separate issue.

Gábor Hojtsy’s picture

Component: locale.module » user interface text
Issue tags: +Needs issue summary update

@sun: Good stuff! I like the proposed changes. Shorter explanations meaning the same thing are useful in general anyway :) Recategorizing as user interface text to hopefully get review from the group shepherding that. Needs issue summary update to summarize the current proposal.

Gábor Hojtsy’s picture

#2091459: Update hook_help for Locale module deals with the same Drupal translation server question, I posted there too.

jhodgdon’s picture

Status: Needs review » Needs work

Coming from the issue in #58...

So, for accessibility, the link text "downloaded" is not good link text. The link needs a title describing where it's going ("downloaded", the link text, doesn't), and then you are back to the problem of what to call the server.

So the patch in #56 is not OK.

Kristen Pol’s picture

I just installed D8 for the first time in awhile and think that it would be better UX if the "Drupal Translation website" link used target="_blank" so that it opens in a new window. I think it is confusing to open in the same window. Can we add this to this patch or does it have to be its own issue? Thanks!

nonsie’s picture

Here's a re-roll of #56 with #59 and #60 included. It also updates the copy for help text implemented in #2091459: Update hook_help for Locale module to reflect the change from "Drupal translation server" to "external translation website"

nonsie’s picture

Status: Needs work » Needs review

Status change

kbasarab’s picture

Status: Needs review » Needs work

Only see one technical issue in #61.

+++ b/core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php
@@ -73,8 +73,9 @@ public function buildForm(array $form, array &$form_state, $install_state = NULL
+        '#markup' => String::format('<p>Translations will be <a title="Download from external translation website" href="@translations-url" target="_blank">downloaded</a> automatically. ¶

Trailing whitespace on this line.

jhodgdon’s picture

nonsie: Also when you make a new patch on an existing issue, please include an "interdiff" file. Thanks!
https://drupal.org/documentation/git/interdiff

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.