in iphone sdk 3.0 they have given option of international keyboards.user can choose the keyboard that he want. but how can we localize our application.
for e.g if user have chosen a French language keyboard we should interact with him in french. like alerts and other things should get display in french language.
how can we do this programatically?Is their any option by which we can convert string from english to user's chosen language?
kindly help me
Have a look at the Internationalization Programming Topics on the iPhone Dev Center.
In iOS 4.2 and later, you can use the UITextInputMode class to determine the primary language currently being used for text input.
[UITextInputMode currentInputMode].primaryLanguage will give you an NSString representing the BCP 47 language code such as “es”, “en-US”, or “fr-CA”.
You can register for the UITextInputCurrentInputModeDidChangeNotification to be alerted when the current input mode changes.
As Thomas Müller said, Internationalization Programming Topics is a good place to start.
You might also be interested in the "Getting Your Apps Ready for China and other Hot New Markets" WWDC session.
There is no documented way to know when keyboard changes, nor a documented way to get the current keyboard mode.
With undocumented APIs, you can listen to the UIKeyboardCurrentInputModeDidChangeNotification local notification.
The current input mode can be found from the com.apple.Preferences preferences, using
return CFPreferencesCopyAppValue(CFSTR("KeyboardLastUsed"),
CFSTR("/var/mobile/Library/Preferences/com.apple.Preferences"));
(Note: to test on simulator you need to replace /var/mobile/ by /Users/<user-name>/Library/Application Support/iPhone Simulator/<sdk-version>/.)
Related
Is there any package that I can use to create an app that can process speech to text?
It should include the following features:
offline speech to text
I think the best choice would be https://pub.dev/packages/speech_to_text.
It is frequently updated and you can make it listen continuously if needed.
Another choice could be https://pub.dev/packages/speech_recognition, but according to its docs it could have some limitations.
On iOS, by default the plugin is configured for French, English, Russian, Spanish, Italian. On Android, without additional installations, it will probably works only with the default device locale.
Does it exist an API that would take a string of text, then read it? It would have be a cool feature to offer to people with reading problems. Then they just could tap a button and have it read for them.
Actually, iOS has a feature called VoiceOver that can be enabled in Settings (under Accessibility) that speaks items on the screen. VoiceOver will work (to varying degrees) with any app; you can use the Accessibility API to add more information so VoiceOver does a better job of describing the interface.
More information on VoiceOver
iPhone Accessibility Programming Guide section on VoiceOver
Check out OpenEars, I've used it before, it's a breeze to set up (not sure if it's ARC compatible though). It also has voice recognition too.
There are a great number of tutorials that tell you how to write multilingual apps for the iPhone. I haven't found one though that deals with my particular problem...
There must be a way how an iPhone app can enforce a certain default language if the user runs the iPhone with neither of the languages supported by the app?
Here in Switzerland we speak German, French and Italian (in different parts of the country). German can be considered the "default" language because its share is nearly 65%. Hence, any national retailer has his product descriptions in these three languages. We built an iApp that supports these three languages.
So far so good...as long as users have selected either of the three languages in their iPhone settings everything works as expected. For users that use the iPhone in English, that seems to be a significant number, this goes wrong because the application is displayed in French instead of German (the assumed default language).
Why? Because French by default is higher up in the list of available languages in the iPhone settings than German. The workaround for users is to switch the iPhone from English to German and back. The iPhone places German second in the list of available languages.
How should the app best deal with that? Ahh, of course we could support English for UI elements but our customer's product descriptions simply aren't available in English. Hence, this isn't really an option.
You can let user choose which language to use in app and set it like this:
NSArray *lang = [NSArray arrayWithObjects:#"de", nil];
[[NSUserDefaults standardUserDefaults] setObject:lang forKey:#"AppleLanguages"];
I came up with the same problem some time ago. My way of solving it was to set all the localizable elements programmatically and not rely on the iOS localization at all. I implemented my own language manager that handles localized strings (read from a custom resource file) and tries to choose the best language for the current device (using the rules provided in a custom preference file). Of course, if the current preferred language of the device is available among the localizations, it has the highest priority. I also leave an opportunity to change the language in settings.
I just saw an iphone application that enhances the built in "messages" application to send emotions. What this application does is that it extends the functionality of the Keyboard that appears in notes or messages application, and user can send emotion icons as messages. This application doesn't work when the emotions are sent to other mobile devices (it works only with iPhone), but that's not important. What i'm wondering is, how they did that (extended the built in keyboard)? Do we have API's that let you extend the functionality like this?
Best Regards.
They are part of the font set. called Emoji icons.
Apple's latest iPhone OS update
brought cute little "Emoji" icons for
Asian markets
To use them you need to use the (font) character code for each letter / emoji. I don't know what they are, but a quick google returns, abide a lot of spam, some codes worth trying. A quick script could be made to incrementally loop through each character code, thus finding them all.
A quick google:
Does anyone know if I use emoji unicode in an app's view if Apple considers this out of bounds? I'm not asking about enabling emoji or selling an app that is meant to enable emoji.
And example of the code - which is placing an NSString into a tableViewCell NSLabel:
if([combatCurrentHp intValue] <= [combatMaxHp intValue] / 2) {
characterStats = [characterStats stringByAppendingString:#" \uE022"];
}
This makes an emoji heart appear in the string. Do you guys know if there is a hard and fast rule on if that would get kicked back out of the app store?
I've seen applications that use the Emoji codepoints in the App Store, but I'm not sure if it's permitted or those apps just snuck through. I don't think there is a strict policy on this.
Enabling the emoji keyboard however is forbidden.
2 years late, but just in case anyone else is interested in this question, the official answer is that there's no problem using emoji in your UILabels.
My email to App Review team a year ago:
Hi,
I'd like to seek clarification with regard to the usage of emoji
within an app.
Although emoji input is not enabled for non-Japanese users, all iPhone
can view emoji whether or not emoji input is enabled.
User interface elements such as UILabel can thus display emoji if they
used the appropriate unicode in the text string.
I'm currently working on the next update of my app where I'd like to
display some icons within my text labels, and I couldn't find any
guidelines with regard to the usage of emoji in this manner.
I've attached a screenshot for your reference. I would like to check
if this usage is appropriate for the App Store. Much thanks!
Their response:
Hello,
We see no issues with the use of emoji within the app. Please let us
know if you have additional questions.
Best Regards,
App Review Team iOS Developer Program
Also, my app has been using the emoji for the past one year with no issue.
I don't believe that enabling the Emoji keyboard is forbidden as it is enabled as standard in all Asian countries and there are dozens of apps available in the app store for unlocking it in other countries. Why would Apple incorporate the keyboard in the system if they intended to forbid anyone from ever using it?!