如何在没有任何应用程序的情况下在Shopify中制作更改语言系统

发布于 2025-01-30 18:12:06 字数 85 浏览 0 评论 0原文

如何在没有任何应用程序的情况下在Shopify中制作更改语言系统? 我有2个位置文件:ru,lv 我需要通过任何URL更改语言或类似的内容,如何使其起作用?

How to make change language system in shopify without any apps?
i have 2 locales file: ru, lv
and i need to change language by any url or something like that, how to make it work?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十级心震 2025-02-06 18:12:07

Shopify商店用多种语言出售时可以为它们产生动态URL。当您添加额外的语言环境(您已经做过)时,Shopify会自动为其创建URL路径。

一些示例:

https://myshop.com -> Refers to your `locales/*.default.json`
https://myshop.com/ru -> Refers to your `locales/ru.json`
https://myshop.com/lv -> Refers to your `locales/lv.json`

因此,解决问题的解决方案是简单地将用户重定向到另一个语言环境路径(或通过语言选择器)。

我建议阅读Shopify的支持多种货币和语言文档。

Shopify stores can have dynamic URLs generated for them when they sell in multiple languages. When you add an additional locale (which you already did), Shopify automatically creates a URL path for it.

Some examples:

https://myshop.com -> Refers to your `locales/*.default.json`
https://myshop.com/ru -> Refers to your `locales/ru.json`
https://myshop.com/lv -> Refers to your `locales/lv.json`

So the solution to your problem is to simply redirect a user to another locale path (or give users the possibility to it via language selector).

I recommend reading Shopify's Support multiple currencies and languages documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文