Android Programming Press on the image to return to the main documentation page.

ahaTranslate

Written by aha!dev

List of types:

ahaTranslate

ahaTranslate


Events:

None

Members:


  AutoTranslateActivity (Activity As ActivityWrapper) As String

  Class_Globals As String

  GetAndroidBitmap (Key As String) As BitmapWrapper

  GetAndroidDrawable (Key As String) As Object

  GetDeviceDateFormatSettings As String

  GetPhoneCurrencySymbol As String

  GetPhoneLanguage As String

  GetResourceBitmap (Key As String) As BitmapWrapper

  GetResourceDrawable (Key As String) As Object

  GetResourceString (Key As String) As String

  GetResourceStringArray (Key As String) As String()

  GetResourceStringPlural (Key As String, Count As Int) As String

  GetResourceStringWithParams (Key As String, Params As List) As String

  Initialize As String

  IsInitialized As Boolean

Members description:

AutoTranslateActivity (Activity As ActivityWrapper) As String
Translates a whole activity. The Tag information of the controls is used. The tag corresponds to the name in the strings.xml file
Supported: label, button, checkbox, edittext, radiobutton, togglebutton, spinner
ATTN: ToggleButtons have to states. ON and OFF. If you use "togglebuttontext" as key in the Tag-Property, you must have 2 Strings in the strings.xml file:
togglebuttontextON and togglebuttontextOFF!
Class_Globals As String
GetAndroidBitmap (Key As String) As BitmapWrapper
Gets a drawable from the Android System resources returned as bitmap, returnes Null if drawable not found
Here is a list of the possible drawables:
http://androiddrawableexplorer.appspot.com/
System drawables
You can also look in your SDK-folder: \platforms\android-\data\res\
use the name without the .png extension
GetAndroidDrawable (Key As String) As Object
Gets a drawable from the Android System resources, returnes Null if drawable not found
Here is a list of the possible drawables:
http://androiddrawableexplorer.appspot.com/
System drawables
You can also look in your SDK-folder: \platforms\android-\data\res\
use the name without the .png extension
GetDeviceDateFormatSettings As String
Gets the phone Date Settings' returns "MM/dd/yyyy" on error
GetPhoneCurrencySymbol As String
Gets the phone currency Symbol. If it's not found, $ is returned
GetPhoneLanguage As String
Gets the phone language and returns the 2-Letter Code (en for english, de for German..)
If language cannnot be determined, 'en' is returned
Returned string is lowercase
You can find a list here: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
List
GetResourceBitmap (Key As String) As BitmapWrapper
Loads the drawable from the ressources directory (res/drawable) and returnes it as a bitmap. Use res/drawable-de etc for localisation
Returns Null if not found
GetResourceDrawable (Key As String) As Object
Loads the drawable from the ressources directory (res/drawable). Use res/drawable-de etc for localisation
Returns Null if not found
GetResourceString (Key As String) As String
Gets the translation for a specific key
If no localized String is found, the appropiate String from "values/strings.xml" is is used.
If the Key doesn't exists, it returns "No translation found!"
GetResourceStringArray (Key As String) As String()
Gets an StringArray
If no localized StringArray is found, the appropiate StringArray from "values/strings.xml" is is used.
If the Key doesn't exists, it returns "No translation found!"
GetResourceStringPlural (Key As String, Count As Int) As String
Gets localized Plurals. You have to pass the Count. For example:
count = 1: Returns day
count =>2: Returns days..
Quantity Strings.
See http://developer.android.com/guide/topics/resources/string-resource.html => Quantity Strings for more information
GetResourceStringWithParams (Key As String, Params As List) As String
Gets the translation for a specific key with the use od Parameters.
string.xml: Hi {1} {2}!
B4A: GetResourceStringWithParams("Hello",Array As String("World",":)")
=> Returnes: Hi World :)!
If no localized String is found, the appropiate String from "values/strings.xml" is is used.
If the Key doesn't exists, it returns "No translation found!"
Initialize As String
IsInitialized As Boolean
Tests whether the object has been initialized.
Top