internationalized (English and Arabic) application in grails

S

sshehab

Guest
Hi ,

i need to make an internationalized (English and Arabic) application in grails , but facing some problems , for instance i got a domain named Students got the below fields :
Code:
class Students
{

	String firstName
	String lastName
}

in the views i want the above fields to be shown according to the language that the user selected in the welcome page
, i already made the part of language selection, but how the another part can be achieved ?

Thanks
Sherif
 
M

maazmomin

Guest
Create a following fiels in message.properties

fname.label = First Name
lName.label = Last Name

and create message_ar.properties (For arabic)
fname.label = First Name(in arabic)
lName.label = Last Name(in arabic)

Now in View, Use
<g:message code="fName.label"/> instead of first Name
<g:message code="lName.label"/> instead of Last Name

You can change your language, by appending '?lang=en' for english and '?lang=ar' for arabic
 
Top