0

So if i am French and browse facebook in French, is it possible for an application to change its locale or language settings based on that of the user? In other words, if i open the facebook app, i would like to see the app content in French. Similarly for any other language. How can this be done?

P.S. I am using the old REST api

Parag
  • 963
  • 2
  • 10
  • 27

2 Answers2

1

Ok a couple of ways to do this:

1) Check for locale in facebook params when the app loads, in particular the "fb_sig_locale" parameter

2) Use fql on user table like so:

select locale from user where uid = '1100100101'
Parag
  • 963
  • 2
  • 10
  • 27
0

setup a before_filter like this (I'm assuming You're using I18n to store the current locale) :

  if request_comes_from_facebook?
    # e.g. "fb_sig_locale"=>"en_US" or "fb_sig_locale"=>"de_DE"
    if fb_locale = params[:fb_sig_locale]
      I18n.locale = fb_locale.sub('_', '-')
    else
      logger.info ":fb_sig_locale parameter not found in request"
    end
  end
kares
  • 7,076
  • 1
  • 28
  • 38