Smart Localization  2.3
SmartLocalization.Editor.LanguageHandlerEditor Class Reference

Utility class for handling language files in the editor More...

Static Public Member Functions

static SmartCultureInfoCollection GetNonAvailableLanguages (SmartCultureInfoCollection allCultures)
 Gets a SmartCultureInfoCollection with all the cultures not available in this workspace More...
 
static SmartCultureInfoCollection CheckAndSaveAvailableLanguages (SmartCultureInfoCollection allCultures)
 Checks all the created languages and Saves the AvailableCultures xml. More...
 
static List< string > GetKeysWithinCategory (string category)
 Returns a list of keys within a specified category. Example: If you have keys named My.Key, the category would be "My." More...
 
static void CreateRootResourceFile ()
 Creates the initial root language file More...
 
static void CreateNewLanguage (string languageName, List< List< string >> fromFile=null)
 Creates a new language More...
 
static List< SerializableLocalizationObjectPairCreateSerializableLocalizationList (Dictionary< string, LocalizedObject > languageValues)
 Creates the serializable localization list from the parsed LocalizedObjects More...
 
static void SaveRootLanguageFile (Dictionary< string, string > changedRootKeys, Dictionary< string, string > changedRootValues, SmartCultureInfoCollection availableCultures)
 Saves the root language file and updates all the available languages. More...
 
static void SaveLanguageFile (Dictionary< string, string > languageValueDictionary, string filePath)
 Saves a language file(.resx) at the specified path containing the values in the languageValueDictionary More...
 
static void UpdateLanguageFile (string languageCode, List< List< string >> values)
 
static void BulkUpdateLanguageFiles (List< List< string >> values)
 
static Dictionary< string, LocalizedObjectLoadParsedLanguageFile (string languageCode, bool isRoot)
 Loads the parsed language file.(without the type identifiers) More...
 
static Dictionary< string, string > LoadLanguageFile (string languageCode, bool isRoot)
 Loads the language file and returns the RAW values More...
 
static Dictionary< string, Dictionary< string, string > > LoadAllLanguageFiles ()
 Loads all the language files with their raw values More...
 
static void DeleteLanguage (SmartCultureInfo cultureInfo)
 Deletes the language. More...
 
static void LoadAllAssets (List< SerializableLocalizationObjectPair > languageValues)
 Loads all assets in language values if they have a valid file path More...
 
static string CopyFileIntoResources (SerializableLocalizationObjectPair objectPair, SmartCultureInfo thisCultureInfo)
 Copies the file into the resources folder. Naming the new asset to KEY More...
 
static void DeleteFileFromResources (string key, SmartCultureInfo cultureInfo)
 Deletes the localized file from resources. More...
 
static void RenameFileFromResources (string key, string newKey, SmartCultureInfo cultureInfo)
 Renames the localized file from resources. More...
 

Detailed Description

Utility class for handling language files in the editor

Member Function Documentation

static SmartCultureInfoCollection SmartLocalization.Editor.LanguageHandlerEditor.CheckAndSaveAvailableLanguages ( SmartCultureInfoCollection  allCultures)
static

Checks all the created languages and Saves the AvailableCultures xml.

Parameters
allCulturesA list of all the available cultures
Returns
A list of all the created languages
static string SmartLocalization.Editor.LanguageHandlerEditor.CopyFileIntoResources ( SerializableLocalizationObjectPair  objectPair,
SmartCultureInfo  thisCultureInfo 
)
static

Copies the file into the resources folder. Naming the new asset to KEY

static void SmartLocalization.Editor.LanguageHandlerEditor.CreateNewLanguage ( string  languageName,
List< List< string >>  fromFile = null 
)
static

Creates a new language

Parameters
languageNameThe language code of the language to create
fromFileBase language values to create a language from where each list of strings is a row.
static void SmartLocalization.Editor.LanguageHandlerEditor.CreateRootResourceFile ( )
static

Creates the initial root language file

static List<SerializableLocalizationObjectPair> SmartLocalization.Editor.LanguageHandlerEditor.CreateSerializableLocalizationList ( Dictionary< string, LocalizedObject languageValues)
static

Creates the serializable localization list from the parsed LocalizedObjects

static void SmartLocalization.Editor.LanguageHandlerEditor.DeleteFileFromResources ( string  key,
SmartCultureInfo  cultureInfo 
)
static

Deletes the localized file from resources.

static void SmartLocalization.Editor.LanguageHandlerEditor.DeleteLanguage ( SmartCultureInfo  cultureInfo)
static

Deletes the language.

static List<string> SmartLocalization.Editor.LanguageHandlerEditor.GetKeysWithinCategory ( string  category)
static

Returns a list of keys within a specified category. Example: If you have keys named My.Key, the category would be "My."

Returns
A list of keys that starts with the current category key
Parameters
categoryIf you have keys named My.Key, the category would be "My."
static SmartCultureInfoCollection SmartLocalization.Editor.LanguageHandlerEditor.GetNonAvailableLanguages ( SmartCultureInfoCollection  allCultures)
static

Gets a SmartCultureInfoCollection with all the cultures not available in this workspace

Parameters
allCulturesThe list of all the available cultures
Returns
A SmartCultureInfoCollection with all the cultures not available in this workspace
static void SmartLocalization.Editor.LanguageHandlerEditor.LoadAllAssets ( List< SerializableLocalizationObjectPair languageValues)
static

Loads all assets in language values if they have a valid file path

static Dictionary<string,Dictionary<string,string> > SmartLocalization.Editor.LanguageHandlerEditor.LoadAllLanguageFiles ( )
static

Loads all the language files with their raw values

Returns
A dictionary with all the language dictionaries. The language codes are being used as keys
static Dictionary<string,string> SmartLocalization.Editor.LanguageHandlerEditor.LoadLanguageFile ( string  languageCode,
bool  isRoot 
)
static

Loads the language file and returns the RAW values

static Dictionary<string, LocalizedObject> SmartLocalization.Editor.LanguageHandlerEditor.LoadParsedLanguageFile ( string  languageCode,
bool  isRoot 
)
static

Loads the parsed language file.(without the type identifiers)

static void SmartLocalization.Editor.LanguageHandlerEditor.RenameFileFromResources ( string  key,
string  newKey,
SmartCultureInfo  cultureInfo 
)
static

Renames the localized file from resources.

static void SmartLocalization.Editor.LanguageHandlerEditor.SaveLanguageFile ( Dictionary< string, string >  languageValueDictionary,
string  filePath 
)
static

Saves a language file(.resx) at the specified path containing the values in the languageValueDictionary

static void SmartLocalization.Editor.LanguageHandlerEditor.SaveRootLanguageFile ( Dictionary< string, string >  changedRootKeys,
Dictionary< string, string >  changedRootValues,
SmartCultureInfoCollection  availableCultures 
)
static

Saves the root language file and updates all the available languages.


The documentation for this class was generated from the following file: