Under the trend of globalization, providing multilingual content has become a basic requirement for websites to reach a wider audience.AnQiCMS (AnQiCMS) gave full consideration to this from the very beginning, providing users with an effective way to configure and display multilingual content through its powerful multi-site management and flexible template system, in order to meet the needs of visitors from different regions.
Understanding the multilingual operation mechanism of Anqi CMS
In AnQi CMS, the implementation of multilingualism is mainly divided into two levels: one is the language switching of the system backend and frontend interface, and the other is the multilingual display of actual content (articles, products, pages, etc.) for visitors.
For some built-in prompt information in the system backend and frontend interface, Anqi CMS provides the "default language package" feature.You can choose Chinese or English language packs in the system settings.This will change the system's language environment, making the background operations and some default prompts appear in the selected language.Please note that this will not automatically translate the core content of your website articles, product descriptions, and so on.
To implement multilingual core content on the website, Anqi CMS adopts the 'Multi-site Management' strategy.This means you will create a separate site for each target language, each site carrying content specific to the language, together forming a multilingual website group.
Configure the background: Build a multilingual site cluster
The first step to implementing multilingual content display is to configure the corresponding language site in the AnqiCMS background.
Create an independent language site:By using the "Multi-site Management" feature of AnQi CMS, you can create a new site for each target language. For example, if your main site is in Chinese, you can create a new site named "English Site" and bind it to an English domain name (such as
en.yourdomain.comoryourdomain.com/en/). When creating a new site, make sure to specify an independent site name, website address, and database name for each language site to ensure data isolation and management.Prepare specific language content:In each independent language site, you need to create and publish content in the corresponding language separately.For example, publish Chinese articles on Chinese sites, and publish English translations of these articles on English sites.The content model, article management, product management, and other functions of Anqi CMS will allow you to maintain a unique content library for each language site.
Language package settings (auxiliary):In the system settings of each language site, you can select its "default language package".Although this mainly affects the system interface, it can provide a unified language environment for the internal management of multilingual sites and some automatically generated text (such as date formats, etc).
Front-end template: smart display and seamless switching
How to allow users to easily access and understand the multilingual content after it is configured, is the key to user experience. The template mechanism of Anqi CMS provides strong support.
Translation of fixed text in the template:Website templates often contain fixed texts such as 'Contact Us', 'Product Categories', 'Read More', etc. Anqi CMS provides
{% tr "键名" %}Translation label, cooperatelocalesLanguage configuration file under directory (such aszh-cn/default.ymlanden-us/default.yml), it can dynamically translate these fixed text. When the user switches languages, the static text in these templates will automatically display the corresponding language text according to the language configuration of the current site, without modifying the template code.Build a language switcher:
{% languages websites %}Tags are the tools for language switching. Through this tag, you can retrieve the list of all configured language sites, including their language names, language codes, and corresponding link addresses.You can place a language switcher at the top, bottom, or sidebar of the website, and users can click to jump to the site in the corresponding language.For example, you can use it to generate the following toggle link:{%- languages websites %} {%- if websites %} <div> {%- for item in websites %} <a href="{{item.Link}}">{{item.LanguageName}}</a> {%- endfor %} </div> {%- endif %} {%- endlanguages %}Intelligent recognition of content tags:whether it is
{% archiveDetail %}used to obtain article details,{% categoryList %}To get the classification list, or{% pageDetail %}Used to obtain single-page content, these core content calls have the ability to intelligently recognize the current site.This means that when the user visits the English site, these tags will automatically extract English content from the English site's database;When accessing Chinese websites, Chinese content will be extracted. You do not need to write different content call logic for each language.SEO optimization:
hreflangIntegration of tags:To help search engines understand the structure of your multilingual content, AnQi CMS's{% languages %}Labels also support generationhreflangproperty. You can find it on the website's<head>Partially using this tag, it provides precise language and regional hints for search engines, avoids duplicate content issues, and ensures that users see pages that match their language preferences in search results.{%- languages websites %} {%- for item in websites %} <link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}"> {%- endfor %} {%- endlanguages %}
Optimize user experience and search engine performance
By the above configuration, AnQi CMS helps you build a clear structure, rich content, and friendly multilingual website for both users and search engines.Users can seamlessly switch to the website version of their preferred language to enjoy a more considerate browsing experience.At the same time, with the help ofhreflangA label and a clear URL structure (configured as a subdirectory or subdomain through pseudo-static rules), search engines can accurately understand the relationship between different language versions, improving the visibility and ranking of the website globally.
A safe CMS provides an efficient and easy-to-implement multilingual solution through multi-site management and flexible template tags.Whether it is language support at the system level or fine management at the content level, the aim is to help your website easily expand into the global market and reach a wider audience.
Frequently Asked Questions (FAQ)
1. The 'default language package' of Anq CMS and{% tr %}What is the difference between translation tags?The default language package mainly affects the management interface of the Anqi CMS system and some automatically generated prompts in the front-end templates (such as certain date formats, default error messages, etc.).It changes the system environment's language. And{% tr %}Translation tags are used to translate the fixed text content that you hard-code in the template (such as navigation menu items, button text, footer statements, etc.), which requires you to manually translate inlocalesperforming in the language file under the folder