user430926
user430926

Reputation: 4057

Localization of Facebook

I am working on an Android game.. I live in Taiwan but i want to make an English game, i have some problem when using facebook login Dialog is always loaded in Chinese. Is there any way i can change it to English which is the same with the device's language?

Thanks,

Eve

Upvotes: 0

Views: 3010

Answers (2)

Harish Sharma
Harish Sharma

Reputation: 370

Make changes in the facebook-android-sdk-4.0.0/facebook/src/com/facebook/internal/WebDialog.java file in your facebook sdk.

You need to make changes in the constructor

public WebDialog(Context context, String action, Bundle parameters, int theme, OnCompleteListener listener)

Add the code mentioned below in it before

Uri uri = Utility.buildUri(
    ServerProtocol.getDialogAuthority(),
    ServerProtocol.getAPIVersion() + "/" + ServerProtocol.DIALOG_PATH + action, parameters
);

//FOR APP SPECIFIC LOCALE
parameters.putString("locale2", context.getResources().getConfiguration().locale.toString());

or

parameters.putString("locale2", **LOCALE_YOU_WANT_TO_SET**);

Upvotes: 2

BeRecursive
BeRecursive

Reputation: 6376

Change the localization string in Facebook when you make the API calls:

Internationalization Facebook Connect features are available many locales. You can replace the en_US locale specifed above with one of the supported Facebook Locales. For example, to load up the library and trigger dialogs, popups and plugins to be in Hindi (hi_IN), you can load the library from this URL:

http://connect.facebook.net/hi_IN/all.js

So in the Android SDK change any calls to facebook to have the en_US Internationalization tag

If you want to match it to the phone's language then you will need to change the SDK to make a call to the Android system settings and replace the tag appropriately - http://developer.android.com/guide/topics/resources/localization.htmlt

Upvotes: 2

Related Questions