Hindi characters not rendered properly in Android - localization

I want to test localization in Indian language in Android.
Following is the file string.xml in values folder
<string name="app_name">नमस्ते</string>
<string name="text_a">परिक्षण</string>
I am using AndroidHindi.ttf font.
I want to display the particular text in hindi in adnroid , but while running I am getting unrendered text .
which particular library should I include to display it properly.

you must download your language font file(.ttf) and put in asset folder.
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Akshar.ttf");
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf);
tv.setText("Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's");
Source

Related

How to set font in Texinfo

I'm using the GNU texinfo package to generate both PDF and .info files from a .texi file.
I'm trying to update an old .texi file (not changed since 2001) and generate the same PDF output. I've resolved a number of issues, but there are a couple outstanding. In the old PDF, the title was in Helvetica and body text is Liberation Serif. In the new PDF, both are Computer Modern.
I've read everything that I can find about fonts, but I'm not able to change the fonts. Nothing that I do seems to work. Everything I have tried generates errors.
In my .texi file, before any \setfont directives, I have \def\fontprefix{uh} which, if I read the pdftex.map file correctly, should select the NimbusSanL font set (e.g. uhvr8a.pfb). I get the following errors:
mktexnam: Could not map source abbreviation for uhss10.
kpathsea: Running mktexmf uhss10
! I can't find file uhss10'.
<*> ...ljfour; mag:=1; ; nonstopmode; input uhss10`
Does anyone have a example .texi file which sets the font family to use? Or an explanation of what I'm doing wrong?

Localization in Xcode 10

I have an app where all the user facing strings use NSLocalizableString(). I've never localized an app so I watched WWDC 2018 video New Localization Workflows in Xcode 10. From there I created a new project, a Single View App. Base localization is on by default. On the storyboard I added one UILabel and constrained it in the center of the view. I added an outlet to it in the view controller:
#IBOutlet weak var label: UILabel!
And I set its text in viewDidLoad:
label.text = NSLocalizedString("Hello World", comment: "")
Build and run and it works fine.
Now I add a localization. I select the project and add Spanish.
Then I Export For Localization... on the Editor menu. I open the file through this path:
es.xcloc -> LocalizedContents -> es.xliff
In there I find the "Hello World" key and I change the value to "Hola Mundo" and save the file.
...
<file original="MyProject/en.lproj/Localizable.strings" datatype="plaintext" source-language="en" target-language="es">
<header>
<tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="10.1" build-num="10B61"/>
</header>
<body>
<trans-unit id="Hello World">
<source>Hola Mundo</source>
<note>No comment provided by engineer.</note>
</trans-unit>
</body>
</file>
...
Then back to Xcode and Import Localizations. Here's the first problem:
Why is this a Mismatched Translation?
I go ahead and import anyway. I edit the scheme as follows:
When I run I get "HELLO WORLD". It's uppercase because that's the localization debugging indicating there's no translation.
What am I missing?
We have a few problems here. First, when you do NSLocalizedString("Hello World", comment: "") what is actually happening is that you try to fetch a localized string with key Hello World and since Xcode can't find that key, it returns the key itself, which you set for the label. So, for best practices, consider using a key that doesn't contain a white space on it. Maybe something like hello-world-label. Then, it would be:
NSLocalizedString("hello-world-label", comment: "")
This will generate the following after you export for localization:
<trans-unit id="hello-world-label">
<source>hello-world-label</source>
<note>No comment provided by engineer.</note>
</trans-unit>
And now you have to add <target> tag to specify the actual translation. Therefore:
<trans-unit id="hello-world-label">
<source>hello-world-label</source>
<target>Hola Mundo</target>
<note>No comment provided by engineer.</note>
</trans-unit>
Then just import back the localizations and you should be fine.
EDIT
After doing that, a Localizable.strings file should have been generated. Click on it and take a look into the File Inspector on the right side of Xcode under the Localization section. You will that the file is only localized for Spanish. So go ahead and select English checkbox. Then, your Localizable.strings will be editable for both English and Spanish, as you can see on the figure below:
Now you edit the English version of that file for having both languages in your app.

Zebra ZQ520 printer, download and use new .CPF font with ZPL language

problems to print with different fonts on my Zebra ZQ520:
as described in documentation, I've downloaded some new font through the official Zebra Font Downloader program, comic and verdana. After this, I found the new fonts in E: storage area. So the script:
^XA^HWE:^XZ
give me:
LIST OF FONT LINKS
- DIR E:.
* E:COMIC_02.CPF 7359
* E:VERDAN02.CPF 163 ....
- 66589184 bytes free E: ONBOARD FLASH
and trying to print example string from font downloader program, it print with the installed font with success.
The problem appens if I try to print a label. The printer seems not consider the .CPF files in ZPL commands.
My tests, without success, are:
1) following the procedure indicated in https://km.zebra.com/kb/index?page=content&id=SO7891 , assigning a designator to new font, with the script:
^XA^CWQ,E:COMIC_02.CPF^XZ
and trying to print something as:
^XA^FO50,50^AQN,50,50^FDSAMPLE CoMiC^FS ^XZ
seems not working (is it not possible to assign a designator on .CPF files??)
2) (not working too) test, I tryed to print something with the ^A# command, also without success. Example:
^XA^FO50,50^A#N,50,50,E:COMIC_02.CPF^FDSAMPLE CoMiC^FS ^XZ
Where is the problem? with printer (updated with the last firmware, V76.19.15Z)?
or ZPL can't print font stored in .CPF files?
or ..??
thanks!
The ZQ500 supports multiple printing languages. It ships with the PnP string stating that it is a CPCL printer. This tells the Zebra Setup Utility to generate a CPCL compatible font (.CPF). Since you are looking to print using ZPL you need to generate a font compatible with ZPL.
https://km.zebra.com/resources/sites/ZEBRA/content/live/SOLUTIONS/8000/SO8535/en_US/ZebraNet_Bridge_Font_Converting.pdf
This will use a different program to package a .ttf font for the printer. ZPL has support for truetype fonts so you will have better scaling of the font.
The ^CW and ^A# commands will both work with the ttf font.

Localization Issue in IOS Swift to change langue on button Click

I have tried to follow the below link to achieve localization .
Tutorial
It seems not working ( only English text appears )
My requirement is to change the label/button texts etc. to be changed from English to Arabic language and vice-versa on a button click inside the App.
I have already have a translated Arabic strings available from the client so I dont have to use a translation ( import/export - xliff) . Created 2 string files for English and Arabic separately and calling it ViewDidload() event checking the User had opted for Arabic/English Version.
Please note that I'm trying load the languages dynamically when user clicks button inside my app . Not by changing the device language .
For ex:
Localizable.string ( en)
"Details" = "Details";
Localizable.string(ar)
"Details" = "التفاصيل " ;
retrieval:
btnDetail.setTitle(NSLocalizedString("Details", comment: "More Details"), forState: .Normal)
But its showing only english but not Arabic when I call in buttonclick event to change to Arabic.
Please help. I m new to IOS and Swift.

titanium studio using html tags in strings.xml

In titanium iOS app how can I display string from strings.xml containing html tags.
Following is the string
Rashad Al Moosa\nPartner\neZayed\n\nRashad Al Moosahas a wealth of commercial expertise
What u see in bold does not appear in iOS app only if I remove bold tag string gets displayed.
Does titanium support any html tags within strings.xml?
With iOS:
look at : enter link description here
On Android:
<string name="mr">
<![CDATA[
<b>Rashad Al Moosa<br/>Partner<br>eZayed<br><br></b>
Rashad Al Moosahas a wealth of commercial expertise
]]>
</string>

Resources