Package com.transifex.txnative
Class TranslationMapStorageAndroid
java.lang.Object
com.transifex.common.TranslationMapStorage
com.transifex.txnative.TranslationMapStorageAndroid
A class that extends
TranslationMapStorage
so that translations can be read from the
application's Assets folder.
Translations can be bundled in your application's Assets folder, using the Transifex command-line tool.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.transifex.common.TranslationMapStorage
TranslationMapStorage.AbstractFile, TranslationMapStorage.AbstractFileProvider, TranslationMapStorage.IOFileProvider
-
Field Summary
Fields inherited from class com.transifex.common.TranslationMapStorage
DEFAULT_TRANSLATION_FILENAME, DEFAULT_TRANSLATIONS_DIR_NAME
-
Constructor Summary
ConstructorDescriptionTranslationMapStorageAndroid
(AssetManager manager, String filename) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionfromAssetsDirectory
(String srcDirectoryPath) Loads aLocaleData.TranslationMap
from an application's Assets folder under the provided path.Methods inherited from class com.transifex.common.TranslationMapStorage
fromDisk, fromDisk, toDisk
-
Field Details
-
TAG
-
-
Constructor Details
-
TranslationMapStorageAndroid
Creates a new instance.- Parameters:
manager
- An instance of Android'sAssetManager
;filename
- The name of a locale's translation file.- See Also:
-
-
Method Details
-
fromAssetsDirectory
Loads aLocaleData.TranslationMap
from an application's Assets folder under the provided path.- Parameters:
srcDirectoryPath
- The path to the directory containing translations in the expected format.- Returns:
- The translation map or
null
if the directory isn't found or it's empty. If some locales fail to load, they won't be added in the returned map.
-