Problem/Motivation

#3041924: [META] Convert hook_help() module overview text to topics for the internationalization modules: config_translation, content_translation, locale, language module(s).

Proposed resolution

Take the information that is currently in the hook_help module overview section for the module(s), and make sure the information is in one or more Twig help topic files. Steps:

  1. Find the hook_help() implementation function in the core/modules/MODULENAME/MODULENAME.module file(s). For example, for the core Contact module, the module files is core/modules/contact/contact.module, and the function is called contact_help().
  2. Locate the module overview portion of this function. This is located just after some lines that look something like this:
      switch ($route_name) {
        case 'help.page.contact':
    

    And ends either at the end of the function, or where you find another case 'something': line.

  3. We want to end up with one or more topics about the tasks that you can do with this module, and possibly a section header topic. So, read the help and figure out a good way to logically divide it up into tasks and sections. See Standards for Help Topics for information on how to do this.
  4. See if some of these tasks are already documented in existing topics. Currently, all topics are in core/modules/help_topics/help_topics. Note that to see existing topics, you will need to enable the experimental Help Topics module (available in the latest dev versions of Drupal 8.x).
  5. For each task or section topic that needs to be written, make a new Twig topic file (see Standards for Help Topics) in core/modules/help_topics/help_topics. You will need to choose the appropriate module prefix for the file name -- the module that is required for the functionality. Alternatively, if the information spans several modules or if the information should be visible before the module is installed, you can use the "core" file name prefix. For instance, it might be useful to know that to get a certain functionality, you need to turn on a certain module (so that would be in the core prefix), but then the details of how to use it should only be visible once that module is turned on (so that would be in the module prefix).
  6. File names must be MODULENAME.TOPICNAME.html.twig -- for example, in the Action module, you could create a topic about managing actions with filename action.managing.html.twig (and "MODULENAME" can be "core" as discussed above).
  7. Make a patch file that adds/updates the Twig templates. The patch should not remove the text from the hook_help() implementation (that will be done separately).

Remaining tasks

a) Make a patch (see Proposed Resolution section).

b) Review the patch:

  1. Apply the patch.
  2. Turn on the experimental Help Topics module in your site, as well as the module(s) listed in this issue.
  3. Visit the page for each topic that is created or modified in this patch. The topics are files in the patch ending in .html.twig. If you find a file, such as core/modules/help_topics/help_topics/action.configuring.html.twig, you can view the topic at the URL admin/help/topic/action.configuring within your site.
  4. Review the topic text that you can see on the page, making sure of the following aspects:
    • The text is written in clear, simple, straightforward language
    • No grammar/punctuation errors
    • Valid HTML -- you can use http://validator.w3.org/ to check
    • Links within the text work
    • Instructions for tasks work
    • Adheres to Standards for Help Topics [for some aspects, you will need to look at the Twig file rather than the topic page].
  5. Read the old "module overview" topic(s) for the module(s), at admin/help/MODULENAME. Verify that all the tasks described in these overview pages are covered in the topics you reviewed.

User interface changes

Help topics will be added to cover tasks currently covered in modules' hook_help() implementations.

API changes

None.

Data model changes

None.

Release notes snippet

None.

CommentFileSizeAuthor
#49 3095737-49.patch16.1 KBjhodgdon
#49 interdiff-47-49.txt1.37 KBjhodgdon
#47 interdiff-42-47.txt10.87 KBjhodgdon
#47 3095737-47.patch16.14 KBjhodgdon
#44 relatedtopics.png37.92 KBjhodgdon
#43 help.png155.89 KBdaffie
#43 core.translations.png160.12 KBdaffie
#42 3095737-42.patch15.26 KBjhodgdon
#42 interdiff-40-42.txt3.4 KBjhodgdon
#40 3095737-40.patch14.82 KBjhodgdon
#40 interdiff-38-40.txt949 bytesjhodgdon
#38 3095737-38.patch14.81 KBjhodgdon
#38 interdiff-22-38.txt2.89 KBjhodgdon
#28 Link under Help topics.png58.82 KBDeepaliJ
#28 Detail page.png153.92 KBDeepaliJ
#25 core.translations.png232.9 KBnaresh_bavaskar
#22 3095737-22.patch14.76 KBjhodgdon
#22 interdiff.txt1.71 KBjhodgdon
#19 3095737-19.patch14.83 KBjhodgdon
#18 3095737-18.patch14.58 KBjhodgdon
#16 interdiff_14_16.txt4.49 KBanmolgoyal74
#16 translations_help_topics-3095737-16.patch17.24 KBanmolgoyal74
#14 interdiff_11-14.txt4.25 KBsnehalgaikwad
#14 translations_help_topics-3095737-14.patch17.32 KBsnehalgaikwad
#11 interdiff_08-11.txt14.42 KBsnehalgaikwad
#11 translations_help_topics-3095737-11.patch17.33 KBsnehalgaikwad
#8 interdiff_04-08.txt37.63 KBsnehalgaikwad
#8 translations_help_topics-3095737-08.patch16.05 KBsnehalgaikwad
#4 translations_help_topics-3095737-04.patch27.89 KBsnehalgaikwad
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon created an issue. See original summary.

jhodgdon’s picture

Version: 8.8.x-dev » 8.9.x-dev
snehalgaikwad’s picture

Assigned: Unassigned » snehalgaikwad
snehalgaikwad’s picture

Assigned: snehalgaikwad » Unassigned
Status: Active » Needs review
FileSize
27.89 KB

Status: Needs review » Needs work

The last submitted patch, 4: translations_help_topics-3095737-04.patch, failed testing. View results

Hardik_Patel_12’s picture

patch is looks good to be me, but i have seen some unused variables are there in some twig file just remove them.

jhodgdon’s picture

There is a test failure:

Topic locale.translate_strings is either top-level or related to at least one other top-level topic

That means that the topic locale.translate_strings either needs to have top_level annotation, or "related" annotation that relates it to a different topic that is top_level.

Also please read the Standards for Help Topics. This patch is not following the instructions and standards. It looks like you just copied the text from the module overviews in hook_help, but what we want is the help separated into Overview and Task topics, which have specific headings in them (such as not "About" and "Uses" as in this patch. The patch needs a complete rewrite. The instructions are in the issue summary here.

snehalgaikwad’s picture

Status: Needs work » Needs review
FileSize
16.05 KB
37.63 KB

Here adding an updated patch with fixes.

Status: Needs review » Needs work

The last submitted patch, 8: translations_help_topics-3095737-08.patch, failed testing. View results

jhodgdon’s picture

The error message in the test fail is:

Topic locale.overview has the correct H2-H6 heading hierarchy

This is because this topic has h2 headings (good), followed by h4 headings, which are inside of the OL list of steps. That is not very good HTML practice.

So... probably this should be separated into 3 different task topics, rather than trying to describe 3 different tasks in one topic?

snehalgaikwad’s picture

Status: Needs work » Needs review
FileSize
17.33 KB
14.42 KB

Status: Needs review » Needs work

The last submitted patch, 11: translations_help_topics-3095737-11.patch, failed testing. View results

jhodgdon’s picture

Same error is still coming up now in core.translations. I'll wait to review the patch until the tests pass.

snehalgaikwad’s picture

Status: Needs work » Needs review
FileSize
17.32 KB
4.25 KB

Fixed failed test cases in this patch.

Status: Needs review » Needs work

The last submitted patch, 14: translations_help_topics-3095737-14.patch, failed testing. View results

anmolgoyal74’s picture

Status: Needs work » Needs review
FileSize
17.24 KB
4.49 KB
jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the patches!

I took a quick look... A few thoughts:

a) The text in all the topics needs a lot of proofreading attention. If English writing is not your strong point, you might either consider working on a different issue, or maybe view the topic on a test site and copy/paste the text into a word processor that has grammar/spelling checking. (Most commercial ones do, and it is also an optional extension download for Open/Libre Office Writer too.)

b) Topic titles: Most of our current help has titles that start with an -ing verb, so please follow that pattern. Such as "Adding a language" not "Add language". Also the titles should be in sentence case, so for example, "Translating Individual Interface Strings" should be "Translating individual interface strings".

c) Don't repeat information that is in other topics. For example, in the Language Switcher Block topic, it sort of tries to explain how to place a block. But we already have a topic on that. So instead, it should say something like "Follow the instructions in (link to the placing a block topic) to place the Language Switcher block".

d) Headings in the top-level topic: check Standards for Help Topics for what the headings should be for a Section topic. Should not have one starting with "How".

e) Text that you see in the Drupal administrative interface should be in italics (EM tag), not bold (STRONG tag). I saw this problem in language.block_visibility (may be present in other topics too).

f) Some topics need more explanation. For example "Language detection and selection" topic doesn't really tell me at all what language detection and selection means, or what the different options do. This information can be in a "What is" section before Steps, or incorporated into the Goal section.

I didn't read through all the topics in detail...

jhodgdon’s picture

Assigned: Unassigned » jhodgdon
FileSize
14.58 KB

Here is a new patch. I did not make an interdiff for this patch, because pretty much every line in the patch has changed, so it wasn't useful.

What I did (see also previous comments):
- Edited the topic text, titles, and headings for clarity, good English, and compliance with the Help Topic Standards https://www.drupal.org/docs/develop/documenting-your-project/help-topic-...
- Replaced <i> tags with <em> tags throughout.
- On the top-level topic, changed the title to "Working with languages and translations", since the topics are useful for single-language sites too (if the language is not English) (the previous title had "multilingual" in it, which seemed not the best)
- Added a "What?" section about what types of text can be translated, and an Overview section, to the top-level topic. Took out the sections on individual modules.
- Took out the topic about the language switcher block. We already have a topic on placing blocks, so we don't need this. Instead I mentioned the existence of this block in the top-level topic and linked to the block place topic as Related.
- Took out the block visibility topic -- we already have a configuring blocks topic, so linked to that instead, and added a note to the top-level topic.
- Added a bunch of additional information to the detection & selection topic

I got through all of the topics except two: translating configuration and translating user interface. Those still need to be fixed up. Uploading patch so it doesn't get lost, but leaving at Needs Work. I'll get back to this tomorrow.

jhodgdon’s picture

Status: Needs review » Needs work

The last submitted patch, 19: 3095737-19.patch, failed testing. View results

jhodgdon’s picture

Hm, one of the topics is failing the test (language.detect.html.twig) saying not all the text is translated, but I cannot see what text is untranslated. ???

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
1.71 KB
14.76 KB

I found the test fail; ran the test locally and found another test fail too. So, here's a new patch and interdiff.

jhodgdon’s picture

Issue tags: +midcamp2020

Adding tag, since I worked on this issue at MidCamp virtual contribution day.

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now 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.

naresh_bavaskar’s picture

FileSize
232.9 KB

I have reviewed the patch #22, IMO I found some minor issues.
Thanks!

jhodgdon’s picture

I do not agree with either of those suggested changes, but thanks for taking a look!

DeepaliJ’s picture

Assigned: Unassigned » DeepaliJ
DeepaliJ’s picture

FileSize
153.92 KB
58.82 KB

- Patch #22 applied successfully.
- Enabled the Experimental Help module as well as the module(s) listed in this issue.
- I can see the 'Working with languages and translations' topic under the Help topics. Links within the text works.
- Gone through all the topics listed in the patch. All are working fine.
- HTML is valid. Checked with http://validator.w3.org/
- No grammatical issue found

Looks good to me.
Attaching screenshots for the reference.

DeepaliJ’s picture

Assigned: DeepaliJ » Unassigned
Status: Needs review » Reviewed & tested by the community
catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/help_topics/help_topics/config_translation.overview.html.twig
@@ -0,0 +1,18 @@
+<h2>{% trans %}Goal{% endtrans %}</h2>
+<p>{% trans %}Translate your site configuration; you must have at least one non-English language configured.{% endtrans %}</p>
+<h2>{% trans %}What is the difference between simple and list configuration?{% endtrans %}</h2>
+<p>{% trans %}List configuration is configuration that your site can have multiple instances of, such as views and date formats. Simple configuration has only one instance on your site, such as the <em>System information</em> settings. Most items of both list and simple configuration include one or more translatable text fields.{% endtrans %}</p>
+<h2>{% trans %}Steps{% endtrans %}</h2>

Not at all sure about referring to configuration entities as 'list configuration' - it sounds like we're configuring lists. Why not use 'configuration entities'?

jhodgdon’s picture

Issue tags: +Usability

Hm... I don't think we use the term "configuration entities" in the UI anywhere... But we can think about this a bit.... Here's what the help topic currently says, in the steps section:

<li>{% trans %}Find the type of configuration you want to translate in the list, and click <em>List</em> for list configuration, or <em>Translate</em> for simple configuration.{% endtrans %}</li>
+  <li>{% trans %}For list configuration, find the specific item you want to translate on the next page, and click <em>Translate</em>.{% endtrans %}</li>

So, the UI is already distinguishing between simple configuration items that you can translate directly (the term "simple" is also used in the Config Manager module on the single import/export forms), and items that have to be "listed". Given that the term "configuration entity" is I am pretty sure never mentioned in the UI, and the word "list" is, I think calling it "list configuration" or "listed configuration" or something similar makes sense? But let's see if we can get a Usability team opinion.

jhodgdon’s picture

Status: Needs work » Postponed
Related issues: +#3095734: Convert config module hook_help() to topic(s)

Actually I think we should add information about simple vs. whatever we call it on #3095734: Convert config module hook_help() to topic(s) and postpone this issue until we do that.

Amber Himes Matz’s picture

I am also confused by the usage of the term "list configuration" to refer to configuration entities. I get that it is a term for developers and isn't apparently used in the translation UI, while the word "list" is. I would suggest in the help topic that we say something like, "For configuration entities that list multiple items, find the item you want to translate and select Translate." This simultaneously refers to the correct technical term and defines it as [edit] something that will list multiple potential items to translate, which is the relevant point.

jhodgdon’s picture

We should discuss this on the Config issue instead, because it has to do with configuration, and that's where we're defining terms and giving background. I'll go over there.

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

jhodgdon’s picture

Issue tags: -Novice

This should not really be a Novice issue unless we want to recruit a group of novice contributors to follow the review instructions later.

jhodgdon’s picture

Status: Postponed » Needs work

Config module topics are done! This can be worked on now.

jhodgdon’s picture

Status: Needs work » Needs review
Issue tags: -Usability
FileSize
2.89 KB
14.81 KB

Here's a new patch. The only thing that was identified as needing attention since the last patch was the question of how to refer to configuration entities and configuration items, which was resolved on #3095734: Convert config module hook_help() to topic(s). So, the configuration translation topic in this patch was overhauled to reference that topic, and use its terminology.

Status: Needs review » Needs work

The last submitted patch, 38: 3095737-38.patch, failed testing. View results

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
949 bytes
14.82 KB

Exciting!! The new HTML syntax tests found a problem! Here's a new patch.

daffie’s picture

Status: Needs review » Needs work

As always: feel free to disagree

  1. +++ b/core/modules/help_topics/help_topics/core.translations.html.twig
    @@ -0,0 +1,16 @@
    +  <li>{% trans %}User interface text that is provided by the core software, your install profile, themes, and modules is provided in English, but can be translated into other languages. You can also download translations that community-members have provided.{% endtrans %}</li>
    +  <li>{% trans %}Many configuration items also include text that can be translated. Default configuration provided by your site's software is provided in English; you can also download community-provided translations.{% endtrans %}</li>
    

    Can we change the order of these two lines. For me, after content comes config and interface as last.

  2. +++ b/core/modules/help_topics/help_topics/core.translations.html.twig
    @@ -0,0 +1,16 @@
    +<p>{% trans %}The core Language module lets you add new languages to your site, provides the <em>Language switcher</em> block, and provides the ability to configure block visibility by language; the block and block visibility settings are only available if you have multiple languages configured. The core Content Translation, Interface Translation, and Configuration Translation modules let you translate content, the built-in user interface, and configuration, respectively. The core Update Manager module manages automatic downloads of community-provided translations. See the related topics listed below for specific tasks.{% endtrans %}</p>
    

    For me the order is content, then config and as last interface. But that is just me.

  3. Could we add "language.add" and "language.detect" as related topics on the core.translations page.
  4. How are all the non top-level pages linked to from a top-level page? How do I get to those pages?
jhodgdon’s picture

Status: Needs work » Needs review
FileSize
3.4 KB
15.26 KB

Thanks for the review!

Regarding points 1 and 2, I think you are right that most users will be downloading translations of user interface text, and actively translating their site content first, and second configuration. So I have updated the order as you suggested. I also added links to our topics about content and configuration (which did not exist when this patch was first created).

Regarding points 3 and 4: We don't want to have very many top-level topics in general. The one top-level topic in this patch is core.translations, whose title is "Working with languages and translations".

Also, the "related" section is automatically bi-directional. So if topic A lists topic B as related, you will see both topic A in topic B's Related Topics section, and topic B in topic A's Related Topics section, when you view the topic on the site. Every topic in the patch lists core.translations in its related section, so I think we're good as far as making sure you can get to all the topics. (Besides that, one of the automated tests in Help Topics verifies that every topic we have is either top-level or listed as related to a top-level topic, so this idea is actually enforced by our tests.)

Anyway, here's a new patch -- see what you think!

daffie’s picture

Status: Needs review » Needs work
FileSize
160.12 KB
155.89 KB

I am probably doing something wrong. I have installed the patch and run "Clear all caches". When I then open the page "admin/help" I can see the link to the new page "Working with languages and translations". Only when I am on that page I do not see any link to the new page "Adding a language". I have added 2 screenshots as "proof". The same for the other non top level pages.

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
37.92 KB

Strange... This is what I am seeing on my dev site.
Related topics list on main language topic

Go to the Extend page and make sure you have all 4 modules listed in the Multilingual section installed. I suspect that is the problem. The top-level page is in the "core" namespace, so you will see that topic even without the multilingual modules installed. But the others will only be visible if their corresponding modules are installed. For example, if Config Translation is not installed, the topics whose IDs (and filenames) start with config_translation will not be available.

daffie’s picture

Status: Needs review » Needs work

@jhodgdon: Thank you for the suggestion to install the 4 multilingual modules. After that I could do the review. I am just used to install a patch and do a review.

The patch looks good. Some minor remarks:

  1. On the page "Adding a language" we have the sentence: "If you have the core Update Manager module installed and translations are available for your language, also wait for translations to be downloaded.". Could we replace "also" with "then".
  2. On the page "Configuring language detection and selection" we have the sentence: "If you have more than one language on your site, you can configure the detection methods that are used and the order they are evaluated, for both user interface text and content text; most sites use the same detection methods for both types of text." On the page "Working with languages and translations" we have 3 types of texts that cab be translated. In "for both user interface text and content text" we have only 2 types.
  3. On the page "Configuring language detection and selection" we have 5 language detection methods and on the page "admin/config/regional/language/detection" we have 6 methods.
  4. On the page "Configuring content language settings and translation" we have the sentence: "Configure language and translation settings for various types of content; you must have at least two languages configured." The sentence does not read so well.
  5. On the page "Configuring content language settings and translation" we have the sentence: "Check the boxes for the types of content that you want to configure." Could we add to the sentence: "how they should be translated".
  6. On the page "Translating configuration" does the first link to "Adding a language" not work.
jhodgdon’s picture

See step 2 of the review instructions:

Turn on the experimental Help Topics module in your site, as well as the module(s) listed in this issue.

Anyway, thanks for the review! Those are all excellent points. I'll try to make a new patch in the next day or two.

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
16.14 KB
10.87 KB

Thanks again for the very helpful review! I think I have addressed all of your points, and in the process, rewrote text so it is hopefully clearer.

daffie’s picture

Status: Needs review » Needs work

All the changes made by @jhodgdon look good to me.
All my points are addressed with the exception of #54.1.
Therefore back to needs work.
The rest of the patch is for me RTBC.

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
1.37 KB
16.1 KB

I did make a change there, but I guess you still didn't like the change.... Reading it again, I think you're right that some notion of before/after is good. How about this?

daffie’s picture

Status: Needs review » Reviewed & tested by the community

I followed the review process as described in the IS.
All changes look good to me.
For me it is RTBC.

  • catch committed e9cb6ce on 9.2.x
    Issue #3095737 by jhodgdon, snehalgaikwad, anmolgoyal74, daffie,...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

I kind of feel it would make sense to generate this list dynamically based on the language negotiation methods available (assuming they have descriptions that would work in this context). Could we open a follow-up to discuss that?

+<p>{% trans %}The available detection methods depend on what modules you have installed. Some of the most commonly-used language detection methods are:{% endtrans %}</p>
+<dl>
+  <dt>{% trans %}URL{% endtrans %}</dt>
+  <dd>{% trans %}Use the language from the URL, which can either be in a path prefix like <em>example.com/fr/page_path</em> for French (fr) language, or in a domain like <em>fr.example.com/page_path</em>.{% endtrans %}</dd>
+  <dt>{% trans %}User{% endtrans %}</dt>
+  <dd>{% trans %}For logged in users, use the language they have set in their profiles.{% endtrans %}</dd>
+  <dt>{% trans %}Browser{% endtrans %}</dt>
+  <dd>{% trans %}Use the language preferences from the user's browser.{% endtrans %}</dd>
+  <dt>{% trans %}Selected language{% endtrans %}</dt>
+  <dd>{% trans %}Use the language most recently selected from a <em>Language switcher</em> block.{% endtrans %}</dd>
+  <dt>{% trans %}Session{% endtrans %}</dt>
+  <dd>{% trans %}Use the language from a session parameter or a request parameter; for example, adding <em>?language=fr</em> to the end of the URL.{% endtrans %}</dd>
+</dl>

Committed/pushed to 9.2.x, thanks!

jhodgdon’s picture

Status: Fixed » Closed (fixed)

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