Today, in an increasingly globalized world, it is crucial to have website content that reaches users in different languages.AnQi CMS fully understands this need and provides powerful and flexible multilingual support features to help us easily achieve content internationalization switching and correct display.
Core concept and basic configuration
The AnQi CMS has a clear layered design for multilingual processing.It distinguishes the translation of system-built-in text, custom template text translation, and the organization and display of actual content.This allows us to flexibly meet the multi-language needs in different scenarios.
First, in the "Global Feature Settings" on the backend, you can find an option for the "default language package".This setting is mainly for the built-in interface text of the Anqi CMS system itself, such as the menu items, prompts, and so on.When we select different language packs, the system interface will switch accordingly.However, it should be noted 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 do you 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 the "Latest Product Launch" and an English article, we will create two documents, "Latest Product Launch (Chinese)" and "Latest Product Launch (English)", respectively, in the content management module on the backend.These documents can be different records under the same content model, and users can be guided to the corresponding language version through the front-end navigation or a dedicated language switching feature.
For versions that require high independence, different content structure, or design, consider using the "Multi-site Management" feature of Anqi CMS. For example, you can set up a primary site for Chinese content (yourdomain.comSet up a separate sub-site for English content(en.yourdomain.comEach site has its own independent backend content, templates, and SEO 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 different language versions have significant differences in market positioning and content strategy.
Implement front-end language switching and text translation
How do front-end users switch languages, and how do the static texts in the template (such as "Contact Us", "Home" etc.) display different languages according to the user's choice?This requires us to skillfully use the tags provided by AnQi CMS in the template.
Build a language switcher:AnQi CMS provideslanguagesThe tag is used specifically to generate the switch link for multi-language sites. This makes it very simple to add an intuitive language selection menu on the website front end.
{%- 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 the multi-language site links that are configured, and display the corresponding language names, even including language icons or Emojis. Moreover, it can also help us automatically generate SEO-friendly content.hreflangLabel. Include thesehreflangTags are placed in HTML's<head>An area that can guide search engines to identify different language versions of pages, avoiding duplicate content issues and thus enhancing the website's international SEO performance.
{%- languages websites %}
{%- for item in websites %}
<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
{%- endfor %}
{%- endLanguages %}
Translation template static text:For fixed text in templates, such as navigation menu items, footer copyright information, or a common title on the page, we can usetrTranslate the label. This requires us to create it in the template directory