ios - 如何将 Firestore db 用于多语言应用程序?

标签 ios firebase google-cloud-firestore

<分区>


想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post .

关闭 4 年前

我正在开发一个 iOS 应用程序,我需要将数据库的内容翻译成多语言,正如我在使用 Firestore 的应用程序中所说的那样。有人有解决方案吗?

最佳答案

将您需要的文本存储在具有不同语言变体的节点中。当用户注册时,让他们确定他们喜欢哪种语言,然后用他们的语言阅读文本并将其显示在 UI 中。从概念上讲,它看起来像这样:

go_instructions
   en: "Click the GO button to continue"
   fr: "Cliquez sur le bouton GO pour continuer"
   es: "Haga clic en el botón IR para continuar"
email_instructions
   en: "Enter your email address"
   fr: "Entrez votre adresse email"
   es: "Ingrese su dirección de correo electrónico"

显然,使用 Firestore,您会将这些设置为文档,其中包含下面的字段和值,但它应该会让您朝着正确的方向前进。

关于ios - 如何将 Firestore db 用于多语言应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51683781/

上一篇:ios - 即使应用程序卸载后,Secure Enclave key 仍然存在

下一篇:ios - 在 Objective - C 中打印二叉搜索树时遇到 EXC_BAD_ACCESS

相关文章:

ios - 添加了 Fabric Crashlytics 中的测试设备或 Beta 用户无法下载应用程序

flutter - 带有 Flutter 和 Firestore 的 GridView

javascript - Firebase 给出失败的先决条件错误

javascript - 数组 setState 和获取数组 React Native

iphone - animateWithDuration中completion block 中的finished参数是什么意思

iOS 8 启动图像文件 - 导航栏和状态栏

java - Android 中无需登录的 Firebase OTP 验证

ios - Swift Firebase 将 UID 键与 UID 字符串数组匹配

ios - 当应用程序在前台时如何显示 firebase 通知

c# - 如何在构建 UIImageView 时创建图像