Package com.appliedrec.verid.ui2
Class TranslatedStrings
- java.lang.Object
-
- com.appliedrec.verid.ui2.TranslatedStrings
-
- All Implemented Interfaces:
android.os.Parcelable
,ILocaleProvider
,IStringTranslator
public class TranslatedStrings extends java.lang.Object implements IStringTranslator, android.os.Parcelable
Default implementation ofIStringTranslator
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<TranslatedStrings>
CREATOR
static java.lang.String
EXTRA_LOCALE
static java.lang.String
EXTRA_TRANSLATION_ASSET_PATH
static java.lang.String
EXTRA_TRANSLATION_FILE_PATH
-
Constructor Summary
Constructors Modifier Constructor Description TranslatedStrings(android.content.Context context, android.content.Intent intent)
TranslatedStrings(android.content.Context context, android.net.Uri translationFileUri, java.util.Locale locale)
TranslatedStrings(android.content.Context context, java.lang.String assetPath, java.util.Locale locale)
protected
TranslatedStrings(android.os.Parcel in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.java.util.Locale
getLocale()
java.lang.String
getTranslatedString(java.lang.String original, java.lang.Object... args)
Translate a stringvoid
setTranslatedStrings(java.util.Map<java.lang.String,java.lang.String> translations)
void
writeToParcel(android.os.Parcel parcel, int i)
Flatten this object in to a Parcel.
-
-
-
Field Detail
-
EXTRA_LOCALE
public static final java.lang.String EXTRA_LOCALE
- See Also:
- Constant Field Values
-
EXTRA_TRANSLATION_FILE_PATH
public static final java.lang.String EXTRA_TRANSLATION_FILE_PATH
- See Also:
- Constant Field Values
-
EXTRA_TRANSLATION_ASSET_PATH
public static final java.lang.String EXTRA_TRANSLATION_ASSET_PATH
- See Also:
- Constant Field Values
-
CREATOR
public static final android.os.Parcelable.Creator<TranslatedStrings> CREATOR
-
-
Constructor Detail
-
TranslatedStrings
public TranslatedStrings(android.content.Context context, java.lang.String assetPath, java.util.Locale locale)
-
TranslatedStrings
public TranslatedStrings(android.content.Context context, android.net.Uri translationFileUri, java.util.Locale locale)
-
TranslatedStrings
public TranslatedStrings(android.content.Context context, android.content.Intent intent)
-
TranslatedStrings
protected TranslatedStrings(android.os.Parcel in)
-
-
Method Detail
-
setTranslatedStrings
public void setTranslatedStrings(java.util.Map<java.lang.String,java.lang.String> translations)
-
getTranslatedString
@NonNull public java.lang.String getTranslatedString(@NonNull java.lang.String original, java.lang.Object... args)
Description copied from interface:IStringTranslator
Translate a string- Specified by:
getTranslatedString
in interfaceIStringTranslator
- Parameters:
original
- Original stringargs
- Additional string format arguments- Returns:
- Translated string
-
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocale
in interfaceILocaleProvider
-
describeContents
public int describeContents()
Description copied from interface:android.os.Parcelable
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output ofParcelable.writeToParcel(Parcel, int)
, the return value of this method must include theParcelable.CONTENTS_FILE_DESCRIPTOR
bit.- Specified by:
describeContents
in interfaceandroid.os.Parcelable
- Returns:
- a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
-
writeToParcel
public void writeToParcel(android.os.Parcel parcel, int i)
Description copied from interface:android.os.Parcelable
Flatten this object in to a Parcel.- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Parameters:
parcel
- The Parcel in which the object should be written.i
- Additional flags about how the object should be written. May be 0 orParcelable.PARCELABLE_WRITE_RETURN_VALUE
.
-
-