FlatRedBall.Localization.LocalizationManager

Introduction

The LocalizationManager is a class that can be used if your game is going to support localization (multiple languages). The LocalizationManager stores a Dictionary of string IDs and their corresponding values for different languages.

Code Example

Typically the LocalizationManager is used in projects with Glue. For information on how to use localization in Glue, see this page.

Assuming you have set up your localization properly through Glue, to access a string, you could do the following:

// This assumes that T_Hello is a valid key in your localization database
string stringId = "T_Hello";

string translatedText = LocalizationManager.Translate(stringId);

// translatedText should now be the translated text in whatever language you're working in.

Did this article leave any questions unanswered? Post any question in our forums for a rapid response.