【问题标题】:Facebook post in multiple Languages多种语言的 Facebook 帖子
【发布时间】:2014-04-23 06:36:47
【问题描述】:

我正在开发支持 7 种印度语言的 android 应用程序。 当我选择印地语语言并执行 Facebook 帖子时,它不会在 Facebook 墙上显示印地语文本(全部空白),但是当我使用英文文本时,它会显示所有文本。

所以任何人都可以指导我如何在 Facebook 墙上显示其他语言的帖子。

下面是我使用的代码

                .setMessage("राष्ट्रीय")
                .setName("Android Application.")
                .setCaption("One App with 7 language support.")
                .setDescription(
                        "This is dummy app")
                .setPicture(
                        "http://xxxxx.xxxxx.xxx/img/cm/mainhp/logo.gif")
                .setLink("https://www.google.com").build();
        mSimpleFacebook.publish(feed, onPublishListener);

发布此消息后,我在 facebook 墙页中收到一条空白消息

【问题讨论】:

标签: android facebook


【解决方案1】:

3 小时后自己找到解决方案

public static void updateLanguage(Context context, String code)
    {
        Locale locale = new Locale(code);
        Locale.setDefault(locale);
        Configuration config = new Configuration();
        config.locale = locale;
        context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
    }

而在onCreate中调用的关键是

Utils.updateLanguage(getApplicationContext(), "hi");

其中 hi 是印地语的语言代码。

【讨论】:

    猜你喜欢
    • 2012-12-30
    • 1970-01-01
    • 2014-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-16
    • 2019-10-09
    相关资源
    最近更新 更多