AnQiCMS provides powerful multilingual support capabilities, helping websites easily meet the needs of global content promotion.Understanding its working principle and configuration methods enables you to efficiently manage content in different languages and display it correctly on the front-end page.
The cornerstone of multilingual content management: multi-site mode
One of the core ideas of AnQiCMS to implement multi-language content switching is to make use of its powerful multi-site management function.This means, in most cases, you would create an independent site instance for each target language.For example, your main site is in Chinese version(www.example.com),You can create an English version of the site(en.example.comorwww.example.com/en/)as its language brother site.”
In the background, you can configure a separate domain, database, administrator account, and template for the English version of the site just like managing any new site.The advantage of this pattern is that the content and settings of different languages are completely isolated, which is convenient for management and maintenance, and can also better carry out targeted SEO optimization.
When creating a new site, you can perform operations in the 'Multi-site Management' feature of the AnQiCMS backend.On the interface for adding a new site, in addition to filling in the basic information such as the site name, website address, etc., you also need to select an appropriate template for sites in different languages and set up an independent database to ensure data isolation and security.
Content creation and translation strategy
After understanding that multiple sites act as multi-language carriers, content management becomes clear. You need to create and publish content separately for each language site:
- Independent content creation: For each language version, independently write or translate articles, products, single-page content, and so on in the corresponding site backend.This means that if you have a Chinese article, you need to manually create the corresponding English version on an English site.
- SEO Optimization: Pay attention to filling in the SEO titles for each language version when creating content (
SeoTitle), keywords (Keywords) and descriptions (DescriptionThese are the key factors that search engines recognize and rank your multilingual content.AnQiCMS provides pseudo-static rules (such as model naming patterns, which are more suitable for English site URL structures) to help you optimize multilingual URLs.
Language switching and display on the front-end page
How to correctly display on the front-end page after the content is ready and make it convenient for users to switch, is the key to improving user experience. AnQiCMS mainly uses template tags andhreflangTo achieve this by property.
Localization of system-level text.AnQiCMS provides default language package support, you can select the default language package (such as Chinese or English) in the background "Global Function Settings". This mainly affectsBack-end InterfaceLanguage and someBuilt-in System Prompt InformationLanguage. It will not automatically translate the specific content you create in the back-end, such as articles, categories, etc.
Translation of Fixed Text in TemplatesFixed text (such as navigation bars, footer copyright information, button text, etc.) in templates is provided with convenient translation tags by AnQiCMS.
{% tr %}andlocalesMechanism.- First, create a folder in your template directory
localesand within it, create subfolders by language code (such asen-us/zh-cn) containingdefault.ymlfile. - In
default.ymlDefine translation content in the form of key-value pairs, for example:# zh-cn/default.yml "yourLocation": "您的位置"# en-us/default.yml "yourLocation": "Your Location" - Using the template
{% tr "yourLocation" %}Label, the system will automatically load the corresponding translation text according to the current site language settings.
- First, create a folder in your template directory
Implementation of language switcherAnQiCMS provided
{% languages websites %}Tags to get the list of all multilingual sites, which makes building a language switcher very simple.- Use this tag to iterate over all configured language sites and display their names, links, even language icons or Emoji.
- By
item.LinkThe user can directly jump to the website page in the corresponding language. - Here is an example of a simple language switcher:
{%- languages websites %} {%- if websites %} <div class="language-switcher"> <span>切换语言:</span> {%- for item in websites %} <a href="{{item.Link}}"> {%- if item.LanguageIcon %} <img src="{{item.LanguageIcon}}" alt="{{item.LanguageName}} Icon" /> {%- else %} {{item.LanguageEmoji}} {% endif %} {{item.LanguageName}} </a> {%- endfor %} </div> {%- endif %} {%- endlanguages %}
The correct use of the Hreflang attributeTo tell search engines that your website has different language versions and avoid duplicate content penalties, it is crucial to use
hreflangattributes correctly. AnQiCMS also supports generating{% languages websites %}tags.hreflang:- Place the following code in your HTML page
<head>area:{%- languages websites %} {%- for item in websites %} <link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}"> {%- endfor %} {%- endlanguages %} - This will generate one for each language site
link rel="alternate"The tag indicates the other language versions of the current page and their corresponding URLs, greatly enhancing the SEO friendliness of multilingual websites.
- Place the following code in your HTML page
Summary
By the above strategy, AnQiCMS provides a complete and practical multilingual content solution. It emphasizes the isolation of content through multi-site management, utilizinglocalesMechanism implementation template text localization and throughlanguagesLabel conveniently build language switcher and generatehreflangAttributes. This architecture not only ensures the flexibility of content management, but also takes into account the SEO **practices necessary for global promotion, helping your website to reach a wider market.
Frequently Asked Questions (FAQ)
Q1: Will the 'Default Language Pack' setting of AnQiCMS automatically translate the content of my article?A1: I do not know. The 'Global Function Settings' in the background is mainly used to change the display language of the AnQiCMS background interface and some built-in prompts.You need to manually write or translate specific content such as articles, products, and categories in the backend.
Q2: Do I have to use a different domain or subdomain for each language to set up the AnQiCMS multilingual site?A2: AnQiCMS' multilingual support usually suggests using its multi-site management feature. This typically means configuring a separate website address for each language, which can be different top-level domains (such asexample.deandexample.fr)、subdomain (such asen.example.comandfr.example.com), or via URL path (such aswww.example.com/en/andwww.example.com/fr/To implement. The choice depends on your specific needs and SEO strategy, but the key is that AnQiCMS will treat them as logically independent site instances for management.
Q3: How does AnQiCMS ensure that my multilingual content is SEO-friendly?A3: AnQiCMS supportshreflanglabel to solve this problem. In your template<head>partly correctly configured{% languages websites %}label, can be automatically generatedhreflangThe attribute tells the search engine that your different language version pages are interlinked, thus avoiding duplicate content issues and ensuring that the correct language content is displayed to users in the corresponding language regions.At the same time, conducting keyword research and content creation for localized language sites is also a key factor in improving SEO performance.