Building Client/Server Applications Under VB .NET: An Example-Driven Approach
You now have enough information to be able to create your resource files for use with the Employee Edit form. Open the NorthwindTraders Windows application and add a new folder to the NorthwindTraders solution called en-US. Then add an Assembly Resource File to the folder by right-clicking the folder and selecting Add Existing Item; call it NorthwindTraders.en-US.resx (note that you must type in this entire name; if you leave off the .resx extension, the file will not be created properly in the designer). Add the entries to it as shown in Table 13-2 and make sure that the name entry is in all caps (this is a case-sensitive value).
Name | Value |
---|---|
COURTESY | Courtesy |
FIRST_NAME | First Name |
LAST_NAME | Last name |
TITLE | Title |
REPORTS_TO | Reports To |
BIRTH_DATE | Birth Date |
HIRE_DATE | Hire Date |
HOME_PHONE | Home Phone |
EXTENSION | Extension |
ADDRESS | Address |
CITY | City |
REGION | Region |
POSTAL_CODE | Postal Code |
COUNTRY | Country |
PHOTO | Photo |
NOTES | Notes |
SELECTED_TER | Selected Territories |
AVAILABLE_TER | Available Territories |
OK | OK |
CANCEL | Cancel |
Save this file and add another folder to the NorthwindTraders project called fr-FR. Then add another Assembly Resource File to the folder and call it NorthwindTraders.fr-FR.resx (note that you must type in this entire name; if you leave off the .resx extension, the file will not be created properly in the designer).
Tip | You can copy the NorthwindTraders.en-US.resx file to the fr-FR folder and then rename it to NorthwindTraders.fr-FR.resx. Then you can just add it to the solution and you only need to enter the French translation. |
Add the entries to it as shown in Table 13-3.
Name | Value | Literal Translation |
---|---|---|
COURTESY | Courtoisie | |
FIRST_NAME | Premier Nom | |
LAST_NAME | Dernier Nom | |
TITLE | Titre | |
REPORTS_TO | Est sous l'autorit de | Is under the authority of |
BIRTH_DATE | Date de naissance | |
HIRE_DATE | Engager la Date | |
HOME_PHONE | T l phone particulier | |
EXTENSION | T l phoner l'Extension | |
ADDRESS | Adresse | |
CITY | Ville | |
REGION | R gion | |
POSTAL_CODE | Code postal | |
COUNTRY | Pays | |
PHOTO | Photo | |
NOTES | Notes | |
SELECTED_TER | Territoires choisis | |
AVAILABLE_TER | Territoires disponibles | |
OK | D'ACCORD | |
CANCEL | Annuler |
Save this file and add another folder to the NorthwindTraders project called es-ES. Then add another Assembly Resource File to the folder and call it NorthwindTraders.es-ES.resx (note that you must type in this entire name; if you leave off the .resx extension, the file will not be created properly in the designer). Add the entries to it as shown in Table 13-4.
Name | Value | Literal Translation |
---|---|---|
COURTESY | La cortes a | |
FIRST_NAME | Primero Nombre | |
LAST_NAME | El apellido | The surname |
TITLE | El t tulo | |
REPORTS_TO | Los informes a | The reports to |
BIRTH_DATE | La Fecha del nacimiento | |
HIRE_DATE | Emplee la Fecha | |
HOME_PHONE | El Tel fono buscador | |
EXTENSION | La extensi n | |
ADDRESS | La direcci n | |
CITY | La ciudad | |
REGION | La regi n | |
POSTAL_CODE | El C digo postal | |
COUNTRY | El pa s | |
PHOTO | La foto | |
NOTES | Las notas | |
SELECTED_TER | Los Territorios escogidos | |
AVAILABLE_TER | Los Territorios disponibles | |
OK | BUENO | |
CANCEL | Cancele |
When you have finished, save this file as well.
Caution | Be sure to set the Build Action property for each of the .resx files to None. This prevents the file from being built into the application and deployed in an invalid form by accident. The .NET IDE cannot create satellite assemblies. You have placed the resources files in the project because it is easier to keep everything together. |
Категории