saoj
Joined: 22/12/2007 07:20:02
Messages: 22
Offline
|
Although not a good practice, you are free to place your validation error messages inside your source code instead of using an i18n file. If you application is a simple one that does not plan to use internationalization you may prefer this approach.
If Mentawai does not find the i18n file or the key inside the i18n file, it will just display the key as the error message. So just place your error message as the key and you are ready to go. See the example below:
Note that we are just using the error message as the key. Mentawai executes the following logic to find the error message.
Look for the i18n file. If you don't find the i18n file, use the key as the error message.
If you found the i18n file, look for the key. If you don't find the key, use the key as the error message.
If you found the key, print the associated text as the error message.
As you can see, it is very easy to place your error messages inside your source code instead of using an i18n file.
|