Detailed Description

Displays options for automatically translating your UI language files.

Inheritance diagram for PowerUI.AutoTranslate:

Static Public Member Functions

static void ShowWindow ()
 
static void LoadAvailableLanguages ()
 Loads the set of translate to languages from the languages.txt file. More...
 
static string GetLanguagePath ()
 Attempts to find the Languages/UI folder. More...
 
static string GetLanguagePath (string relativeTo)
 Attempts to find the Languages/UI folder within the given directory. More...
 
static void Perform (bool allowExists)
 Performs the translation using options selected in the open window. More...
 
static bool Perform (string from, string to, string toName, bool allowExists)
 Performs the translation. More...
 
static bool Perform (string languageFile, string from, string to, string toName, bool allowExists)
 Performs the translation. More...
 
static void SaveTranslationKey ()
 Saves the TranslationKey into TranslationKeyFile. More...
 
static void SaveTranslationKey (string key)
 Saves the given TranslationKey into the TranslationKeyFile. More...
 
static string GetTranslationKey ()
 Loads the translation key from the TranslationKeyFile. More...
 

Static Public Attributes

static bool FileExists
 True when the target language file is found, and we'd like to check if overwriting it is ok. More...
 
static bool Translating
 Set to true if a translation is in progress. More...
 
static int SelectedSource
 The selected source file index in the AvailableSource array. More...
 
static string PowerUIPath
 The path to PowerUI. More...
 
static int SelectedTarget
 The selected target langauge index in the AvailableTargets array. More...
 
static string LanguagePath
 The path to the Languages/UI folder. More...
 
static string TranslationKey
 The access key to use when translating. More...
 
static string[] AvailableSource
 The available source languages. More...
 
static string[] AvailableTargets
 The available target languages. Loaded from the languages.txt file. More...
 
static EditorWindow TranslateWindow
 The last opened translate window. More...
 
static string[] AvailableTargetCodes
 The available target language codes. Loaded from the languages.txt file. More...
 

Properties

static string TranslationsPath [get]
 The filepath to the Translations editor folder. More...
 
static string TranslationKeyFile [get]
 The filepath to the file that holds the translation key. More...
 

Private Member Functions

void Update ()
 
void OnGUI ()
 

Static Private Member Functions

static void OnTranslationDone (TranslationInfo info)
 

Static Private Attributes

static bool ShowAPIKey
 True if the API key section is visible. More...
 

Member Function Documentation

static string PowerUI.AutoTranslate.GetLanguagePath ( )
inlinestatic

Attempts to find the Languages/UI folder.

Returns
The path, relative to the project, if it was found.
static string PowerUI.AutoTranslate.GetLanguagePath ( string  relativeTo)
inlinestatic

Attempts to find the Languages/UI folder within the given directory.

Parameters
relativeToThe directory to search from.
Returns
The path, relative to the project, if it was found.
static string PowerUI.AutoTranslate.GetTranslationKey ( )
inlinestatic

Loads the translation key from the TranslationKeyFile.

Returns
The loaded key.
static void PowerUI.AutoTranslate.LoadAvailableLanguages ( )
inlinestatic

Loads the set of translate to languages from the languages.txt file.

void PowerUI.AutoTranslate.OnGUI ( )
inlineprivate
static void PowerUI.AutoTranslate.OnTranslationDone ( TranslationInfo  info)
inlinestaticprivate
static void PowerUI.AutoTranslate.Perform ( bool  allowExists)
inlinestatic

Performs the translation using options selected in the open window.

Parameters
allowExistsTrue if we can safely overwrite the file if it exists.
static bool PowerUI.AutoTranslate.Perform ( string  from,
string  to,
string  toName,
bool  allowExists 
)
inlinestatic

Performs the translation.

Parameters
fromThe filename of the file in the Languages/UI folder, without it's type.
toThe language code that will be translated to, e.g. "fr".
toNameThe language name that will be translated to, e.g. "French".
allowExistsTrue if we can safely overwrite the file if it exists.
static bool PowerUI.AutoTranslate.Perform ( string  languageFile,
string  from,
string  to,
string  toName,
bool  allowExists 
)
inlinestatic

Performs the translation.

Parameters
languageTextThe text to be translated. <v> should be used here.
fromThe language code to translate from, e.g. EN.
toThe language code to translate to, e.g. FR.
toNameThe language name that will be translated to, e.g. "French".
allowExistsTrue if we can safely overwrite the file if it exists.
static void PowerUI.AutoTranslate.SaveTranslationKey ( )
inlinestatic

Saves the TranslationKey into TranslationKeyFile.

static void PowerUI.AutoTranslate.SaveTranslationKey ( string  key)
inlinestatic

Saves the given TranslationKey into the TranslationKeyFile.

Parameters
keyThe key to save.
static void PowerUI.AutoTranslate.ShowWindow ( )
inlinestatic
void PowerUI.AutoTranslate.Update ( )
inlineprivate

Member Data Documentation

string [] PowerUI.AutoTranslate.AvailableSource
static

The available source languages.

string [] PowerUI.AutoTranslate.AvailableTargetCodes
static

The available target language codes. Loaded from the languages.txt file.

string [] PowerUI.AutoTranslate.AvailableTargets
static

The available target languages. Loaded from the languages.txt file.

bool PowerUI.AutoTranslate.FileExists
static

True when the target language file is found, and we'd like to check if overwriting it is ok.

string PowerUI.AutoTranslate.LanguagePath
static

The path to the Languages/UI folder.

string PowerUI.AutoTranslate.PowerUIPath
static

The path to PowerUI.

int PowerUI.AutoTranslate.SelectedSource
static

The selected source file index in the AvailableSource array.

int PowerUI.AutoTranslate.SelectedTarget
static

The selected target langauge index in the AvailableTargets array.

bool PowerUI.AutoTranslate.ShowAPIKey
staticprivate

True if the API key section is visible.

EditorWindow PowerUI.AutoTranslate.TranslateWindow
static

The last opened translate window.

bool PowerUI.AutoTranslate.Translating
static

Set to true if a translation is in progress.

string PowerUI.AutoTranslate.TranslationKey
static

The access key to use when translating.

Property Documentation

string PowerUI.AutoTranslate.TranslationKeyFile
staticget

The filepath to the file that holds the translation key.

string PowerUI.AutoTranslate.TranslationsPath
staticget

The filepath to the Translations editor folder.