New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename Ecommerce & Goals Category Titles #7885
Rename Ecommerce & Goals Category Titles #7885
Conversation
…oal category names
public function getCategoryKey() | ||
{ | ||
return $this->category; | ||
} |
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.
Why add this method and not use getCategory()
like it is now?
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.
See 3 lines above, getCategory
currently translates the category. We will hopefully change that with Piwik 3.0.
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.
BTW: There is a method that can give you the translation key for a translated string. Maybe it would be easier to use that function instead of adding this one. I currently don't have the project open but can look the method name up if you want.
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.
Ah, you are correct! Translate::findTranslationKeyForTranslation()
@mnapoli Thanks for your feedback! The reason for Report::getCategoryKey() is so TranslationHelper (https://github.com/piwik/piwik/pull/7885/files#diff-1af9522b6752c654ec8d4bbe084a0b2eR37) and Goals (https://github.com/piwik/piwik/pull/7885/files#diff-2cad92c203e05d0e9094913db5c7b92dR33) can base logic off of the category. Report::getCategory() returns an already-translated/localized string, which seems to make this difficult (unless I am overlooking a method that can "un-translate" a string and give you the key?) I agree with your other feedback :) I am leaving on vacation tomorrow morning though, so I will not have a chance to amend my PR until until 5/30 👎 |
…fix two small issues
Thx for that, nice PR! |
…ries Rename Ecommerce & Goals Category Titles
There were a few changes necessary to implement #6948:
Knowing the category of a report also allows Plugins\Goals\Goals to re-categorize the "CustomVariables" report.
I'm not sure about my approach to I18n in TranslationHelper—will this pattern work for all locales? Is there anything that should be done to transition from the old translation keys? And lastly, are the new translation keys I have created okay? 🎱