Firestore翻译文本扩展 - 条件翻译&动态语言

发布于 2025-02-13 06:27:05 字数 1099 浏览 0 评论 0 原文

我正在尝试使用 firebase/ [email  procearted] - - gcloud for Gcloud for Gcloud Translate Translate Translate api api。我缺少两件事,我会填写一个请求,但是如果有一些解决方法,请首先在这里询问:

用例: 客户在应用程序中键入信息。某些字段需要翻译,但翻译是有两个因素的条件。

  1. 用户已启用/禁用翻译。 (如果用户未启用翻译,如何忽略翻译?)
  2. 根据用户的支持语言。 < em>(我没有找到传递动态语言数组的方法,需要在安装步骤设置它们)

在我的情况下,我将在用户文档中有一个用户文档,其中存储诸如语言: [en,es,fr,de] 和 istranslationEnabled:true ,侦听器可以以某种方式使用这些>触发和使用langs。

扩展:

额外:可以翻译已经存在的内容吗?而不是一个一个人更新 - &gt;触发了翻译

,这是一个很棒的扩展名,效果很棒,我只是缺少满足我的要求的这些功能,这并不意味着它不是您的。另一方面,我认为此功能可能是常用/需要的。谢谢Firebase团队!

I am trying to use firebase/[email protected] - the Firebase extension for GCloud Translate API. I am missing 2 things, I'll fill in a request but in case there is some workaround, going to ask here first:

USE CASE:
Clients type information in the app. Certain fields need translations, but translations are conditional upon two factors.

  1. User has enabled/disabled translations. (How to ignore translations if user hasn't enabled translations?)
  2. The supported languages as per user. (I didn't find a way to pass dynamic array of languages, they need to be set up at installation step)

In my case, I will have a user document under users collection where storing preferences like languages: [en, es, fr, de] and isTranslationEnabled: true and those can be used by the listener somehow to either trigger or not, and to use the langs.

Extension: https://firebase.google.com/products/extensions/firebase-firestore-translate-text

EXTRA: Is possible to translate the already existing content? instead of going one by one to update -> triggers the translation

Btw, this is a great extension that works fantastic, I am just missing those features to fulfill my requirements, it doesn't mean it doesn't yours. By other hand, I think this features might be commonly used/needed among others. Thanks Firebase Team!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文