With SFS Tools, all fields support localization, so the way to change is through resource files, or any other localization provider.
The automatic generation of the solution creates all the necessary resource files for each business object and other necessary for the module. All resource files in a folder and are easy to modify.
Changing text for each language.
- In the presentation project (ASP.NET MVC) of business module, open the "Resources" folder and see that each business entity there is a resource file.
- Select the file to customize the business object, in this case: "ProductResources.resx", right click and select "Copy" from the context menu and "Ctrl + v" paste in the same folder (which will create a file name: "Copy of ProductResources.resx").
- Select the file "Copy of ProductResources.resx" and right click to select "Rename" from the context menu and rename it adding ".es-mx" (Or any other localization id) before the ". resx" . Now the name file is "ProductResources.es-mx.resx. "
- Open the file "ProductResources.es-mx.resx" with double click and change the following texts:
“PRODUCTS_ADD_NEW”, “PRODUCTS_DETAILS”, “PRODUCTS_EDIT” and “PRODUCTS_LIST” used for the title of the forms in CRUD operations (create, read, update and delete).
The fields ENTITY_PLURAL and ENTITY_SINGLE, are important because they are used for build the site map menu.
You can change any other file, for this example change only 3: "NAME", "PRODUCTMODEL" Relationship to one (Foreign Key) and "PRODUCTSTHISTORIES" (Relationship to many).
- Right click on the application "SFS.AdventureWorks.Web.Mvc" and select "Build" from the context menu.
The application is compiling and generating the assemblies to be deposited in the bin folder of the web project shell (SFSdotNet.Framework.Web.Mvc).
- Run the application.
- Go to “lista de productos” (Sorry by language for this sample)
See how the grid column header "Name" has been changed to "Nombre" and the title of the form has changed to.
- Right click on the row with the Name: “” and select "Details" from the context menu.
This will open the form details of the "Product", and you can see how the strings of the properties have changed.
The effects of the localization are more that this, it is important to note that even with that all functionality related with "business entity" is localized and integrated automatically.
For example, if you return to the "Product List" and click on the link "Abrir búsqueda avanzada", then "Agregar filtro" then you can see that also in the filter engine has the effect of localization.
Now, how does this? Es implementando los atributos de localización en el modelo. It is implementing the localization attributes in the model.
A good practice recommended by Microsoft but that can cost many hours if not using an automation tool.
Setting the language of the application.
In this example we have localized in Spanish - Mexico (es-mx), but you can do to the language you require and you should consider two options: a specific localization language or can be configured automatically in the Shell project's web.config file from SFSdotNet.Framework.Web.Mvc project
- Using a specific language
<globalization culture="es-mx" uiCulture="es-mx" requestEncoding="ISO-8859-1" responseEncoding="ISO-8859-1" fileEncoding="ISO-8859-1"/>
- Using a automatic language
<globalization culture="Auto" uiCulture="Auto" requestEncoding="ISO-8859-1" responseEncoding="ISO-8859-1" fileEncoding="ISO-8859-1"/>
All text in a solution with SFS Tools are fully localized via resource files in one place: the "Resources" folder. Its complexity is reduced to copy, paste and translate.