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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Error messages in another language


Reply


3 Posts   983 Views

Avatar
quanto

Community Member, 81 Posts

15 March 2011 at 9:33pm

I have a problem using RequiredFields in my site. I try to replace the text "Please fill out "[FIELDNAME]", it is required." into another language.

I found the code sapphire/javascript/Validator.js, and replaced the code, but in the errorpage nothing happened. I saw other [url=http://www.silverstripe.org/general-questions/show/5343?start=8]topics[/url] on this forum but they weren't usefull. Also [url=http://www.webmasterbulletin.net/2008/07/silverstripe-form-validation-translation/78]this[/url] wasn't very usefull.

Does anybody has an solution? Thanks!

Avatar
martimiz

Forum Moderator, 1132 Posts

15 March 2011 at 11:02pm

You shouldn't have to change core code for this (never a good idea) - the languagefiles should take care of this.

Validation messages are generated by javascript and unfortunately the languagefiles do not always exist for the javascript files, in which case SilverStripe will default to the english translations (probably overriding the translation you did by hand).

Look in /sapphire/javascript/lang/ and check if a translation file for your language is available. If so, compare it to the en_US.js and check if all translations are catered for. If not, you could create a copy for your own languages and do the translations yourself - or ask for help on this forum.

And maybe send in a patch so your work doesn't get lost :-)

Avatar
quanto

Community Member, 81 Posts

16 March 2011 at 12:03am

Thanks! I just changed the /sapphire/javascript/lang/en_US.js code to my language (dutch), and it worked