Today, in the era of globalization, it is crucial to make website content accessible to users of different languages.The CMS knows this requirement and provides powerful and flexible multilingual support features to help us easily achieve content internationalization and correct display.
Core Concept and Basic Configuration
The Auto CMS has a clear layered design in handling multilingual issues.It distinguishes the translation of built-in system text, the translation of custom template text, and the organization and display of actual content.This allows us to flexibly meet the needs of multilingualism in different scenarios.
Firstly, in the "Global Feature SettingsThis setting is mainly for the built-in interface text of the Anqi CMS system itself, such as the menu items, prompt information, etc.When we select different language packs, the system interface will switch accordingly.However, it is important to note that this setting will not directly change the language of the articles, products, or categories we publish, nor will it automatically translate the static text in template files.Its role is more to make the system's management environment conform to the operator's language habits.
Organizing Multilingual Content: Flexible Strategy
How to organize and display content in different languages? Anqi CMS provides several flexible strategies to manage actual multilingual content.
The most direct and common way is to create independent content entries for each target language.For example, if we have a Chinese article about 'Latest Product Release' and an English article, we will create two documents in the backend content management module separately, namely 'Latest Product Release (Chinese)' and 'Latest Product Launch (English)'.These documents can be different records under the same content model, and users can be guided to access the corresponding language version through the front-end navigation or a dedicated language switch feature.
For versions of multiple languages that require high independence, content structure, or design that may be completely different, consider using the "Multi-site Management" feature of Anqi CMS. For example, a main site can be set for Chinese content.yourdomain.com),再为英文内容设置一个独立的子站点(Englishen.yourdomain.comEnglishEach site has its own independent backend content, templates, and pseudo-static rules, thus achieving complete separation and customization of language content.This approach is relatively independent in management but provides the greatest flexibility, especially suitable for scenarios where there are significant differences in market positioning and content strategy among different language versions.
实现前端语言切换与文本翻译English
Build a language switcher:AnQi CMS provideslanguagesTags, specifically used for generating multi-language site switching links. This makes it very easy to add an intuitive language selection menu on the website frontend.
{%- languages websites %}
{%- if websites %}
<div>
<span>切换语言:</span>
{%- for item in websites %}
<a href="{{item.Link}}">
{%- if item.LanguageIcon %}
<img src="{{item.LanguageIcon}}" alt="{{item.LanguageName}}" />
{%- else %}
{{item.LanguageEmoji}}
{% endif %}
{{item.LanguageName}}
</a>
{%- endfor %}
</div>
{%- endif %}
{%- endLanguages %}
This code can dynamically list all configured multilingual site links and display the corresponding language name, even including language icons or Emoji. More importantly, it can also help us automatically generate SEO-friendly content.hreflangLabel. ThesehreflangLabel placement in HTML's<head>Area, which can guide search engines to identify different language versions of pages, avoid duplicate content issues, and thus enhance the international SEO performance of the website.
{%- languages websites %}
{%- for item in websites %}
<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
{%- endfor %}
{%- endLanguages %}
Translate template static text:For fixed text in the template, such as navigation menu items, footer copyright information, or a common title on the page, we can usetrLabel translation. This requires us to create under the template directory