? Language Change PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar GeraintEdwards
GeraintEdwards
14 Jul 2023

Pull Request for Issue # .

Summary of Changes

  1. Adds uid column to #__guidedtour table
  2. Existing Joomla tours are identified as joomla-articles etc. based on the language key for the tour title. Suggests that user adds an identifier like author/company/siteurl-tour-name - automatically creates as siteurl-tour-name when blank and checks if it is unique.
  3. Language files match this identifier naming convention - for example: guidedtours.joomla_articles.ini and the steps in guidedtours.joomla_articles_steps.ini or extension.extension_tour_name.ini, mod_extension.module_tour_name.ini
  4. Language files can be loaded from administrator/com_extension administrator/modules/mod_extension etc.
  5. Parses buttons with data attributes of data-id="tour id" OR data-gt-uid="tour-uid" to allow buttons to be created that are independent of the tour id in the database

Testing Instructions

Apply this PR
Go to System -> Manage -> Guided Tours

Test 1 - Checking identifier creation

Create a tour. Do not enter data in the identifier field.
Save the tour and check the identifier.
If you are on a local server, the identifier should look something like localhost-the-tour-name.

Test 2 - Checking identifier uniqueness

Try creating a tour with an identifier that exists for another tour.
The identifier should have a -X number attached to its name if it has been in use already.

Test 3 - Duplicating a tour.

In the Tours view, select a tour and select 'duplicate' from the actions.
The tour language keys and step language keys should not be translated until a proper language file matches the identifier. If the tour identifier is localhost-articles then the language files must be guidedtours.localhost_articles.ini and guidedtours.localhost_articles_steps.ini (language files are located in administrator/language).
Note that in tours view, the language keys may be translated because identical to languages loaded from another tour.

Test 4 - Launching a tour from any location

Create a custom module in the cpanel dashboard and add this HTML to it
<button class="button-start-guidedtour btn btn-primary" type="button" data-gt-uid="joomla-articles"> How to create articles? </button> <button class="btn btn-secondary button-start-guidedtour" type="button" data-gt-uid="joomla-contacts">How to create contacts?</button>

Then view the tour by clicking the link in the module (which uses the identifier, not the id of the tour).

Test 5 - Making sure language files are properly used

Change the translation in the files

  • administrator/language/[language used in the console]/guidedtours.joomla_articles.ini
  • administrator/language/[language used in the console]/guidedtours.joomla_articles_steps.ini
    to see that these are indeed the language files that are being used.
    Make sure the site is multilingual.

Actual result BEFORE applying this Pull Request

No tour alias, no way to run a tour other than using the tour module that lists all tours.
Language strings are loaded in the dashboard for all tours, on every page where the tour module is present.

Expected result AFTER applying this Pull Request

Tours can be triggered in other places than from the tour module.
Only languages keys that are needed are loaded.

Warning:
Third-party multilingual tours will lose their translations through this PR (the language keys are moved out of extension's language files and new language files need to follow the new naming conventions). Plan is to alert third-party developers of the change once this PR is merged so they can update their tour's language files accordingly.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org: New or Edit a Tour - this needs updating to cover language file naming and locations

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2023
Category SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins
avatar GeraintEdwards GeraintEdwards - open - 14 Jul 2023
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
Status New Pending
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
Title
Tours alias language
[5.0Tours alias language
avatar GeraintEdwards GeraintEdwards - edited - 14 Jul 2023
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
Title
[5.0Tours alias language
[5.0] Tours alias language
avatar GeraintEdwards GeraintEdwards - edited - 14 Jul 2023
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
Labels Added: Language Change NPM Resource Changed PR-5.0-dev
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 14 Jul 2023
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 14 Jul 2023
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 14 Jul 2023
avatar GeraintEdwards GeraintEdwards - change - 14 Jul 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 14 Jul 2023
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2023
Category SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins Templates (site)
avatar GeraintEdwards
GeraintEdwards - comment - 15 Jul 2023

Will remove the stray built files.

@obuisard i suggest that I spilt the tour and step language files to reduce furst pass l Ioad, what do you think?

avatar joomla-cms-bot joomla-cms-bot - change - 15 Jul 2023
Category SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins Templates (site) SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins
avatar obuisard
obuisard - comment - 15 Jul 2023

@obuisard i suggest that I spilt the tour and step language files to reduce furst pass l Ioad, what do you think?

Agree, we need to separate a tour and its steps in 2 separate files. So that when needing just the tour name, we don't load everything.

avatar richard67
richard67 - comment - 16 Jul 2023

@obuisard My last 2 core review suggestions should fix PHPCS in drone. Maybe you can commit them if @GeraintEdwards is not available.

avatar GeraintEdwards
GeraintEdwards - comment - 17 Jul 2023

I have now split the language files and load both in the tourmodel, stepmodel and stepsmodel - but ONLY the title in the getItems method of the toursmodel.

The module gets its items from the toursmodel so I have removed loading the language files there.

One last question - in the admin module we currently load the component language file. I propose we remove this or push it into the model files instead. I can see that loading the component file could eliminate some duplicate language strings but I think its cleaner NOT to rely on language strings from the component language file.

avatar obuisard
obuisard - comment - 17 Jul 2023

One last question - in the admin module we currently load the component language file. I propose we remove this or push it into the model files instead. I can see that loading the component file could eliminate some duplicate language strings but I think its cleaner NOT to rely on language strings from the component language file.

Yes, in this case the language file of the component is no longer necessary.

avatar GeraintEdwards
GeraintEdwards - comment - 18 Jul 2023

One last question - in the admin module we currently load the component language file. I propose we remove this or push it into the model files instead. I can see that loading the component file could eliminate some duplicate language strings but I think its cleaner NOT to rely on language strings from the component language file.

Yes, in this case the language file of the component is no longer necessary.

I'll remove it then

avatar joomla-cms-bot joomla-cms-bot - change - 14 Aug 2023
Category SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins SQL Administration com_admin Postgresql Language & Strings
avatar GeraintEdwards GeraintEdwards - change - 14 Aug 2023
Labels Removed: NPM Resource Changed
avatar GeraintEdwards GeraintEdwards - change - 15 Aug 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 15 Aug 2023
avatar obuisard obuisard - change - 15 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 15 Aug 2023
avatar GeraintEdwards GeraintEdwards - change - 15 Aug 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - change - 15 Aug 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 15 Aug 2023
avatar GeraintEdwards GeraintEdwards - change - 15 Aug 2023
The description was changed
avatar GeraintEdwards
GeraintEdwards - comment - 17 Aug 2023

@aze088

Creating a tour with a blank alias does not create a unique alias as intended (test #3) and is blank instead.

I just tested this a new unique alias is created

As for test #4, creating a tour with the same alias as another tour results in the alias being the same for both tours and does not create a unique alias as intended.

I just tested this using the same alias an existing tour and adds an incremental identified to the alias provided.

Can you tell me which web browser you are using?

What version of PHP?

Are you running on localhost or a named domain?

Do you have unicode aliases enabled in Joomla?

If you are able to help debug this could you add some diagnostic messages into administrator/com_guidedtours/src/Model/TourModel.php - perhaps adding
var_dump($data);exit();
just before
if (empty($data['alias'])) {
at line 84 and then saving a new tour with a blank alias. Does it show $data['alias'] as empty??

avatar aze088
aze088 - comment - 22 Aug 2023

Capture

A fresh install results in one of the default tours being improperly named.

Edit: The auto-generated alias for that tour is incorrect. The alias 'joomla_guidedtourssteps' should be 'joomla_guidedtoursteps' for the correct name and description to appear.

On a side note, changing any alias in a pre-created tour causes the tour name and description (not sure if other things as well) to immediately be changed to language keys. Ignore if this is by design

avatar GeraintEdwards
GeraintEdwards - comment - 22 Aug 2023

@aze088 Your issue is the same as Olivier's - I have resolved this now

avatar obuisard
obuisard - comment - 23 Aug 2023

Geraint @GeraintEdwards, I have noticed that step views do not load the language files, therefore the strings are not translated.

avatar brianteeman
brianteeman - comment - 24 Aug 2023

The language strings talk about a tour identifier but there is no such thing

avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar obuisard obuisard - change - 24 Aug 2023
The description was changed
avatar obuisard obuisard - edited - 24 Aug 2023
avatar GeraintEdwards
GeraintEdwards - comment - 25 Aug 2023

@brianteeman

The language strings talk about a tour identifier but there is no such thing

This has been the source of some debate. We are using a unique identifier for a tour to determine the language file name - this, strictly speaking, needs to be unique across all websites where the tour could be installed so avoid a clash of language file names. This is why we started with the name 'tour identifier'.

It shares some characteristics with the regular Joomla alias (hyphenation/appearance, position in edit page, the code that avoids duplicate when saved) hence the push to use 'alias'. But it is not used for generating URLs or routing in the way that aliases are elsewhere in Joomla.

Personally I think that 'tour identifier' is better than alias but other people think 'alias'.

What is your view?

avatar brianteeman
brianteeman - comment - 25 Aug 2023

My view is that whatever it is there should be just one name for it

avatar obuisard
obuisard - comment - 25 Aug 2023

After much thought, I do agree Geraint @GeraintEdwards, to keep 'Identifier'.
The tour identifier has all the characteristics of an alias but at the same time we 'highly suggest' how it should be formatted, not as free form as an alias, since it 'shapes' how the language files are named, if there are any.

avatar obuisard
obuisard - comment - 25 Aug 2023

When tours are duplicated in a batch, they are missing the tour identifier. Duplicated tours are orphan of an identifier, until modified. This will create issues until the tours are saved (our code moving forward assumes a tour identifier is always present).

avatar GeraintEdwards
GeraintEdwards - comment - 26 Aug 2023

@obuisard

When tours are duplicated in a batch, they are missing the tour identifier. Duplicated tours are orphan of an identifier, until modified. This will create issues until the tours are saved (our code moving forward assumes a tour identifier is always present).

Resolved

avatar obuisard obuisard - test_item - 26 Aug 2023 - Tested successfully
avatar obuisard
obuisard - comment - 26 Aug 2023

I have tested this item ✅ successfully on 0cd24e3


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

avatar joomla-cms-bot joomla-cms-bot - change - 30 Aug 2023
Category SQL Administration com_admin Postgresql Language & Strings SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins
avatar richard67
richard67 - comment - 30 Aug 2023

As we meanwhile have update SQL scripts "5.0.0-2023-08-28.sql", the update SQL scripts "5.0.0-2023-06-22.sql" of this PR here need to be renamed to something newer, otherwise they will not run when updating from a previous 5.0 alpha.

I suggest to use "5.0.0-2023-06-30.sql".

avatar GeraintEdwards GeraintEdwards - change - 30 Aug 2023
Labels Added: NPM Resource Changed
avatar GeraintEdwards
GeraintEdwards - comment - 30 Aug 2023

As we meanwhile have update SQL scripts "5.0.0-2023-08-28.sql", the update SQL scripts "5.0.0-2023-06-22.sql" of this PR here need to be renamed to something newer, otherwise they will not run when updating from a previous 5.0 alpha.

I suggest to use "5.0.0-2023-06-30.sql".

I went for 5.0.0-2023-08-29.sql rather that 5.0.0-2023-08-30.sql in case someone else creates a new file today

avatar joomla-cms-bot joomla-cms-bot - change - 30 Aug 2023
Category SQL Administration com_admin Postgresql Language & Strings Modules JavaScript Repository NPM Change Installation Front End Plugins SQL Administration com_admin Postgresql Language & Strings
avatar obuisard obuisard - test_item - 30 Aug 2023 - Tested successfully
avatar obuisard
obuisard - comment - 30 Aug 2023

I have tested this item ✅ successfully on 0cd24e3


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

avatar GeraintEdwards GeraintEdwards - change - 31 Aug 2023
Labels Removed: NPM Resource Changed
avatar obuisard obuisard - change - 1 Sep 2023
The description was changed
avatar obuisard obuisard - edited - 1 Sep 2023
avatar khu5h1 khu5h1 - test_item - 1 Sep 2023 - Tested successfully
avatar khu5h1
khu5h1 - comment - 1 Sep 2023

I have tested this item ✅ successfully on 0cd24e3


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

avatar richard67 richard67 - change - 1 Sep 2023
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 1 Sep 2023

RTC


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

avatar richard67 richard67 - change - 1 Sep 2023
Labels Added: ?
avatar brianteeman
brianteeman - comment - 1 Sep 2023

Language files match this alias naming convention - for example: com_guidedtours_joomla_articles.ini and the steps in com_guidedtours_joomla_articles_steps.ini

That is not what is in this PR

com_guidedtours.joomla_articles.ini
com_guidedtours.joomla_articles_steps.ini

avatar brianteeman
brianteeman - comment - 1 Sep 2023

as the alias is actually an identifier and something different to the usual usage of the word alias would it not be better to avoid confusion and rename the field in the db from alias to identifier?

avatar obuisard obuisard - change - 2 Sep 2023
The description was changed
avatar obuisard obuisard - edited - 2 Sep 2023
avatar GeraintEdwards
GeraintEdwards - comment - 2 Sep 2023

@brianteeman - the column is now renamed to uid

avatar GeraintEdwards GeraintEdwards - change - 2 Sep 2023
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 2 Sep 2023
avatar obuisard obuisard - change - 2 Sep 2023
The description was changed
avatar obuisard obuisard - edited - 2 Sep 2023
avatar obuisard obuisard - test_item - 3 Sep 2023 - Tested successfully
avatar obuisard
obuisard - comment - 3 Sep 2023

I have tested this item ✅ successfully on 0cd24e3


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

avatar khu5h1 khu5h1 - test_item - 3 Sep 2023 - Tested successfully
avatar khu5h1
khu5h1 - comment - 3 Sep 2023

I have tested this item ✅ successfully on 0cd24e3


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

avatar sdwjoomla sdwjoomla - change - 3 Sep 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-09-03 03:23:26
Closed_By sdwjoomla
avatar sdwjoomla sdwjoomla - close - 3 Sep 2023
avatar sdwjoomla sdwjoomla - merge - 3 Sep 2023
avatar sdwjoomla
sdwjoomla - comment - 3 Sep 2023

Thanks @GeraintEdwards. Thank you @Quy , @brianteeman ., @HLeithner , @richard67 , and @obuisard for feedback, consultation and input into improving this PR. Thanks to everyone else who help to test and document.

Add a Comment

Login with GitHub to post a comment