I'm working in app that support Arabic and English language using firebase database my question is there is any way I can localize data that come from firebase in my my app
Is there is any way I can localize data that come from firebase in my app?
There are many ways in which you can locate a user, but this requires enabling the device's location, asking for permissions, and so on. This option might not be the best one, because I, as a traveler, if I visit your country and download your app, I'll get Arabic content and I won't be happy with that, because I don't know Arabic. The best option that you have is to display the content according to the language the user has already set on the device. So it doesn't matter where the user is localized, the user will always see the content in the language he likes. For example, if a user from your country will travel to the United States, he will still see the content of your app in Arabic, which makes sense, because it's possible that the user might not know English.
Another option might be to let the user choose the language even from the beginning when first time opens the app. That way, you'll always be sure about the preferred language. However, don't forget to add the option to update this preference later, if needed.
Related
I'm building a single purpose app for one and only one device model. Therefore I allow switching languages within the app as I do not want the user to open the settings.
I was successful in changing the Locale.
I was unsuccessful switching the language input (understand switching the keyboard from thai to english and english to thai).
Note: It comes from factory with English and Thai language inputs already installed and available.
Note 2 : I've seen a load of solution on google but I find none of them precise enough to know if it's doable and how to perform this. I mention this because I'd like to avoid one more copy paste of this solution for eg : Change Keyboard Input Language Programmatically. It might be a good solution, but I just don't get it.
In our Android app, we have an option for the user to change the language, which means he can select whether he want to use English or Sinhala. The default is always in English. We have one string.xml for English and another for Sinhala.
I was referring Android documents about "localization" but that is not exactly what I am looking for, I can't ask the user to change his phone settings. I also noticed programmatic localization which is discussed in here but most users do not recommend it due to loads of errors (anyway these posts are pretty old)
So, what's the best way of changing the String?XML file, with the preferred language of a user? It seems not easy on Android.
Or, is this is simply not a good idea?
I often find myself writing to different people in different languages. Every time I have to switch to the correct language to avoid false auto-correction.
The language only depends on the person I am talking to, that is I will always talk in italian to a, b and c; in english to l and m; in french with x.
Is there a keyboard that keeps track of that, or a way to have it automatically configured when switching contacts?
No
And here is why: the User can set the keyboard in the settings for the phone. Also called input method editor (IME) by google.
As you can see in this developers guide, you can create your own IME.
But the problem is, you need to get the Contact data from the App that you are running (What's App, Telegram, Slack, etc), and unless they support that, what I very much doubt, you will not pull this off.
Maybe, quite hackish.
What might work is that the moment you open your custom IME, it takes a screenshot (not sure it could do that). Use that screenshot to parse out the Contact name. Try to match that with the Accounts on the phone. And use that to set the keyboard... But that is not a Keyboard I would like to have on my phone if it wasn't developed my me!
I'm working on an app that needs to support a large number of languages. Instead of bundling all languages in the app resources, I want to be able to download the language when the user selects a new language from the settings menu.
The Facebook mobile app does this very well. If you are logged in, go to settings> languages > switch language > pick a different language.
I think Facebook are downloading these language resources, Because if i put my phone into airplane mode , it doesn't work ( prompted with try again, or use english as default).
Since the app resources can't be edited at runtime, i'm guessing Facebook are using a database to download the language , then load the translations from there?!
p.s i'm actually trying to do this in Xamarin...trying to understand the Facebook Android approach so I can implement it myself.
I don't know specifically about Facebook, but I know this technique is in use by some people -- I've seen presentations on similar setups from other companies. There are a couple of obvious benefits:
Reduce overall app size by not bundling 30 languages worth of strings.
The ability to improve localized strings without forcing the user to download an app update.
Better data about what languages your users are using.
When I've seen in presented (again, this was not Facebook specifically), it worked much as you suggested -- user selects the preferred language, app fetches a string bundle from the server, then starts using it. Once the language is set, the app can even periodically refresh the localized string bundle to get updates.
However, there are some downsides to be aware of, especially if the localized strings change over time. It can make support tricky -- if a string has changed, a button (for example) might be called different things depending on exactly when the user was using the app. It also will really put pressure on your i18n strategy and QA to make sure the UI looks decent with strings that might be changing frequently.
If you download localization files you will not be able to use the default localization support within Android.
If you do go ahead with this strategy (downloading of localization files), you will need to create your own class to manage this or alternatively, search for a library which does this for you.
I am trying to make small app for android. My idea for app is that user can change the language whichever they want ...etc french , german,chinese , english etc...
how to force the locale language in my app or how to get access to the language used by user on their device and with respect to that I can change my application language.
THank you,
For this you may need to make use of Localization.
Please go through the following example available at the developer site.
May be this can solve your issue.
http://developer.android.com/resources/tutorials/localization/index.html