? Pending

User tests: Successful: Unsuccessful:

avatar elkuku
elkuku
8 Aug 2018

Currently the file path for the untranslated strings display is broken

Testing Instructions

  • Switch on debug and language debug
  • Have some untranslated strings
  • Look at the debug console

Expected result

bildschirmfoto_2018-08-07_18-56-20

Actual result

bildschirmfoto_2018-08-07_18-55-35

Documentation Changes Required

n/a

avatar elkuku elkuku - open - 8 Aug 2018
avatar elkuku elkuku - change - 8 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2018
Category Libraries
avatar elkuku elkuku - change - 8 Aug 2018
Title
Fix wrong caller info for (un)translated language strings
[4.0] Fix wrong caller info for (un)translated language strings
avatar elkuku elkuku - edited - 8 Aug 2018
avatar elkuku elkuku - change - 8 Aug 2018
Labels Added: ?
avatar elkuku
elkuku - comment - 8 Aug 2018

OK so I had a closer look, removed some stuff and I strongly believe that things should behave as expected, but looking a lot sexier ?
Please review.

avatar roland-d roland-d - test_item - 10 Aug 2018 - Tested successfully
avatar roland-d
roland-d - comment - 10 Aug 2018

I have tested this item successfully on 7a389f8

Before the patch the wrong file was shown as having the missing string, after the patch the missing string is shown with the correct filename.


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

avatar roland-d
roland-d - comment - 10 Aug 2018

@elkuku Tested and fix is good.


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

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Aug 2018

Have some untranslated strings

how to get untranslated Strings?

avatar elkuku
elkuku - comment - 27 Aug 2018

how to get untranslated Strings?

On a fresh install, modify /language/en-GB/en-GB.mod_breadcrumbs.ini
Change
MOD_BREADCRUMBS_HOME="Home"
to
MOD_BREADCRUMBS_HOMEx="Home"
and sail to your frontpage.

This will give you not only an untranslated string but also an "error" ?

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 27 Aug 2018 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Aug 2018

I have tested this item successfully on 7a389f8

Thanks for Help, @elkuku.


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Aug 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Aug 2018

Ready to Commit after two successful tests.

avatar elkuku elkuku - change - 27 Aug 2018
Labels Added: ?
avatar elkuku
elkuku - comment - 27 Aug 2018

I did some additional changes while discovering more instances..
Please try the global configuration in backend which uses some "uncommon" methods in (J)Text...

@roland-d @franz-wohlkoenig would you mind testing again? Thanks and sorry for the noise..

avatar elkuku elkuku - change - 27 Aug 2018
Status Ready to Commit Pending
Labels
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 Aug 2018

Please try the global configuration in backend which uses some "uncommon" methods in (J)Text...

Can you give Example of "uncommon Methods" which should be tested?

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 28 Aug 2018 - Tested successfully
avatar infograf768
infograf768 - comment - 28 Aug 2018

@elkuku
Although it is better indeed than before, results are sometimes weird.
Example when the error comes from a string in a field as the path will display the library/src/Form/Field/ whateverfieldfile, or for other errors, other files in library/src/

Maybe better than nothing. I let other people decide.

avatar roland-d
roland-d - comment - 29 Aug 2018

@infograf768 I don't fully understand the problem. Can you explain the issue somewhat further?

avatar infograf768
infograf768 - comment - 30 Aug 2018

It is not a problem per se, it just is not really helpful when the string is used in a field.

Com_config is a good example.
Let's say I take off a double quote here
COM_CONFIG=Configuration Manager"

Then look at debug.
Parsing errors is correct
JROOT/administrator/language/en-GB/en-GB.com_config.ini:6

Then look at Untranslated strings:
Among all chapters there we have

# JROOT/administrator/components/com_config/View/Application/HtmlView.php

COM_CONFIG_GLOBAL_CONFIGURATION="CONFIG GLOBAL CONFIGURATION"

which corresponds to
ToolbarHelper::title(Text::_('COM_CONFIG_GLOBAL_CONFIGURATION'), 'equalizer config');

Therefore this case is real useful as you know precisely where the string is used.

Now look at other chapters of Unranslated strings
I choose here 3 of the smaller ones:

# JROOT/libraries/src/Form/Field/PasswordField.php

COM_CONFIG_FIELD_FTP_PASSWORD_LABEL="CONFIG FIELD FTP PASSWORD LABEL"
COM_CONFIG_FIELD_MAIL_SMTP_PASSWORD_LABEL="CONFIG FIELD MAIL SMTP PASSWORD LABEL"
COM_CONFIG_FIELD_PROXY_PASSWORD_LABEL="CONFIG FIELD PROXY PASSWORD LABEL"
COM_CONFIG_FIELD_REDIS_AUTH_DESC="CONFIG FIELD REDIS AUTH DESC"
COM_CONFIG_FIELD_REDIS_AUTH_LABEL="CONFIG FIELD REDIS AUTH LABEL"

# JROOT/libraries/src/Form/Field/TextareaField.php

COM_CONFIG_FIELD_METADESC_LABEL="CONFIG FIELD METADESC LABEL"
COM_CONFIG_FIELD_METAKEYS_LABEL="CONFIG FIELD METAKEYS LABEL"
COM_CONFIG_FIELD_OFFLINE_MESSAGE_LABEL="CONFIG FIELD OFFLINE MESSAGE LABEL"

# JROOT/libraries/src/Form/Field/MediaField.php

COM_CONFIG_FIELD_OFFLINE_IMAGE_LABEL="CONFIG FIELD OFFLINE IMAGE LABEL"

The information concerning the location is useless as the strings are not physically present in these files but in xml(s).

avatar elkuku
elkuku - comment - 31 Aug 2018

Hello @infograf768 thanks for chiming in here as this issue really requires the opinion from a language expert ?
Of course you are right that the current solution is not perfect and if, for example, a (J)FormField is displayed this information is pretty much useless.
I believe the only real option to examine from where a language string is "called" would be to include the whole stack trace and not only a "guessing" of the caller that might be different with thew next change of a name space or directory...
If #20380 gets merged I think we could make this happen.

avatar Hackwar
Hackwar - comment - 31 Aug 2018

I disagree that the formfield would not be a valid hint for the user. It is very helpfull for me when developing my own fields. Otherwise cool find. ?

avatar infograf768
infograf768 - comment - 1 Sep 2018

It is very helpfull for me when developing my own fields.

Well, it just tells you the problem is in an xml. Useful indeed for a dev creating an extension as xml(s) quantity is somehow limited.
When dealing with the whole core, one has nevertheless to grep for the missing string. No p.

avatar elkuku
elkuku - comment - 8 Sep 2018

So I just surfed around the docs, looking for information on debugging Joomla! and found the following page about language debug: https://docs.joomla.org/index.php?title=Debugging_a_translation

Here you can read at the very bottom:

Note that the path shown is only a best guess based on a call to the PHP debug_backtrace function. Sometimes it is accurate, sometimes it is not and there are also cases where no file could be determined. In those cases you have to use your best judgement.

@chrisdavenport wrote those words back in 2008 and they are still valid ?

And that's why I decided to include the whole stack trace to help judging. See: #20380 (comment)

So. if we get another tester for #20380 and get it merged this here can be closed.

avatar Bloggerschmidt Bloggerschmidt - test_item - 8 Sep 2018 - Tested successfully
avatar elkuku
elkuku - comment - 10 Sep 2018

Since #20380 has been merged, this can be closed. Thanks @all for testing!

avatar elkuku elkuku - change - 10 Sep 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-09-10 14:31:46
Closed_By elkuku
Labels Removed: ?
avatar elkuku elkuku - close - 10 Sep 2018

Add a Comment

Login with GitHub to post a comment