C# Class LocFileUtility, SmartLocalization

Afficher le fichier Open project: NiklasBorglund/SmartLocalization Class Usage Examples

Méthodes publiques

Свойство Type Description
resXFileEnding string
rootLanguageFilePath string

Méthodes publiques

Méthode Description
AddNewKeyPersistent ( LocalizedObject>.Dictionary thisDictionary, string desiredKey, LocalizedObject, newValue ) : string

Adds a new key to a dictionary and does not stop until a unique key is found

AddNewKeyPersistent ( string>.Dictionary thisDictionary, string desiredKey, string newValue ) : string

Adds a new key to a dictionary and does not stop until a unique key is found

CheckAndCreateDirectory ( string path ) : void

Checks if the directory exist the and creates it if it doesn't

CheckAvailableLanguages ( List availableLanguages, List notAvailableLanguages, List notAvailableLanguagesEnglishNames ) : void

Checks the available languages.

CheckIfFileExists ( string filePath ) : bool

Checks if file exists.(Full filepath)

CheckIfLanguageFileExists ( string language ) : bool

Checks if language file exists.

CheckIfRootLanguageFileExists ( ) : bool

Checks if root language file exists.

CopyFileIntoResources ( SerializableLocalizationObjectPair, objectPair, CultureInfo thisCultureInfo ) : string

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

CreateNewLanguage ( string languageName ) : void

Creates a new language file with the keys from the root file.

CreateRootResourceFile ( ) : void

Creates the root resource file.

CreateSerializableLocalizationList ( LocalizedObject>.Dictionary languageValues ) : List

Creates the serializable localization list from the parsed LocalizedObjects

DeleteFileFromResources ( string key, CultureInfo thisCultureInfo ) : void

Deletes the localized file from resources.

DeleteLanguage ( CultureInfo cultureInfo ) : void

Deletes the language.

GetAvailableLanguages ( ) : List

Returns a list with all the available languages

GetFileExtension ( string fullFilePath ) : string

Gets the file extension from the full filePath

GetFileExtension ( string fileName, string relativeFolderPath ) : string

Gets the file extension for the file at the specified path

LoadAllAssets ( List thisLanguageValues ) : void

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

LoadLanguageFile ( string languageCode ) : string>.Dictionary

Loads the language file and returns the RAW values

LoadParsedLanguageFile ( string languageCode ) : LocalizedObject>.Dictionary

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

RenameFileFromResources ( string key, string newKey, CultureInfo thisCultureInfo ) : void

Renames the localized file from resources.

SaveLanguageFile ( string>.Dictionary languageValueDictionary, string filePath ) : void

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

SaveRootLanguageFile ( string>.Dictionary changedRootKeys, string>.Dictionary changedRootValues ) : void

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

Method Details

AddNewKeyPersistent() public static méthode

Adds a new key to a dictionary and does not stop until a unique key is found
public static AddNewKeyPersistent ( LocalizedObject>.Dictionary thisDictionary, string desiredKey, LocalizedObject, newValue ) : string
thisDictionary LocalizedObject>.Dictionary
desiredKey string
newValue LocalizedObject,
Résultat string

AddNewKeyPersistent() public static méthode

Adds a new key to a dictionary and does not stop until a unique key is found
public static AddNewKeyPersistent ( string>.Dictionary thisDictionary, string desiredKey, string newValue ) : string
thisDictionary string>.Dictionary
desiredKey string
newValue string
Résultat string

CheckAndCreateDirectory() public static méthode

Checks if the directory exist the and creates it if it doesn't
public static CheckAndCreateDirectory ( string path ) : void
path string
Résultat void

CheckAvailableLanguages() public static méthode

Checks the available languages.
public static CheckAvailableLanguages ( List availableLanguages, List notAvailableLanguages, List notAvailableLanguagesEnglishNames ) : void
availableLanguages List
notAvailableLanguages List
notAvailableLanguagesEnglishNames List
Résultat void

CheckIfFileExists() public static méthode

Checks if file exists.(Full filepath)
public static CheckIfFileExists ( string filePath ) : bool
filePath string /// If set to true file path. ///
Résultat bool

CheckIfLanguageFileExists() public static méthode

Checks if language file exists.
public static CheckIfLanguageFileExists ( string language ) : bool
language string /// If set to true language. ///
Résultat bool

CheckIfRootLanguageFileExists() public static méthode

Checks if root language file exists.
public static CheckIfRootLanguageFileExists ( ) : bool
Résultat bool

CopyFileIntoResources() public static méthode

Copies the file into the resources folder. Naming the new asset to KEY
public static CopyFileIntoResources ( SerializableLocalizationObjectPair, objectPair, CultureInfo thisCultureInfo ) : string
objectPair SerializableLocalizationObjectPair, /// Object pair. ///
thisCultureInfo CultureInfo
Résultat string

CreateNewLanguage() public static méthode

Creates a new language file with the keys from the root file.
public static CreateNewLanguage ( string languageName ) : void
languageName string /// The name of the language ///
Résultat void

CreateRootResourceFile() public static méthode

Creates the root resource file.
public static CreateRootResourceFile ( ) : void
Résultat void

CreateSerializableLocalizationList() public static méthode

Creates the serializable localization list from the parsed LocalizedObjects
public static CreateSerializableLocalizationList ( LocalizedObject>.Dictionary languageValues ) : List
languageValues LocalizedObject>.Dictionary /// Language values. ///
Résultat List

DeleteFileFromResources() public static méthode

Deletes the localized file from resources.
public static DeleteFileFromResources ( string key, CultureInfo thisCultureInfo ) : void
key string /// Key. ///
thisCultureInfo CultureInfo /// This culture info. ///
Résultat void

DeleteLanguage() public static méthode

Deletes the language.
public static DeleteLanguage ( CultureInfo cultureInfo ) : void
cultureInfo CultureInfo /// Culture info. ///
Résultat void

GetAvailableLanguages() public static méthode

Returns a list with all the available languages
public static GetAvailableLanguages ( ) : List
Résultat List

GetFileExtension() public static méthode

Gets the file extension from the full filePath
public static GetFileExtension ( string fullFilePath ) : string
fullFilePath string /// Full file path. ///
Résultat string

GetFileExtension() public static méthode

Gets the file extension for the file at the specified path
public static GetFileExtension ( string fileName, string relativeFolderPath ) : string
fileName string /// The file name without the extension. If the full name is for example hello.png, this parameter /// should be only "hello" ///
relativeFolderPath string /// The relative path to the folder containing the asset file /// relativeFolderPath should be relative to the project folder. Like: "Assets/MyTextures/". ///
Résultat string

LoadAllAssets() public static méthode

Loads all assets in language values if they have a valid file path
public static LoadAllAssets ( List thisLanguageValues ) : void
thisLanguageValues List
Résultat void

LoadLanguageFile() public static méthode

Loads the language file and returns the RAW values
public static LoadLanguageFile ( string languageCode ) : string>.Dictionary
languageCode string
Résultat string>.Dictionary

LoadParsedLanguageFile() public static méthode

Loads the parsed language file.(without the type identifiers)
public static LoadParsedLanguageFile ( string languageCode ) : LocalizedObject>.Dictionary
languageCode string /// Language code. ///
Résultat LocalizedObject>.Dictionary

RenameFileFromResources() public static méthode

Renames the localized file from resources.
public static RenameFileFromResources ( string key, string newKey, CultureInfo thisCultureInfo ) : void
key string /// Key. ///
newKey string
thisCultureInfo CultureInfo /// This culture info. ///
Résultat void

SaveLanguageFile() public static méthode

Saves a language file(.resx) at the specified path containing the values in the languageValueDictionary
public static SaveLanguageFile ( string>.Dictionary languageValueDictionary, string filePath ) : void
languageValueDictionary string>.Dictionary /// Language value dictionary. ///
filePath string /// File path. ///
Résultat void

SaveRootLanguageFile() public static méthode

Saves the root language file and updates all the available languages.
public static SaveRootLanguageFile ( string>.Dictionary changedRootKeys, string>.Dictionary changedRootValues ) : void
changedRootKeys string>.Dictionary
changedRootValues string>.Dictionary
Résultat void

Property Details

resXFileEnding public_oe static_oe property

public static string resXFileEnding
Résultat string

rootLanguageFilePath public_oe static_oe property

public static string rootLanguageFilePath
Résultat string