Game Development Reference
In-Depth Information
Importing localized text into a project
More information on resources can be found online at the Unity
documentation at http://docs.unity3d.com/ScriptReference/
Resources.html .
The imported text file simply contains all text data to be included in the game,
where each element is associated with its ID. Thus, each string value is married
to an ID, and the ID is consistent across language schemes that allow a seamless
transition between languages. The ID is the one common denominator that makes an
automated localization possible. To implement the localization system in code, we'll
first create an attribute that should be applied to all localized strings. The attribute
defines only the ID to be attached to a specific string variable, as shown in the
following code sample 8-11:
using UnityEngine;
using System.Collections;
//Attribute to attach to string objects
public class LocalizationTextAttribute : System.Attribute
{
//ID to assign
 
Search WWH ::




Custom Search