? ? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
16 Dec 2020

Similar to #31674, but for JLIB_FILESYSTEM strings.

Summary of Changes

  • Unused strings are removed
  • There is a new generic string JLIB_FILESYSTEM_ERROR_GENERIC which replaces two others. They contain only the class::method and the error message. It's still a language string so RTL languages can adapt the position of the two strings.
  • Strings with hardcoded class::method are changed to the method is injected into the string.

Testing Instructions

Code review and checking strings are indeed not used.

Documentation Changes Required

None

avatar Bakual Bakual - open - 16 Dec 2020
avatar Bakual Bakual - change - 16 Dec 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Dec 2020
Category Administration Language & Strings Installation Libraries
avatar Bakual Bakual - change - 16 Dec 2020
Title
Refactor and Cleanup JLIB_FILESYTEM strings
[4.0] Refactor and Cleanup JLIB_FILESYTEM strings
avatar Bakual Bakual - edited - 16 Dec 2020
avatar brianteeman
brianteeman - comment - 16 Dec 2020

JLIB_FILESYSTEM_ERROR_WRITE_STREAMS="%1$s(%2$s): %3$s"

I am really not a fan of strings like this unless they are accompanied by a comment explaining the meaning of %1, %2, %3

The only reason that we have this type of string is so that a translator can change the order of parts if needed in their language but without any reference it might as well just be hardcoded

avatar infograf768
infograf768 - comment - 16 Dec 2020

Crowdin does not show comments.

avatar PhilETaylor
PhilETaylor - comment - 16 Dec 2020

"%1$s(%2$s): %3$s" WTF?! haha

Strings with hardcoded class::method are changed to the method is injected into the string.

The whole point (I made) about refactoring these messages was to REMOVE any reference to the class or method.

Job Bloggs DOESNT CARE what code is running and raising the messages - he cares about the message.

The app should never be leaking Class Names and Method Names in error messages

Can you image going to Facebook.com and getting a message "Sorry, FbSnoopOnWebcam::takeNudeSnapshot could not write to Amazon S3" or on amazon.com getting a message "AmazonS3SavePersonalAnalytics::toDevelopersLaptopDesktop could not save file"..... No other user centric website would use PHP Class names or Method names in its error messages.

avatar Bakual
Bakual - comment - 16 Dec 2020

I know those strings aren't nice. But then they weren't nice before either.
The example above was JFile: :write(%1$s): %2$s". All I did was replacing JFile: :write with an injected method.

I fully agree that a string like "Failed to write file %1$s. Error was %2$s" would be more helpful. The classname isn't really needed.
My intention with this PR was just to get rid of unneeded strings and replace hardcoded class::method names. However if someone wants to suggest a better string, I'm happy to include it.

avatar Bakual
Bakual - comment - 16 Dec 2020

@PhilETaylor Just for your information: This PRs weren't motivated by any of your inputs. I wouldn't know of those. The input came from a translator who asked if the class and method names should be translated, and if not why they are part of the strings.
Which doesn't mean your thoughts would be wrong or anything - I just didn't know them before ?

avatar chmst
chmst - comment - 21 Dec 2020

I have tested this item successfully on 6e8441b


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

avatar chmst chmst - test_item - 21 Dec 2020 - Tested successfully
avatar gostn
gostn - comment - 21 Dec 2020

I have tested this item successfully on 6e8441b


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

avatar gostn gostn - test_item - 21 Dec 2020 - Tested successfully
avatar chmst
chmst - comment - 21 Dec 2020

RTC

avatar jwaisner jwaisner - change - 31 Dec 2020
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 1 Jan 2021

@wilsonge @HLeithner
Asked JSST about this

avatar HLeithner
HLeithner - comment - 1 Jan 2021

Are these error messages or only log entries?

avatar infograf768
infograf768 - comment - 1 Jan 2021

I think there are errors

EDIT: Did not test all but some are definitely logs

avatar HLeithner
HLeithner - comment - 1 Jan 2021

Ok, I got informed that the 'jerror' category get displayed to the user. So changing this to user friendly strings would be good. Can you do this @Bakual or is it beyond the scope of this PR?

avatar wilsonge
wilsonge - comment - 1 Jan 2021

We need two separate messages. A log message that is added - which will have method information added (and doesn't have the jerror category. Secondly a message enqueued to the application with a nice friendly message to the user. The problem here is we want one message to do both things.

avatar Bakual
Bakual - comment - 1 Jan 2021

It's beyond the intention of this PR to change the meaning of the strings. I just wanted to get rid of hardcoded class names.

avatar infograf768
infograf768 - comment - 2 Jan 2021

We need two separate messages. A log message that is added - which will have method information added (and doesn't have the jerror category. Secondly a message enqueued to the application with a nice friendly message to the user. The problem here is we want one message to do both things.

Agree on this. But it means that we have to do that all over J., not only for the strings concerned here. And evidently add new strings aimed at user.

avatar Bakual
Bakual - comment - 2 Jan 2021

Definitively out of scope of this PR

avatar wilsonge wilsonge - change - 3 Jan 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-01-03 01:33:20
Closed_By wilsonge
Labels Added: ? ?
avatar wilsonge wilsonge - close - 3 Jan 2021
avatar wilsonge wilsonge - merge - 3 Jan 2021
avatar wilsonge
wilsonge - comment - 3 Jan 2021

Merged as the messages aren't worse than they are now. But this does need cleaning up

avatar Bakual
Bakual - comment - 3 Jan 2021

I've created a new issue #31846 for the discussed topic.

Add a Comment

Login with GitHub to post a comment