Classes
The following classes are available globally.
-
Parses inequality expression patterns. e.g.
See moreie:x=5
.Declaration
Swift
class InequalityExpressionParser: ExpressionParser
-
Parses inequality extended expressions.
See moreiex:5<x<10
.Declaration
Swift
class InequalityExtendedExpressionParser: InequalityExpressionParser
-
Simple JSON file loader.
See moreDeclaration
Swift
final class JSONFileLoader
-
Translation processor which takes loaded translations and process them to make them regular translation objects that can be used for further work.
See moreDeclaration
Swift
class LoadedTranslationsProcessor
-
Class uses NSRegularExpression internally and simplifies its usability.
See moreDeclaration
Swift
final class Regex
-
Parser that parses expressions that contains regular expressions.
See moreDeclaration
Swift
class RegexExpressionParser: ExpressionParser
-
Contains base expressions that matches every country.
See moreDeclaration
Swift
class SharedBaseExpression: SharedExpressionProtocol
-
Used to load content from
See moreexpressions.json
file for specified language.Declaration
Swift
final class SharedExpressionsLoader
-
Swifternalization contains some built-in country-related shared expressions. Developer can create its own expressions in expressions.json file for base and preferred languages.
The class is responsible for proper loading the built-in shared ones and those loaded from project’s files. It handles overriding of built-in and loads those from Base and preferred language version.
It always load base expressions, then looking for language specific. If in Base are some expressions that overrides built-ins, that’s fine. The class adds developer’s custom expressions and adds only those of built-in that are not contained in the Base.
The same is for preferred languages but also here what is important is that at first preferred language file expressions are loaded, then if something different is defined in Base it will be also loaded and then the built-in expression that differs.
See moreDeclaration
Swift
class SharedExpressionsProcessor
-
Contains Polish expressions.
See moreDeclaration
Swift
class SharedPolishExpression: SharedExpressionProtocol
-
This is the main class of Swifternalization library. It exposes methods that can be used to get localized strings.
The framework uses json files and work with them. There are two types of files. First is
expressions.json
that contains shared expressions used among other localizable json files. The other files are files with translation for specific languages. Each file is just for one language. E.g. you can havebase.json
,en.json
,pl.json
which are accordingly used for Base, English and Polish localizations.Before calling any method that return localized string call
See moreconfigure:
.Declaration
Swift
final public class Swifternalization
-
Class that gets dictionary of translations and turn it into
See moreLoadedTranslation
s.Declaration
Swift
final class TranslationsLoader