提取导轨I18N翻译要在React中呈现

发布于 2025-01-25 17:39:12 字数 187 浏览 2 评论 0原文

我有一个React/Rails应用程序,我正在设置I18N翻译。使用rails-i18n和i18n.js宝石。我有英语和西班牙语的en.yml和es.yml文件。翻译似乎适合此应用程序。我能够在视图中获得翻译。但是,有第二个React/Redux应用程序,可以将API调用到同一后端。是否可以使用我在轨道上已经拥有的翻译?如果是这样,设置翻译的最佳方法是什么?

I have a React/Rails application which I am setting up i18n translations. Using rails-i18n and i18n.js gems. I have en.yml and es.yml files for english and spanish. The translations seem to work well for this application. I am able to get the translations rendered in the in the view. However, there is a second React/Redux application which makes api calls to this same backend. Is it possible to use the translations I already have in Rails? If so, what is the best way to set the translations?

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

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

发布评论

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