【问题标题】:Android App Bundle new languageAndroid App Bundle 新语言
【发布时间】:2018-08-20 12:04:05
【问题描述】:

我已将我的应用程序更新为新的 Android App Bundle。我已经在内部测试轨道中上传了一个新的 App Bundle。

现在,当我向手机添加新语言时,它不会像我们预期的那样为我的应用下载相关语言。

是否指定了新语言的下载时间?

提前致谢。

【问题讨论】:

  • 它是什么语言?您的应用程序是否翻译成该语言?另外,设备的操作系统版本是什么?如果设备在连接的网络上,则应立即下载该语言。
  • 尝试了西班牙语和意大利语。是的,该应用程序已翻译成该语言。我尝试在 Oreo 上使用我的 Galaxy S8,但其他人也有这个问题。如果你想试试我的应用程序:play.google.com/store/apps/…
  • 好吧,这次在 10m 之后得到它。

标签: android android-studio android-app-bundle


【解决方案1】:

如果手机中没有该语言,则在下载应用程序时,Google Play 会从应用程序中删除该语言,因为该语言未安装在手机上。

如果您只想为您的应用显示特定语言,您可以在build.gradle 文件中如下所示的参数中设置它。

defaultConfig { 
     resConfigs "en", "ar", "fr"          
}

【讨论】:

    【解决方案2】:

    首先,您需要在应用中添加播放核心依赖项。并按照示例代码进行操作

    1. 请求语言模块

      val manager = SplitInstallManagerFactory.create(this)
      // Skip loading if the module already is installed. Perform success action     directly.
      if (manager.installedModules.contains(targetLocalName)) {
          onSuccessfulLoad(targetLocalName)
          return
      }
      
      val request = SplitInstallRequest.newBuilder()
          .addModule(targetLocalName)
          .build()
      
      // Load and install the requested feature module.
      manager.startInstall(request)
      
    2. 在您的应用程序和活动中安装拆分

      override fun attachBaseContext(newBase: Context) {
         val ctx = LanguageHelper.getLanguageConfigurationContext(newBase)
         super.attachBaseContext(ctx)
         SplitCompat.installActivity(this)
      }
      

    您应该参考文档和动态捆绑演示 doc

    【讨论】:

      猜你喜欢
      • 2021-10-04
      • 2021-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-29
      • 1970-01-01
      • 1970-01-01
      • 2019-07-04
      相关资源
      最近更新 更多