AnQiCMS provides powerful multilingual support capabilities, helping websites easily meet the needs of global content promotion.Understand its working principle and configuration method, which allows you to efficiently manage content in different languages and correctly display it to the target users on the front-end page.
The cornerstone of multilingual content management: multi-site mode
The core idea of AnQiCMS implementing multilingual content switching is to utilize its powerful multi-site management function.This means that, in most cases, you would create a separate site instance for each target language.www.example.com),您可以创建一个英文版站点(en.example.comorwww.example.com/en/)作为其“语言兄弟站点”。
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 mode is that the content and settings of different languages are completely isolated, which is convenient for management and maintenance, and also allows for better targeted SEO optimization.
When creating a new site, you can operate the "Multi-Site Management" feature in the AnQiCMS backend.On the interface for adding new sites, in addition to filling in the site name, website address, and other basic information, you also need to select an appropriate template for different language sites and set up an independent database to ensure data isolation and security.
Content creation and translation strategy
Understood 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 creationEnglish: For each language version, independently write or translate articles, products, single-page content, etc. in the corresponding site backend.This means that if you have a Chinese article, you need to manually create its corresponding English version on an English site.
- SEO OptimizationIn creating content, be sure to fill in the SEO title for each language version
SeoTitle), keywords (Keywords) and description (Description)。These are the key factors recognized and ranked by search engines for your multilingual content.AnQiCMS provided pseudo-static rules (such as model naming patterns, more suitable for English site URL structures) can also help you optimize multilingual URLs.
Language switching and display on the front-end page
The key to enhancing user experience is how to correctly display the content on the front-end page and allow users to switch conveniently after the content is ready. AnQiCMS mainly uses template tags andhreflangProperties to achieve this.
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 "Global Function Settings" on the background. But this mainly affectsBack-end Interfacelanguage and someBuilt-in System Prompt Messageslanguage. It will not automatically translate the specific content you create in the back-end, such as articles, categories, etc.
Translation of Fixed Text in TemplatesFor fixed text in templates (such as navigation bars, footer copyright information, button text, etc.), AnQiCMS provides convenient translation tags
{% tr %}andlocalesmechanism.First, create in your template directory
localesa folder, and create subfolders within it according to language codes (such as)en-us/zh-cnEach subfolder should containdefault.ymlfile.In
default.yml中,以键值对的形式定义翻译内容,例如:# zh-cn/default.yml "yourLocation": "您的位置"# en-us/default.yml "yourLocation": "Your Location"Used in the template
{% tr "yourLocation" %}标签,系统就会根据当前站点的语言设置,自动加载对应的翻译文本。
语言切换器的实现AnQiCMS provides
{% languages websites %}Label to get the list of all multi-language sites, which makes building a language switcher very simple.- Use this tag to iterate over all configured language sites and display their names, links, and even language icons or Emoji.
- Pass
item.Link,The user can directly jump to the website page of the corresponding language. - Here is a simple example of a 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 %}
Proper use of the Hreflang attributeTo inform search engines that your website has different language versions and to avoid duplicate content penalties, it is crucial to use
hreflangproperties correctly. AnQiCMS also supports generating{% languages websites %}tags.hreflangLink:- Place the following code in your HTML page
<head>in the area:{%- languages websites %} {%- for item in websites %} <link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}"> {%- endfor %} {%- endlanguages %} - This will generate a link for each language site.
link rel="alternate"Tags, indicating 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
Through the above strategies, AnQiCMS provides a comprehensive and practical multilingual content solution. It emphasizes the isolation of content through multi-site management, usinglocalesMechanism implementation template text localization, andlanguagesLabel conveniently builds a language switcher and generateshreflangProperties. 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 broader market.
Common Questions (FAQ)
Q1: AnQiCMS 的“默认语言包”设置是否会自动翻译我的文章内容?A1: English not.The "Global Function Settings" in the background mainly used to change the display language of AnQiCMS background interface and some built-in system prompts.You need to manually write or translate specific content such as articles, products, categories, etc. in the background for each language.
Q2: Do I need to use a different domain or subdomain for each language to set up AnQiCMS multilingual sites?A2: AnQiCMS's multilingual support usually recommends using its multi-site management feature. This usually means configuring independent website addresses for each language, which can be different top-level domains (such asexample.deandexample.fr), subdomains (such asen.example.comandfr.example.com),or through the 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 treats them as logically independent site instances.
Q3: How does AnQiCMS ensure that my multilingual content is SEO-friendly?A3: AnQiCMS supportshreflanglabels to solve this problem. In your template<head>partial configuration is correct{% languages websites %}labels can be automatically generatedhreflang属性,tells search engines that your different language versions of pages are related, thus avoiding duplicate content issues, and ensuring that search engines display the correct language content to users in the corresponding language regions.At the same time, localized keyword research and content creation for different language sites are also key to improving SEO performance.