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

Bug in case insensitive #8

Open
yairpe opened this issue Apr 29, 2015 · 0 comments
Open

Bug in case insensitive #8

yairpe opened this issue Apr 29, 2015 · 0 comments

Comments

@yairpe
Copy link

yairpe commented Apr 29, 2015

IMHO there's a bug that prevent this extension from working properly.

The code in MPTranslate.php saves the messages it finds without translations in lower case!

    function missingTranslation($event){
        Yii::import('translate.models.MessageSource');
        $attributes=array(
            //'category'=>strtolower($event->category),         // bug
            'category'=>$event->category,                       // fix
            //'message'=>strtolower($event->message),           // bug
            'message'=>$event->message,                         // fix
        );

The search is done in case insensitive way as intended
SELECT * FROMSourceMessage t WHERE LOWER(message)=:message AND LOWER(category)=:category

but if you save the message itself as lowercase, Yii itself cannot find it and get it's translation!

I believe that the same is true for the category but all my categories are in lower case so I did not check it.

Great extension. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant