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:
- 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().
- 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. - 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.
- 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). - 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). - 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).
- 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:
- Apply the patch.
- Turn on the experimental Help Topics module in your site, as well as the module(s) listed in this issue.
- 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. - 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].
- 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.
Comment | File | Size | Author |
---|---|---|---|
#49 | 3095737-49.patch | 16.1 KB | jhodgdon |
#49 | interdiff-47-49.txt | 1.37 KB | jhodgdon |
Comments
Comment #2
jhodgdonComment #3
snehalgaikwad CreditAttribution: snehalgaikwad at QED42 commentedComment #4
snehalgaikwad CreditAttribution: snehalgaikwad at QED42 commentedComment #6
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 commentedpatch is looks good to be me, but i have seen some unused variables are there in some twig file just remove them.
Comment #7
jhodgdonThere is a test failure:
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.
Comment #8
snehalgaikwad CreditAttribution: snehalgaikwad at QED42 commentedHere adding an updated patch with fixes.
Comment #10
jhodgdonThe 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?
Comment #11
snehalgaikwad CreditAttribution: snehalgaikwad at QED42 commentedComment #13
jhodgdonSame error is still coming up now in core.translations. I'll wait to review the patch until the tests pass.
Comment #14
snehalgaikwad CreditAttribution: snehalgaikwad at QED42 commentedFixed failed test cases in this patch.
Comment #16
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedComment #17
jhodgdonThanks 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...
Comment #18
jhodgdonHere 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.
Comment #19
jhodgdonOK, here's the completed patch, with the last 2 topics updated.
Comment #21
jhodgdonHm, 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. ???
Comment #22
jhodgdonI found the test fail; ran the test locally and found another test fail too. So, here's a new patch and interdiff.
Comment #23
jhodgdonAdding tag, since I worked on this issue at MidCamp virtual contribution day.
Comment #25
naresh_bavaskarI have reviewed the patch #22, IMO I found some minor issues.
Thanks!
Comment #26
jhodgdonI do not agree with either of those suggested changes, but thanks for taking a look!
Comment #27
DeepaliJ CreditAttribution: DeepaliJ at QED42 for Drupal India Association commentedComment #28
DeepaliJ CreditAttribution: DeepaliJ at QED42 for Drupal India Association commented- 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.
Comment #29
DeepaliJ CreditAttribution: DeepaliJ at QED42 for Drupal India Association commentedComment #30
catchNot at all sure about referring to configuration entities as 'list configuration' - it sounds like we're configuring lists. Why not use 'configuration entities'?
Comment #31
jhodgdonHm... 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:
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.
Comment #32
jhodgdonActually 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.
Comment #33
Amber Himes MatzI 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.
Comment #34
jhodgdonWe 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.
Comment #36
jhodgdonThis should not really be a Novice issue unless we want to recruit a group of novice contributors to follow the review instructions later.
Comment #37
jhodgdonConfig module topics are done! This can be worked on now.
Comment #38
jhodgdonHere'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.
Comment #40
jhodgdonExciting!! The new HTML syntax tests found a problem! Here's a new patch.
Comment #41
daffie CreditAttribution: daffie commentedAs always: feel free to disagree
Can we change the order of these two lines. For me, after content comes config and interface as last.
For me the order is content, then config and as last interface. But that is just me.
Comment #42
jhodgdonThanks 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!
Comment #43
daffie CreditAttribution: daffie commentedI 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.
Comment #44
jhodgdonStrange... This is what I am seeing on my dev site.
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.
Comment #45
daffie CreditAttribution: daffie commented@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:
Comment #46
jhodgdonSee step 2 of the review instructions:
Anyway, thanks for the review! Those are all excellent points. I'll try to make a new patch in the next day or two.
Comment #47
jhodgdonThanks 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.
Comment #48
daffie CreditAttribution: daffie commentedAll 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.
Comment #49
jhodgdonI 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?
Comment #50
daffie CreditAttribution: daffie commentedI followed the review process as described in the IS.
All changes look good to me.
For me it is RTBC.
Comment #52
catchI 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?
Committed/pushed to 9.2.x, thanks!
Comment #53
jhodgdonGreat idea! Here's a followup child issue:
#3202300: Can we generate list of detection methods automatically in help topic?