Reader small image

You're reading from  Learning Java by Building Android Games - Third Edition

Product typeBook
Published inMar 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800565869
Edition3rd Edition
Languages
Right arrow
Author (1)
John Horton
John Horton
author image
John Horton

John Horton is a programming and gaming enthusiast based in the UK. He has a passion for writing apps, games, books, and blog articles. He is the founder of Game Code School.
Read more about John Horton

Right arrow

Making the Snake game Spanish, English, or German

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. We have already seen the res folder as it is this folder that also contains the drawable folder where we put all our graphics. Follow these steps to add Spanish support to the project.

Important note

While the source files for this project are provided in the Chapter 15 folder on the GitHub repo, 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:

  1. Right-click on the res folder, and then select New | Android resource directory. In the Directory name field, type values-es.
  2. Left-click OK.
  3. Now we need to add a file in which we can place all our Spanish translations. Right-click on res, then select New | Android...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Java by Building Android Games - Third Edition
Published in: Mar 2021Publisher: PacktISBN-13: 9781800565869

Author (1)

author image
John Horton

John Horton is a programming and gaming enthusiast based in the UK. He has a passion for writing apps, games, books, and blog articles. He is the founder of Game Code School.
Read more about John Horton