Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Replace JHELP_ String with hardcoded ref-key #35429

Merged
merged 10 commits into from
Sep 23, 2021

Conversation

Bakual
Copy link
Contributor

@Bakual Bakual commented Aug 30, 2021

Pull Request for Issue #35416 can partly replace #35418.

Summary of Changes

This PR removes some of the JHELP_ language strings and instead directly uses the reference key in the call.
Since the language strings aren't supposed to be adjusted by translators, we can as well just hardcode them and thus reduce complexity and error possibilities.

Those language strings imho come from a time where our documentation server couldn't handle translations and some language packs would provide their own servers.

I haven't replaced all strings yet. Eg Banners, Contacts, Fields, Smart Search should work.

Additional Notes

I saw that components like com_categories or com_config would need a different approach. I'm not even sure they currently work for 3rd party (help buttons show up for my component but I haven't defined one nor have I strings that would fit). So that part needs a refactor anyway. Ideas welcome.
For com_config, there is already a part which takes the key from the config, that could work well for core.
For com_categories, we likely would have to invent something new, currently it puts together a string in the hopes that the extension has it defined.

Testing Instructions

Make sure help screens still work.

Actual result BEFORE applying this Pull Request

Strings are translated. Help screens work.

Expected result AFTER applying this Pull Request

Strings removed
No change in how help screens appear.

Documentation Changes Required

Not sure if that is documented.

@HLeithner
Copy link
Member

It's the wrong way in my opinion, who knows that the next documentation system is and what it need for each language.

@Bakual
Copy link
Contributor Author

Bakual commented Aug 30, 2021

In case it's not clear: I will expand this PR with the other strings, but run out of time for now.

@infograf768
Copy link
Member

@Bakual
This can't work as is as the strings are also used to get the urls in joomla40/administrator/index.php?option=com_admin&view=help

I tested the help for the strings you deleted and I get 404s as the link is of type https://help.joomla.org/proxy?keyref=Help40:JHELP_CONTENT_ARTICLE_MANAGER&lang=en

Screen Shot 2021-08-31 at 07 15 08

@Bakual
Copy link
Contributor Author

Bakual commented Aug 31, 2021

Hmm, I wasn't aware of that view.
It looks like everything is defined in a JSON file generated by https://github.com/joomla/joomla-cms/blob/4.0-dev/build/helpTOC.php which apparently creates that file.
The whole thing looks a bit hacky to me and likely also break if we just move the strings to a different file. So that needs to be taken care of anyway.

@Quy Quy added the PR-4.0-dev label Aug 31, 2021
@Bakual Bakual changed the title [4.0] Replace JHELP_ String with hardcoded ref-key [4.0] [WIP] Replace JHELP_ String with hardcoded ref-key Aug 31, 2021
@Bakual
Copy link
Contributor Author

Bakual commented Aug 31, 2021

I've adjusted the helpTOC.php file so it doesn't reverse lookup the JHELP_ strings, looking for the doc page titles to get the KEY for the COM_ADMIN_HELP_ strings which are used for the translated link texts.

That required to change the COM_ADMIN_HELP_ keys so they match the doc pages.
The GitHub diff view looks worse than it is for com_admin.ini, the translated values didn't change, only the keys. So in Crowdin Translation Memory should kick in and help the TTs.

This PR still needs some work, so I've added [WIP] to the title. But I wanted to let you see which direction I would go.

@Bakual Bakual changed the title [4.0] [WIP] Replace JHELP_ String with hardcoded ref-key [4.0] Replace JHELP_ String with hardcoded ref-key Sep 3, 2021
@Bakual
Copy link
Contributor Author

Bakual commented Sep 3, 2021

It's now ready for tests. All JHELP_ strings are removed and instead replaced with direct ref_key within code.
The only ones left are the ones for com_categories and com_config. I can see ways to get rid of those as well, but I want to do that in a separate PR if this one gets accepted.

@Bakual
Copy link
Contributor Author

Bakual commented Sep 4, 2021

For com_config see #35479

@conconnl
Copy link
Member

conconnl commented Sep 7, 2021

I have tested this item ✅ successfully on 0e44a36

I have clicked on as much links I could within the help screen as well within various other parts of the system by using the help button.
Before I did this I checked if various files on the server included the changes.
All seem to work.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35429.

@MartijnMaandag
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on 0e44a36

I did test and clicked several items. They work.

But: I started to go to "Help", "Joomla Help" Only the first three items ( Start here, License and Glossery) do work.
Als the others are wrong URLs examples:
https://help.joomla.org/proxy?keyref=Help40:COMPONENTS_BANNERS_CLIENTS_EDIT&lang=nl
https://help.joomla.org/proxy?keyref=Help40:Banners:_New_or_Edit_Client&lang=nl
https://help.joomla.org/proxy?keyref=Help40:COMPONENTS_BANNERS_CLIENTS&lang=nl
https://help.joomla.org/proxy?keyref=Help40:Banners:_Clients&lang=nl
Capital letters are the wrong new ones, the others are what they should be.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35429.

@Bakual
Copy link
Contributor Author

Bakual commented Sep 8, 2021

@MartijnMaandag Hmm, that is strange. Did you test in the english language or with nl-NL? I'll try to reproduce it then and see why this happens.

@brianteeman
Copy link
Contributor

Please remove the unrelated files
templates/cassiopeia/js/template.min.js.gz
images/te-voi-inalta.mp3
images/fernando-1.mp3
images/03-sweet-fellowship.mp3

@Bakual
Copy link
Contributor Author

Bakual commented Sep 8, 2021

@brianteeman Oops, they sneaked in. Thanks for the sharp eyes!

@brianteeman
Copy link
Contributor

looks like you missed one

<help key="JHELP_MENUS_MENU_ITEM_MENU_ITEM_CONTAINER"/>

@MartijnMaandag
Copy link
Contributor

@Bakual Yes I did also test the Admin in English. (as far as I remember if the language-helspscreen is not available, the English language helpscreen appears)
When i apply the patch the difference between the link to the helpscreen in the article edit and the list is (first is real screen, second is the list in Help - JoomlaHelp):
https://help.joomla.org/proxy?keyref=Help40:Articles:_Edit&lang=en
https://help.joomla.org/proxy?keyref=Help40:CONTENT_ARTICLE_MANAGER_EDIT&lang=en
When I revert the patch I do get:
https://help.joomla.org/proxy?keyref=Help40:Articles:_Edit&lang=en
https://help.joomla.org/proxy?keyref=Help40:Articles:_Edit&lang=en
I am testing on localhost Joomla 4.0.2 and Patchtester 4.1.0

@brianteeman
Copy link
Contributor

I cannot replicate this. Maybe there is something missing in the instructions how to replicate?

@MartijnMaandag
Copy link
Contributor

JoomlaHelp

@MartijnMaandag
Copy link
Contributor

I did even make a clean install of Joomla 4.0.2 and Patchtester.
No other extensions installed (even no languages).

@brianteeman
Copy link
Contributor

image

@infograf768
Copy link
Member

looks like you missed one
joomla-cms/administrator/components/com_menus/forms/itemadmin_container.xml
Line 79 in 616d643

The ini string for this one does not exist.

@infograf768
Copy link
Member

infograf768 commented Sep 9, 2021

I have tested this item ✅ successfully on 80e6dec
For the JHelp strings concerned, see below which are still in


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35429.

@Bakual
Copy link
Contributor Author

Bakual commented Sep 9, 2021

Hmm, the "control page" seems to be good one.
But it looks like helppage is missing completely then for the admin menuitem "System Links" -> "Components Menu Container".

@RickR2H
Copy link
Member

RickR2H commented Sep 10, 2021

I have tested this item ✅ successfully on 80e6dec


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35429.

@richard67
Copy link
Member

@Bakual As this PR here has 2 good tests I'd like to set it RTC. Do I assume right that the discussion in the latest comments was about another PR and this one here is good as it is? Or do you want to change something here so I should wait with RTC?

@Bakual
Copy link
Contributor Author

Bakual commented Sep 11, 2021

@richard67 Aye, the missed string is a different issue that I can't solve here yet.

Btw: #35534 is the last missing piece, containing the JHELP Strings for com_categories.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35429.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 11, 2021
@richard67 richard67 added this to the Joomla 4.0.4 milestone Sep 12, 2021
@wilsonge
Copy link
Contributor

Conflicts here too. Let's do categories first and then resolve this one once that one is merged.

Thomas Hunziker added 2 commits September 21, 2021 19:55
# Conflicts:
#	administrator/language/en-GB/joomla.ini
#	api/language/en-GB/joomla.ini
@Bakual
Copy link
Contributor Author

Bakual commented Sep 21, 2021

Conflicts solved here too. No worries, it's simple to fix if it breaks again again with the next merge 😄

Kostelano added a commit to JPathRu/localisation that referenced this pull request Sep 21, 2021
@wilsonge
Copy link
Contributor

Categories merged. Conflicts again here

# Conflicts:
#	administrator/language/en-GB/joomla.ini
#	api/language/en-GB/joomla.ini
@Bakual
Copy link
Contributor Author

Bakual commented Sep 23, 2021

@wilsonge Conflicts solved again.

@wilsonge wilsonge merged commit ebad54c into joomla:4.0-dev Sep 23, 2021
@wilsonge
Copy link
Contributor

Thanks!

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 23, 2021
@Bakual Bakual deleted the 4_RemoveJHelpStrings branch September 24, 2021 05:29
@Kostelano
Copy link
Contributor

Please add the label LANGUAGE

Kostelano added a commit to JPathRu/localisation that referenced this pull request Sep 24, 2021
@richard67
Copy link
Member

Strange that it has not been added by our bot since the PR removes language strings.

@richard67 richard67 added the Language Change This is for Translators label Sep 24, 2021
brianteeman pushed a commit to brianteeman/joomla-cms that referenced this pull request Oct 3, 2021
* Replace JHELP_ String with hardcoded ref-key

* Simplifying helpTOC.php so it doesn't need to reverse lookup the JHELP_ strings.

* Remove loading of joomla.ini and messing with language class property

* alpha-sort help strings

* Next batch

* Last batch

* Ooops

Co-authored-by: Thomas Hunziker <werbemails@bakual.ch>
bembelimen added a commit that referenced this pull request Nov 21, 2021
* Add sensible inline help to Global Configuration

* Button to show/hide inline help

Example in backend com_config

* Add back the error handling

* Show how this can be done in the frontend, too

* Update build/media_source/system/js/inlinehelp.es6.js

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update build/media_source/system/js/inlinehelp.es6.js

Co-authored-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>

* Address inconsistency of control and description DIV id's

The controls have IDs like `jform_example`.

The description DIVs had IDs like `jform[example]-desc`.

This is horribly inconsistent and a pain to work with.

Converted the description DIV IDs to the more consistent
form `jform_example-desc`.

* Toggle the aria-describedby attribute to follow the visibility of the description

* Use simpler English

* Make this into a proper BUTTON element and end–align it

* Update administrator/language/en-GB/joomla.ini

Co-authored-by: Quy <quy@fluxbb.org>

* Update language string

* Update language/en-GB/com_config.ini

Co-authored-by: Brian Teeman <brian@teeman.net>

* Clarify SEF URLs

* Apply suggestions from code review

DocBlock updates

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* [4.x] Tinymce updates (#35605)

See https://www.tiny.cloud/docs/changelog/ for details

This includes 5.9.0, 5.9.1 and 5.9.2

* typo in filename (#35613)

* Remove JHELP_ strings for com_config and move the ref_key to the config.xml of the respective component. (#35479)

Co-authored-by: Thomas Hunziker <werbemails@bakual.ch>

* [4.0] Fix modal data attributes (#35626)

* Update main.php

* Update Bootstrap.php

* [4.0] Remove JHELP_ strings for com_categories (#35534)

* Category custom fields marked as 'subform' act as if they are not (#35547)

* Subform–only fields cause saving a category to fail.

Part I: “Only Use In Subform” doesn't do anything

* Subform–only fields cause saving a category to fail.

Part II. PlgSystemFields::onContentPrepareForm doesn't actually work for com_categories

Close gh-35543

* Subform–only fields cause saving a category to fail.

Part II. PlgSystemFields::onContentPrepareForm doesn't actually work for com_categories

This should only apply on com_content categories, not
third party categories.

* Invert the if–block order

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

* Subform–only fields cause saving a category to fail.

Part II. PlgSystemFields::onContentPrepareForm doesn't actually work for com_categories

Okay, it could actually apply for any category,
not just com_content.

* Docblock

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

* [4.0] Replace JHELP_ String with hardcoded ref-key (#35429)

* Replace JHELP_ String with hardcoded ref-key

* Simplifying helpTOC.php so it doesn't need to reverse lookup the JHELP_ strings.

* Remove loading of joomla.ini and messing with language class property

* alpha-sort help strings

* Next batch

* Last batch

* Ooops

Co-authored-by: Thomas Hunziker <werbemails@bakual.ch>

* [4][CloudFlare Issues] Remove validation of the session by IP address (#35509)

> IMHO the commend of @arnepluhar in #35509 should also count as a successful test. He did it as a GitHub code review. The rules about what constitutes a valid test should expand to GitHub code reviews; these didn't even exist when the rules were decided upon back in the day and they make FAR MORE SENSE than comments filed on a PR!

Github is configured to allow maintainers merge only if all tests are successful.

Thanks all.

* Language Keys may have a : in it. (#35659)

* Button to show/hide inline help

Example in backend com_config

* Whoops, wrong merge option

* Lang string change

* Apply language string suggestion

* Remove empty line on language file,

* Add sensible inline help to Global Configuration

* Button to show/hide inline help

Example in backend com_config

* Add back the error handling

* Show how this can be done in the frontend, too

* Update build/media_source/system/js/inlinehelp.es6.js

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update build/media_source/system/js/inlinehelp.es6.js

Co-authored-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>

* Address inconsistency of control and description DIV id's

The controls have IDs like `jform_example`.

The description DIVs had IDs like `jform[example]-desc`.

This is horribly inconsistent and a pain to work with.

Converted the description DIV IDs to the more consistent
form `jform_example-desc`.

* Toggle the aria-describedby attribute to follow the visibility of the description

* Use simpler English

* Make this into a proper BUTTON element and end–align it

* Update administrator/language/en-GB/joomla.ini

Co-authored-by: Quy <quy@fluxbb.org>

* Update language string

* Update language/en-GB/com_config.ini

Co-authored-by: Brian Teeman <brian@teeman.net>

* Clarify SEF URLs

* Apply suggestions from code review

DocBlock updates

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Button to show/hide inline help

Example in backend com_config

* Whoops, wrong merge option

* Lang string change

* Apply language string suggestion

* Remove empty line on language file,

Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>
Co-authored-by: Quy <quy@fluxbb.org>
Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>
Co-authored-by: Stefan Wendhausen <stefan.wendhausen@tec-promotion.de>
Co-authored-by: Thomas Hunziker <github@bakual.ch>
Co-authored-by: Thomas Hunziker <werbemails@bakual.ch>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Benjamin Trenkle <bembelimen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet