Class TranslatedStrings

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.ContentsFlags, android.os.Parcelable.Creator<T>, android.os.Parcelable.Stability, android.os.Parcelable.WriteFlags
    • 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  
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_STABILITY_LOCAL, PARCELABLE_STABILITY_VINTF, PARCELABLE_WRITE_RETURN_VALUE
    • 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 string
      void 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface android.os.Parcelable

        getStability
    • Field Detail

      • 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 interface IStringTranslator
        Parameters:
        original - Original string
        args - Additional string format arguments
        Returns:
        Translated string
      • 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 of Parcelable.writeToParcel(Parcel, int), the return value of this method must include the Parcelable.CONTENTS_FILE_DESCRIPTOR bit.
        Specified by:
        describeContents in interface android.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 interface android.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 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.