-
Notifications
You must be signed in to change notification settings - Fork 3
CFM-274_breadcrumb_improvements_fixes #338
CFM-274_breadcrumb_improvements_fixes #338
Conversation
45e0458
to
596ff76
Compare
596ff76
to
131c8d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well.
@@ -49,20 +49,21 @@ | |||
|
|||
namespace App\Controller\Component; | |||
|
|||
use App\Model\Entity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this one line is relative instead of absolute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this import is redundant. I will remove it.
public static function pluginToTextDomain(?string $plugin): string | ||
{ | ||
if (empty($plugin)) { | ||
return 'operation'; | ||
} | ||
return \Cake\Utility\Inflector::singularize(\Cake\Utility\Inflector::tableize($plugin)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note FieldHelper::calculateLabelAndDescription
does something similar, but just uses Inflector::underscore
. It's actually not clear to me that singularize
is correct here. While by convention our plugins are named singularly, I don't see a requirement for that, and the documentation simply says "plugins should use the underscored version of their name as the domain for translation." (which is consistent with FieldHelper's logic).
FieldHelper should probably be updated to use this new call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I will use the StringUtility method in the FieldHelper for consistency.
No description provided.