Class StringsResourceTranslator


  • @Deprecated
    public final class StringsResourceTranslator
    extends java.lang.Object
    Deprecated.
    without replacement since 3.4.2

    A utility which auto-translates English strings in Android string resources using Google Translate.

    Pass the Android client res/ directory as first argument, and optionally message keys who should be forced to retranslate. Usage: StringsResourceTranslator android/res/ [key_1 ...]

    You must set your Google Translate API key into the environment with -DtranslateAPI.key=...

    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private static java.lang.CharSequence fetch​(java.net.URI translateURI)
      Deprecated.
       
      static void main​(java.lang.String[] args)
      Deprecated.
       
      private static java.util.Map<java.lang.String,​java.lang.String> readLines​(java.nio.file.Path file)
      Deprecated.
       
      private static void translate​(java.nio.file.Path englishFile, java.nio.file.Path translatedFile, java.util.Collection<java.lang.String> forceRetranslation)
      Deprecated.
       
      (package private) static java.lang.String translateString​(java.lang.String english, java.lang.String language)
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • API_KEY

        private static final java.lang.String API_KEY
        Deprecated.
      • ENTRY_PATTERN

        private static final java.util.regex.Pattern ENTRY_PATTERN
        Deprecated.
      • STRINGS_FILE_NAME_PATTERN

        private static final java.util.regex.Pattern STRINGS_FILE_NAME_PATTERN
        Deprecated.
      • TRANSLATE_RESPONSE_PATTERN

        private static final java.util.regex.Pattern TRANSLATE_RESPONSE_PATTERN
        Deprecated.
      • VALUES_DIR_PATTERN

        private static final java.util.regex.Pattern VALUES_DIR_PATTERN
        Deprecated.
      • APACHE_2_LICENSE

        private static final java.lang.String APACHE_2_LICENSE
        Deprecated.
        See Also:
        Constant Field Values
      • LANGUAGE_CODE_MASSAGINGS

        private static final java.util.Map<java.lang.String,​java.lang.String> LANGUAGE_CODE_MASSAGINGS
        Deprecated.
    • Constructor Detail

      • StringsResourceTranslator

        private StringsResourceTranslator()
        Deprecated.
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • translate

        private static void translate​(java.nio.file.Path englishFile,
                                      java.nio.file.Path translatedFile,
                                      java.util.Collection<java.lang.String> forceRetranslation)
                               throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • translateString

        static java.lang.String translateString​(java.lang.String english,
                                                java.lang.String language)
                                         throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • fetch

        private static java.lang.CharSequence fetch​(java.net.URI translateURI)
                                             throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • readLines

        private static java.util.Map<java.lang.String,​java.lang.String> readLines​(java.nio.file.Path file)
                                                                                 throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException