LoadedTranslationsProcessor
Translation processor which takes loaded translations and process them to make them regular translation objects that can be used for further work.
-
Method takes base and prefered language translations and also shared expressions and mix them together. Meaning, It checks which base loaded translations are not contained in prefered language translations and allow them to be used by framework later. It fit to the rule of how system localization mechanism work, that when there is no prefered language translation it takes base one if exists and return translation.
Shared expressions are used to replace shared-expression-keys from loaded translations and use resolved full shared expressions from file with expressions as well as built-in ones. Translations are processed in shared expressions processor.
Declaration
Swift
class func processTranslations(baseTranslations: [LoadedTranslation], preferedLanguageTranslations: [LoadedTranslation], sharedExpressions: [SharedExpression]) -> [Translation]Parameters
baseTranslationsAn array of base translations.
prerferedLanguageTranslationsAn array of prefered language translations.
sharedExpressionsAn array of shared expressions.
-
Parses nubmer from length variation key.
Declaration
Swift
private class func parseNumberFromLengthVariation(string: String) -> IntParameters
stringA string that contains length variation string like @100.
Return Value
A number parsed from the string.
View on GitHub
LoadedTranslationsProcessor Class Reference