如何更改DBML(facebook)首选语言?

时间:2011-07-28 07:24:45

标签: c# asp.net facebook fbml

我要覆盖FB首选语言;举个例子:

public static string ScriptUrl
{
    get
    {
        string name = System.Threading.Thread.CurrentThread.CurrentCulture.Name;

            switch (System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName)
            {
                case "en":
                    //
                    //  Facebook has no en-CA script so we use en-US
                    //
                    name = "en_US";
                    break;
                //case "fr":
                //    name = "fr_CA";
                //    break;

                default:
                    name = name.Replace("-", "_");
                    break;
            }

            return "connect.facebook.net/" + name + "/all.js#xfbml=1";
        }
    }

我该怎么做?

1 个答案:

答案 0 :(得分:0)

看起来你走在正确的轨道上。您可以通过替换http://connect.facebook.net/en_US/all.js中的en_US来切换连接库的默认语言。