Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

MathSpamProtection Language


Go to End


2 Posts   2146 Views

Avatar
George

Community Member, 41 Posts

31 December 2009 at 7:23am

Hi,

I have activated MathSpamProtection at the blog. The question is appearing is only in english available. I can't find the sources to change it to numbers or add some translations, where I can find them?
Or is there a way to change it to Mollom?

Thanks

Avatar
monkee

Community Member, 22 Posts

12 November 2010 at 12:06am

Edited: 12/11/2010 12:21am

same problem here
after som grepping i found the following

cms/code/sitefeatures/MathSpamProtection.php

Only the numbers were wrongly translated in my case, so:

        /**
         * Helper method for converting digits to their equivelant english words
         */
        static function digitToWord($num){
                $numbers = array(_t('MathSpamProtection.ZERO', 'zero'),
                        _t('MathSpamProtection.ONE', 'one'),
                        _t('MathSpamProtection.TWO', 'two'),
                        _t('MathSpamProtection.THREE', 'three'),
                        _t('MathSpamProtection.FOUR', 'four'),
                        _t('MathSpamProtection.FIVE', 'five'),
                        _t('MathSpamProtection.SIX', 'six'),
                        _t('MathSpamProtection.SEVEN', 'seven'),
                        _t('MathSpamProtection.EIGHT', 'eight'),
                        _t('MathSpamProtection.NINE', 'nine'),
                        _t('MathSpamProtection.TEN', 'ten'),
                        _t('MathSpamProtection.ELEVEN', 'eleven'),
                        _t('MathSpamProtection.TWELVE', 'twelve'),
                        _t('MathSpamProtection.THIRTEEN', 'thirteen'),
                        _t('MathSpamProtection.FOURTEEN', 'fourteen'),
                        _t('MathSpamProtection.FIFTEEN', 'fifteen'),
                        _t('MathSpamProtection.SIXTEEN', 'sixteen'),
                        _t('MathSpamProtection.SEVENTEEN', 'seventeen'),
                        _t('MathSpamProtection.EIGHTEEN', 'eighteen'));

                        if($num < 0) return "minus ".($numbers[-1*$num]);

                return $numbers[$num];
        }

It's all translatable _t() but does not works all the time.

In German:
Spamschutz Frage: Was gibt three plus zwei ?

One number is translated, the other not... strange

grep is your friend! (grep -r "whatyousearchfor")

i searched for "TWO" (which was correctly translated) and "THREE" which was not.

turns out, THREE is missing in my german language file:
cms/lang/de_DE.php

There is only:

$lang['de_DE']['MathSpamProtection']['TWELVE'] = 'zwölf';
$lang['de_DE']['MathSpamProtection']['TWO'] = 'zwei';
$lang['de_DE']['MathSpamProtection']['WHATIS'] = 'Was gibt %s plus %s ?';
$lang['de_DE']['MathSpamProtection']['ZERO'] = 'null';

now jus add whats missing!