Information Required ? ? Failure

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
23 Feb 2019

Pull Request for Issue #23794

Summary of Changes

Loading com_workflow language file
Enabling Translation of the Asset Title (when available)
Adding basic state asset title strings in com_users.ini

Testing Instructions

Set Debug lang on
Load permissions page for your superuser
administrator/index.php?option=com_users&view=debuguser&user_id=531
(here my user id is 531)

Before patch, the assets title for components (com_content, com_contact, com_admin, etc. are not translated). The workflow default title same. The states (Unpublished, Published, etc.) same.
They show with ??com_content?? for example

After patch

All these are translated.
screen shot 2019-02-23 at 12 00 26
screen shot 2019-02-23 at 12 00 47

avatar infograf768 infograf768 - open - 23 Feb 2019
avatar infograf768 infograf768 - change - 23 Feb 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Feb 2019
Category Administration com_users Language & Strings
avatar SharkyKZ
SharkyKZ - comment - 23 Feb 2019

Is there a reason why Workflow and Stage titles are translatable but Transitions aren't?

avatar infograf768 infograf768 - change - 23 Feb 2019
Labels Added: ? ?
avatar infograf768
infograf768 - comment - 23 Feb 2019

Follow-up after looking further:

It is quite interesting to note that the assets titles that can be translated are done via the components sys.ini files which are all loaded by default.
It is also the case for com_workflow but that specific string COM_WORKFLOW_DEFAULT_WORKFLOW is not present in the sys.ini file.
I have now added it in this PR and therefore no need anymore to force load the com_workflow.ini.

If 3rd party extensions do follow core (and they should...), then the name of the component will be present in their sys.ini and automatically translated.
The only occurrence I have found which is not translated is com_massmail.
But I am not aware of the presence of such a component in core. It is just installed as asset by our sql. (What does it do here is a mystery to me as it is also present in 3.x sqls).

The reason why we need to add somewhere the following strings (I chose com_users.ini but they could go in the main ini file) :

ARCHIVE="Archive"
ARCHIVED="Archived"
PUBLISH="Publish"
PUBLISHED="Published"
TRASH="Trash"
TRASHED="Trashed"
UNPUBLISH="Unpublish"
UNPUBLISHED="Unpublished"

is because these constants do not exist in any file but are introduced in the assets by our sql

(56, 8, 20, 37, 2, 'com_content.workflow.1', 'COM_WORKFLOW_DEFAULT_WORKFLOW', '{}'),
(57, 56, 21, 22, 3, 'com_content.state.1', 'Unpublished', '{}'),
(58, 56, 23, 24, 3, 'com_content.state.2', 'Published', '{}'),
(59, 56, 25, 26, 3, 'com_content.state.3', 'Trashed', '{}'),
(60, 56, 27, 28, 3, 'com_content.state.4', 'Archived', '{}'),
(61, 56, 29, 30, 3, 'com_content.transition.1', 'Publish', '{}'),
(62, 56, 31, 32, 3, 'com_content.transition.2', 'Unpublish', '{}'),
(63, 56, 33, 34, 3, 'com_content.transition.3', 'Archive', '{}'),
(64, 56, 35, 36, 3, 'com_content.transition.4', 'Trash', '{}');

for sure, if new ones are created by admins, they may not be translated if not present in an override.

Now, it could be decided that NOTHING should be translated, including COM_WORKFLOW_DEFAULT_WORKFLOW and therefore that we should display as title of the assets the raw title as present in the Assets table.
@wilsonge @mbabker
If that is decided, I will close this PR.

avatar SharkyKZ
SharkyKZ - comment - 23 Feb 2019

is because these constants do not exist in any file but are introduced in the assets by our sql

Those are not constants (except COM_WORKFLOW_DEFAULT_WORKFLOW). These are already translated.

Which SQL file is this? It's outdated. com_content.state need to be changed to com_content.stage and stages title need to be changed to constants (JUNPUBLISHED, JPUBLISHED...).

Also, do you know why transition titles for new workflows do not use constants? @bembelimen?

avatar infograf768
infograf768 - comment - 24 Feb 2019

To test all this we need to create a new workflow.
I already get an error as WorkflowModel uses \JForm instead of Form and declaring use Joomla\CMS\Form\Form;
[24-Feb-2019 08:30:03 Europe/Berlin] PHP Warning: Declaration of Joomla\Component\Workflow\Administrator\Model\WorkflowModel::preprocessForm(JForm $form, $data, $group = 'content') should be compatible with Joomla\CMS\MVC\Model\FormModel::preprocessForm(Joomla\CMS\Form\Form $form, $data, $group = 'content') in ROOT/administrator/components/com_workflow/Model/WorkflowModel.php on line 430
and other errors
[24-Feb-2019 08:30:03 Europe/Berlin] PHP Notice: Undefined property: stdClass::$workflow_id in /Applications/MAMP/htdocs/installmulti/joomla40/administrator/components/com_workflow/Model/StageModel.php on line 163
[24-Feb-2019 08:34:08 Europe/Berlin] PHP Notice: Trying to get property of non-object in /Applications/MAMP/htdocs/installmulti/joomla40/administrator/components/com_workflow/Model/TransitionModel.php on line 89

Here is the assets db for the default as created after install:

screen shot 2019-02-24 at 08 37 36

Here is the assets part for a new workflow:
screen shot 2019-02-24 at 08 39 37

I agree with you that it is extremely confusing...

avatar wilsonge
wilsonge - comment - 27 Feb 2019

Here's a PR for the notice you have JM #24041

avatar wilsonge
wilsonge - comment - 27 Feb 2019

I have to say it seems weird that we're going to have half the resources untranslated and half not. Isn't this going to cause more confusion than it solves?

avatar infograf768
infograf768 - comment - 27 Feb 2019

As I wrote above, this PR can be ignored if decided such.
We still have some errors though when creating workflows, including the default sql.

avatar wilsonge
wilsonge - comment - 21 Mar 2019

Talk to Mig and any relevent TT's and give me a verdict. I'm happy to go with what TTs recommend here

avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Category Administration com_users Language & Strings Administration com_users
avatar roland-d
roland-d - comment - 31 Aug 2019

What is the verdict?

avatar joomla-cms-bot joomla-cms-bot - change - 31 Aug 2019
Category Administration com_users Administration com_users Language & Strings
avatar deepa-g deepa-g - test_item - 19 Oct 2019 - Tested successfully
avatar deepa-g
deepa-g - comment - 19 Oct 2019

I have tested this item successfully on 847b890


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

avatar pravinTek pravinTek - test_item - 2 Nov 2019 - Tested successfully
avatar pravinTek
pravinTek - comment - 2 Nov 2019

I have tested this item successfully on 847b890


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

avatar infograf768 infograf768 - change - 12 Nov 2019
Labels Added: Information Required ?
avatar brianteeman
brianteeman - comment - 9 Jan 2020

@infograf768 This is waiting for a decision from Mig. We can't just leave it open forever

avatar infograf768 infograf768 - change - 10 Jan 2020
Labels Added: Conflicting Files ?
Removed: ?
avatar infograf768 infograf768 - change - 10 Jan 2020
Labels Added: ?
Removed: ?
avatar infograf768
infograf768 - comment - 10 Jan 2020

@imanickam
Please test and give advice.

avatar infograf768 infograf768 - change - 10 Jan 2020
Labels Added: ?
Removed: Conflicting Files ?
avatar imanickam
imanickam - comment - 22 Jan 2020

Thanks for bearing with the delay. I was away for two weeks.

Today, JM and I had discussed about this PR. As workflow tables use language strings in the column title in the tables workflow and workflow_stages, moving forward with this PR would pave the way for improvements in the future.

Using the suggested language constants (that may have to be refined) in the file com_users.ini may restrict the use of these language constants only to the component com_users.

Probably what would be more logical is to move some of the constants (especially the ones that describe the transitions and stages) are moved to the file(s) en-GB.ini and workflow.ini/workflow.sys.ini as the case may be.

Just like in the table workflow_stages, whether it is possible to use the language strings such as JPUBLISH in the place of "Publish" in table workflow_transitions? This would standardize things in the workflow component.

avatar infograf768 infograf768 - change - 23 Jan 2020
Labels Removed: ?
avatar wilsonge wilsonge - close - 16 Feb 2020
avatar wilsonge wilsonge - merge - 16 Feb 2020
avatar wilsonge wilsonge - change - 16 Feb 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-16 15:08:36
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 16 Feb 2020

OK So if the plan is to use this as a starting point and is TT approved - happy to merge. Thanks guys

avatar infograf768
infograf768 - comment - 17 Feb 2020

@wilsonge

Probably what would be more logical is to move some of the constants (especially the ones that describe the transitions and stages) are moved to the file(s) en-GB.ini and workflow.ini/workflow.sys.ini as the case may be.

Remains to move the ones in com_users. Will do in another PR.

avatar wilsonge
wilsonge - comment - 17 Feb 2020

Cool. Thanks

Add a Comment

Login with GitHub to post a comment