Take your website global: The multi-language content strategy and implementation of Anqi CMS
In today's globalized digital age, many businesses and content creators hope that their websites can reach a wider audience.This means providing content display and switching functionality in multiple languages to meet the reading habits of users in different countries and regions.AnQiCMS (AnQiCMS) is an efficient content management system that fully considers this requirement, providing a flexible solution to help you easily implement multi-language functions on your website.
In AnQi CMS, implementing multi-language display and switching of content is not as simple as checking a box in the backend. It is more of a strategic layout that combines the three core pillars of system-level language packages, template layer translation, and multi-site management.Understanding how these three work together is the key to efficiently building a multilingual website.
Firstly, we need to clarify a concept: in the handling of multiple languages, the 'System Interface Language' and 'User Content Language' are distinguished in the AnQi CMS.The system interface language mainly refers to the back-end operation interface, certain built-in prompts, etc.; while the user content language refers to the actual articles, product descriptions, single pages, etc. that you publish on the website.Implementing multilingual support requires detailed deployment on both levels.
Plan multiple sites: the cornerstone of multilingual content
Creating an independent site for each target language is the core strategy recommended by Safe CMS. This means that if you want your website to support both Chinese and English, you will have a Chinese main site (for example,www.yourdomain.com)and an English sub-site (for example 然后一个英文子站(例如en.yourdomain.comorwww.yourdomain.com/en/)。These two sites share the powerful core functions of the security CMS, but are independent in content management.
The advantage of this model is:
- Content Independent Management:Content for each language can be independently published, edited, and optimized, avoiding confusion between content in different languages.
- SEO-friendly:The independent site structure or subdirectory is beneficial for search engines to distinguish between different language versions and to.
hreflangLabel accurate indexing. - Flexible configuration:Each language site can have its own domain name, pseudo-static rules, template styles, and SEO settings to better adapt to the local market.
In the AnQi CMS backend, you can create and configure these independent language sites through the "Multi-Site Management" feature, including specifying different website addresses, independent databases (if needed), and the templates used.
Background Configuration: Set default language package (system interface)
The Anqi CMS provides built-in language package support, currently including Chinese and English, etc.You can find the 'Default Language Pack' option in the 'Global Function Settings' on the backend.Choose the corresponding language here, which will affect the built-in prompts on the website and the display language of certain system messages.
It is important to note that this setting primarily targets system-level text and will not automatically translate the user-generated content such as articles, products, or category names into the language of your choice.Multi-language management of user-generated content will be realized through a multi-site approach.
Template Level: Translate static text
The website template often contains some fixed and unchangeable texts, such as 'Home', 'About Us', 'Contact Us' on the navigation bar, as well as the copyright information at the footer and sidebar titles, etc. These static texts are translated by{% tr %}Tags andlocalesManage the directory structure.
Firstly, create a directory named under your template directory.localesThe folder. Within this folder, create a subfolder for each language, named after the language code, for example,zh-cn(Simplified Chinese) anden-us(American English). Create a folder for each language.default.ymlfile.
For example,locales/zh-cn/default.ymlmay include:
"yourLocation": "您的位置"
"homePage": "首页"
"aboutUs": "关于我们"
whilelocales/en-us/default.ymlit may correspond to:
"yourLocation": "Your Location"
"homePage": "Home"
"aboutUs": "About Us"
Where these texts need to be used in the template, you can use{% tr "键名" %}Tag calls. For example:
<a href="/">{% tr "homePage" %}</a>
<p>{% tr "yourLocation" %}</p>
When the user visits a site in a different language, the system will automatically load the correspondingdefault.ymlfile, displaying the translated text.
Content level: Publishing and managing multilingual content
As previously mentioned, the content published by users in Anqi CMS (articles, products, single pages, etc.) is bound to specific sites. This means that if you have a Chinese site and an English site:
- Publish and manage all Chinese articles, products, and pages on the Chinese site backend.
- Publish and manage all English articles, products, and pages on the English site backend.
In this mode, the content of different languages is completely independent. You can write different copy for each language market, and carry out independent SEO optimization.For example, Chinese articles may be more focused on Baidu SEO, while English articles are more focused on Google SEO.
Front-end Display and Switching: Language Selector and SEO Optimization
To facilitate users switching between different language versions while optimizing search engines' understanding of multilingual content, Anqi CMS provides{% languages %}Label. This label can help you build a language switcher and automatically generatehreflangLabel.
Build a language switcher:You can use it in prominent positions such as the header or footer of the website,{% languages %}Translate the following JSON array's value content to English: ["Translate the following JSON array's value content to English: ", "{\"key\":0,\"value\":\"标签来遍历所有已配置的语言站点,并生成切换链接:\"}"]
{%- 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 will generate a list of all language site links, and you can freely design its style according to your needs, for example, showing language names, flag icons, or Emoji expressions.
Hreflang tag SEO optimization: To inform search engines that your website has multiple language versions and they are interlinked, you need to include the in HTML's <head>area tag.hreflangLabel.{% languages %}Tags can also automatically help you complete this task:
{%- languages websites %}
{%- for item in websites %}
<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
{%- endfor %}
{%- endLanguages %}
This way, the search engine can accurately identify the different language versions of your website and guide users to the most suitable language page for them, thereby enhancing the SEO performance in the international market.
Through these steps, Anqi CMS provides you with a comprehensive and flexible multi-language solution. Whether you are a small and medium-sized enterprise, a self-media operator, or a user who needs to manage multiple sites, you can efficiently achieve the display and switching of multilingual content, helping your website go global.
Common Questions (FAQ)
Why does Safe CMS recommend creating a separate site for each language to manage content?Establishing independent sites (or subdomains/subdirectories) for each language is a widely accepted **practice in the industry** and one of the core design philosophies of Anqi CMS.The benefits are multifaceted: it allows for independent content creation, SEO optimization, and marketing strategies for different language versions, avoids content confusion, and enhances website maintenance efficiency.For example, you can provide fully localized content and user experience for German-speaking users without worrying about content interference with English users.
2. Besides articles, products, and other user-generated content, how should static texts like 'About Us', 'Contact Information', etc., in the template be translated?For the fixed static text in the template, you can use{% tr %}the (translate) tag combined withlocalesthe YAML file under the directory. Just inlocalesCreate a folder corresponding to the language in the catalog anddefault.ymldefine key-value pairs in the file, and then use the template to{% tr "键名" %}[en]Reference it. In this way, when the user switches the language site, these static texts can also be translated and displayed.
3. In the "Global Feature Settings", there are the "Default Language Pack" and{% tr %}What is the difference between tags? How do they work together?The 'default language package' mainly controls the interface language and built-in prompts of the Aqy CMS system itself, such as the text of the admin interface.It sets the default interactive language of the system, which has no direct impact on the content of the articles you publish.{% tr %}Tags are used to translate the static text (such as your manually written text in the website front-end template)