0

In the tutorial from here the errors are printed similar to this (I added the p + " " +):

<%  if (errors) { %>
  <p> 
  <% for (var p in errors) { %>
    <div><%=  p + " " + errors[p];  %></div>
  <% } %>
  </p>
<% } %>

The thing is that the message is not relevant at all. For example, I want the title to be always present, so, if I don't enter a value, the error title [[model.validatesPresent]] is displayed, but I want something better.

Do I have to write my own procedures for creating some meaningful messages or does geddy also have some other options that could help (I haven't found anything in the documentation)? Some advice?

1 Answers1

1

Update: the issue was fixed and now localized strings work on all platforms. You can override messages as default if/when needed.

This was an issue with i18n and windows, in the meantime you can specify a message explicitly.

On your model:

this.validatesPresent("title", null, {message: "The title is required" });
Miguel Madero
  • 1,948
  • 13
  • 21
  • but how about datatype errors?...how can I deal with them?...I've found the file my_app\node_modules\geddy\templates\locales\en-us.json where the messages are defined, but I don't know how to use them... – Sorin Adrian Carbunaru Mar 08 '13 at 18:06
  • for example in the model I have defined a field of type int and I try to enter a string...then I get an error...but it has the same format as the validation errors...I mean like this [[model.validatesInteger]] – Sorin Adrian Carbunaru Mar 08 '13 at 18:14
  • About the internationalization, this seems to be a bug. I'm investigating and just asked on the [mailing list](https://groups.google.com/forum/?fromgroups=#!topic/geddyjs/MfMoZElZloU), please join us there to discuss this further. – Miguel Madero Mar 08 '13 at 18:15
  • Duh! I know what you mean by datatype errors. 'model.validatesInteger' is the key for i18n (more on [Internationalization and Geddy](https://github.com/mde/geddy/wiki/Internationalization-(i18n)). It's not getting the value due to the mentioned bug. You can see the json file, one of the entries is: , "model.validatesInteger": "\"{name}\" must be an integer." – Miguel Madero Mar 08 '13 at 18:17