Making the Note to Self app for Spanish, English, and German speakers
First, we need to add some folders to our project – one for each new language. The text is classed as a resource and, consequently, needs to go in the res folder. Follow these steps to add Spanish and German support to the project.
Note
While the source files for this project are provided in the Chapter 18 folder, they are just for reference. You need to go through the processes described next to achieve multilingual functionality.
Adding Spanish support
Follow these steps to add the Spanish language:
- Right-click on the
resfolder, then select New | Android resource directory. In the Directory name field, typevalues-es. - Now, we need to add a file in which we can place all our Spanish translations.
- Right-click on
res, then select New | Android resource file and typestrings.xmlin the File name field. Typevalues-esin the Directory name field. - We now have a
strings.xmlfile that any device set to use the Spanish language...