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>CREATORstatic java.lang.StringEXTRA_LOCALEstatic java.lang.StringEXTRA_TRANSLATION_ASSET_PATHstatic java.lang.StringEXTRA_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)protectedTranslatedStrings(android.os.Parcel in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.java.util.LocalegetLocale()java.lang.StringgetTranslatedString(java.lang.String original, java.lang.Object... args)Translate a stringvoidsetTranslatedStrings(java.util.Map<java.lang.String,java.lang.String> translations)voidwriteToParcel(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:IStringTranslatorTranslate a string- Specified by:
getTranslatedStringin interfaceIStringTranslator- Parameters:
original- Original stringargs- Additional string format arguments- Returns:
- Translated string
-
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocalein interfaceILocaleProvider
-
describeContents
public int describeContents()
Description copied from interface:android.os.ParcelableDescribe 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_DESCRIPTORbit.- Specified by:
describeContentsin 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.ParcelableFlatten this object in to a Parcel.- Specified by:
writeToParcelin 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.
-
-