Creating multiple translations for the field labels and descriptions of your tables is a simple thing. (Since 0.7)
Xataface uses naming conventions that you can follow to internationalize the field labels and descriptions in your application. These conventions are as follows:
In your language .ini files you can use:
- tables.%tablename%.fields.%fieldname%.widget.label
- Specifies the label for the %fieldname% field in the %tablename% table.
- tables.%tablename%.fields.%fieldname%.widget.description
- Specifies the description for the %fieldname% field in the %tablename% table.
- tables.%tablename%.fields.%fieldname%.widget.question
- Specifies the question for the %fieldname% field in the %tablename% table.
- tables.%tablename%.fieldgroups.%groupname%.label
- The label for the field group named %groupname%.
- actions.%relationshipname%.label
- The label for the relationship named %relationshipname% . (Note this method is deprecated as of v1.2. See Bug 582. Now you should use the new keys listed below.
- actions.%relationshipname%.description
- The description for the relationship named %relationshipname%. (Note this method is deprecated as of v1.2. See Bug 582. Now you should use the new keys listed below.
- tables.%tablaname%.relationships.%relationshipname%.label
- The label for the relationship named %relationshipname%. (Introduced in v1.2).
- tables.%tablename%.relationships.%relationshipname%.description
- The description for the relationship named %relationshipname%. (Introduced in v1.2).
Example
Suppose we have a Customers table with a field first_name. Our fields.ini file will look something like this:
[first_name]
widget:label=First name
widget:description ="The customer's first name"
But for french users you want the label to say "Prénom" and the description to say "Le prénom du client". So we add the following to our fr.ini file:
tables.Customers.fields.first_name.widget.label = "Prénom"
tables.Customers.fields.first_name.widget.description = "Le prénom du client"