翻譯¶
Your website can be translated into multiple languages, allowing visitors to view its content in their preferred language.
配置¶
Before translating a website into one or more languages, install them on the database. To do so:
转到 。
Under the General section, click Install new languages.
In the dialog box, select one or more Languages from the dropdown menu, click Add, then Close.
Next, add the installed language(s) to the website by selecting them under the Languages field and clicking Save.
小訣竅
To remove a language from a website, click the (Delete) icon next to it.
语言选择器¶
Once another language is added to a website, the language selector is displayed in the website’s header and footer, allowing visitors to switch between languages.
小訣竅
Refresh your browser if the language selector or a language option does not appear.
If the visitor’s browser language is not available, the website will use the website’s default language. To edit it, go to . Under the General section, select the language using the Default field.
To hide or customize the appearance of one of the language selectors, open the website in the default language, click Edit, then select the language selector.
编辑页眉的语言选择器:
在侧边栏中,向下滚动到 语言选择器 部分。
将 样式 设置为 下拉菜单 或 内联显示。
将 标签 设置为 文本、 旗帜、 旗帜和文本 `、:guilabel:`代码 或 旗帜和代码。
按一下 儲存。
小訣竅
若要隐藏页头中的语言选择器,进入 显示 / 隐藏元素 区域,点击 操作`字段旁的图标 :icon:`fa-flag`(:guilabel:`语言选择器)按钮。
编辑页脚的语言选择器:
将 语言选择器 字段设置为 下拉菜单、内联 或 不显示。
将 标签 设置为 文本、 旗帜、 旗帜和文本 `、:guilabel:`代码 或 旗帜和代码。
按一下 儲存。
小訣竅
您可以 根据网站语言显示或隐藏网站元素 。
翻译页面¶
要翻译网站页面,请切换到要翻译的语言,然后点击右上角的 激活翻译模式。
備註
在这个模式,仅能编辑可翻译文本。在使用网站生成器进行任何其他类型的修改时,都必须使用默认语言。
根据添加的语言,一些默认内容可能已经翻译。但是,您手动添加的内容应使用 翻译 功能进行翻译。
当文本以绿色高亮显示时,表示该文本已被翻译(手动或自动)。如果文本以黄色高亮显示,则表示尚未翻译。
点击 已翻译为 字段旁边的绿色按钮,可自动翻译所有突出显示为黄色的文本。您也可以通过选择并编辑文本,手动翻译或调整文本,无论它是以绿色还是黄色突出显示。完成翻译后点击 保存。
小訣竅
不同语言的核心 URL 结构保持一致,而产品名称或类别等特定元素则进行翻译。例如,
https://www.mywebsite.com/shop/product/my-product-1`是产品页面的默认版本,而 `https://www.mywebsite.com/fr/shop/product/mon-produit-1是同一产品页面的翻译版本。结构 (/shop/product/)保持不变,但产品名称 (my-product)被翻译为 (mon-produit)。部分内容(如商品名称)也可从后端进行翻译。