添加好友欢迎提示语修改中文包没效果

狂扁小朋友 2021-5-10 430

public static void test() throws MalformedURLException {

    // 设置定制的语言国家代码     Locale locale1 = new Locale("zh");     Locale locale2 = new Locale("en");     ResourceBundle rb = ResourceBundle.getBundle("messages", locale1, Loader);

    // 获得相应的key值     String greeting = rb.getString("Above_Greeting_Message");     String userInfo = rb.getString("Friend_Can_Start_Chat");

    System.out.println(greeting);     System.out.println(userInfo); }

上传的附件:
最新回复 (1)
  • HeavyRain 2021-5-11
    引用 2
    IM服务配置文件中有下面一段:
    ##添加好友后会发送欢迎消息,比如"你们已经是好友了,可以聊天了"。这个开关控制是用旧的方式还是用新的方式。
    ##旧的方式会发送notification消息(contenttype是80),内容会根据好友接收者的语言选择对应的语言,如果双方语言不一致会导致另外一方看到的不是本地语言。
    ##新的方式会发送添加好友消息(contenttype是93)和欢迎消息(contenttype是92),需要客户端实现这两种消息。
    ##如果客户端已经实现这两种消息可以打开这个开关
    friend.new_welcome_message false

    把这个开关设置为true,然后客户端实现对欢迎语语言的选择就可以了
返回