C# 클래스 LocFileUtility, SmartLocalization

파일 보기 프로젝트 열기: NiklasBorglund/SmartLocalization 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
resXFileEnding string
rootLanguageFilePath string

공개 메소드들

메소드 설명
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.

메소드 상세

AddNewKeyPersistent() 공개 정적인 메소드

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,
리턴 string

AddNewKeyPersistent() 공개 정적인 메소드

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
리턴 string

CheckAndCreateDirectory() 공개 정적인 메소드

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

CheckAvailableLanguages() 공개 정적인 메소드

Checks the available languages.
public static CheckAvailableLanguages ( List availableLanguages, List notAvailableLanguages, List notAvailableLanguagesEnglishNames ) : void
availableLanguages List
notAvailableLanguages List
notAvailableLanguagesEnglishNames List
리턴 void

CheckIfFileExists() 공개 정적인 메소드

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

CheckIfLanguageFileExists() 공개 정적인 메소드

Checks if language file exists.
public static CheckIfLanguageFileExists ( string language ) : bool
language string /// If set to true language. ///
리턴 bool

CheckIfRootLanguageFileExists() 공개 정적인 메소드

Checks if root language file exists.
public static CheckIfRootLanguageFileExists ( ) : bool
리턴 bool

CopyFileIntoResources() 공개 정적인 메소드

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
리턴 string

CreateNewLanguage() 공개 정적인 메소드

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 ///
리턴 void

CreateRootResourceFile() 공개 정적인 메소드

Creates the root resource file.
public static CreateRootResourceFile ( ) : void
리턴 void

CreateSerializableLocalizationList() 공개 정적인 메소드

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

DeleteFileFromResources() 공개 정적인 메소드

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

DeleteLanguage() 공개 정적인 메소드

Deletes the language.
public static DeleteLanguage ( CultureInfo cultureInfo ) : void
cultureInfo CultureInfo /// Culture info. ///
리턴 void

GetAvailableLanguages() 공개 정적인 메소드

Returns a list with all the available languages
public static GetAvailableLanguages ( ) : List
리턴 List

GetFileExtension() 공개 정적인 메소드

Gets the file extension from the full filePath
public static GetFileExtension ( string fullFilePath ) : string
fullFilePath string /// Full file path. ///
리턴 string

GetFileExtension() 공개 정적인 메소드

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/". ///
리턴 string

LoadAllAssets() 공개 정적인 메소드

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

LoadLanguageFile() 공개 정적인 메소드

Loads the language file and returns the RAW values
public static LoadLanguageFile ( string languageCode ) : string>.Dictionary
languageCode string
리턴 string>.Dictionary

LoadParsedLanguageFile() 공개 정적인 메소드

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

RenameFileFromResources() 공개 정적인 메소드

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. ///
리턴 void

SaveLanguageFile() 공개 정적인 메소드

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. ///
리턴 void

SaveRootLanguageFile() 공개 정적인 메소드

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
리턴 void

프로퍼티 상세

resXFileEnding 공개적으로 정적으로 프로퍼티

public static string resXFileEnding
리턴 string

rootLanguageFilePath 공개적으로 정적으로 프로퍼티

public static string rootLanguageFilePath
리턴 string