java - android reshape all resource file string -
I'm working on a I want to redesign all the resource Can anyone tell me how to do this? Some ideas: string class override So basically you will start by creating the necessary directory structure (link above): and then you fill in the English (default locale), /values/strings.xml Persian, /values-fa/strings.xml: (cited and optimized from the link above) Solution for Language Using Global Static Casing Function # You can now use this function to load Creating a custom class # 2 with overriding settest () for each used UI widgets. Another possibility is to create custom UI widgets which Android app and want to translate it into Persian language. All
string values in the project are saved in a resource
XML file in some
string values in the layout files and in some sections (R. string) is done. When using Persian text in
Android , it needs to be resized to display correctly.
string values without calling the reciep method for every
string value
override resource class Android provides functionality for a multilingual app already. It's better to use the framework function to change your text and instead of different versions of your app for each language. In that case, the App Tools chooses a suitable language from the available languages based on locale settings.
MyProject / res / values / strings.xml value- fa / strings Xml
string value in the file, example:
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Resources & gt; & Lt; String name = "title" & gt; My application & lt; / String & gt; & Lt; String name = "Hello_World" & gt; Hello World! & Lt; / String & gt; & Lt; / Resources & gt;
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Resources & gt; & Lt; String name = "title" & gt; ... & lt; / String & gt; & Lt; String name = "Hello_World" & gt; ... & lt; / String & gt; & Lt; / Resources & gt;
New Fashion Use for Fiber To do this, the settings string is not possible in the string value, therefore the
XML layout (AFAIK), so the following offers assume that all
string values are programmatic Set as
public static final string getLocalizedString (int resId) {if (Locale.getDefault () .tasting (.). PAR ("FAIR") (Persian Rishp Recharge. Resize (getResources (.getString (resId)); } And {return getResources (). GetString (resId); }
string (you must change each event) or you override the GetRessource method Personally I prefer to use a static function due to other problems related to other types of loading resources compared to
string , side effects etc.
PersianReshape call on reshape () . Such as
EditText :
custom text field edits text for the class {@ Override Public Wide Set Text (string text) {super .set text (Persian respepe.rap) (Text)); }} [...] Custom TextFilts myTextBox = New Custom TextField (); myTextBox.setText ("....");
Comments
Post a Comment