Skip to content
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

Lower case the string in a way that works with any language #11375

Merged
merged 1 commit into from Feb 21, 2017
Merged

Conversation

mattab
Copy link
Member

@mattab mattab commented Feb 20, 2017

Fixes #11130

@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Feb 20, 2017
@mattab mattab added this to the 3.0.2 milestone Feb 20, 2017
@mattab mattab changed the title Lower the string in a way that works with any language Lower case the string in a way that works with any language Feb 20, 2017
@@ -54,8 +54,7 @@ public function __construct($idSite = false)
if ($segment['category'] == $visitTitle
&& ($segment['type'] == 'metric' && $segment['segment'] != 'visitIp')
) {
$metricsLabel = Piwik::translate('General_Metrics');
$metricsLabel[0] = Common::mb_strtolower($metricsLabel[0]);
$metricsLabel = Common::mb_strtolower(Piwik::translate('General_Metrics'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it on purpose to remove the metricsLabel[0] completely?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the fix actually: it does not work to use [0] to replace first character in a multibyte chinese string since the first character might be 2 or 3 bytes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet. You can call this a fix as well then to completely remove it :) 👍 Thought you meant to really fix it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the real fix actually, we're now lowercasing the whole string which has the same effect of just lower casing the first letter (in most languages anyway)

@mattab mattab merged commit 34de2eb into 3.x-dev Feb 21, 2017
@mattab mattab deleted the 11130 branch February 21, 2017 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants