In today's globalized digital world, website multilingual support has become a crucial step for enterprises and content operators to expand into international markets and serve diverse user groups.AnQiCMS as an efficient enterprise-level content management system, fully considers this requirement and provides a flexible and practical multi-language content switching display solution.
How does AnQiCMS implement multilingual content management?
AnQiCMS implements the main method of multi-language content display switching by using its 'Multi-site Management' function.This means that you can create a separate website for each target language.For example, your main site is in Chinese, you can create an English site, a Japanese site, etc.Each site has its own domain name (or subdomain/subdirectory), an independent database (optional, or can be reused), and an independent content library.
- Create a multilingual site:In AnQiCMS backend, through the 'Multi-site Management' feature, you can easily add new sites. During the process of adding a new site, you need to specify a unique domain name for the new site (for example, Chinese site
example.com,English站en.example.comorexample.com/en),and configure the corresponding site root directory and database information. In this way, each language site can independently publish and manage its specific language content. - Content independent maintenance:In each language site, you can publish articles, products, pages, and other content just like managing a regular site.Ensure that all content is written in the corresponding language on the language site.For example, publish articles in English on English sites and articles in Japanese on Japanese sites.This independent maintenance method can ensure the quality and localization of the content.
- Language package support (system level):Although multilingual content needs independent maintenance, AnQiCMS provides support for 'default language package' at the system level.This means that you can set the display language of the background interface and some built-in tips (such as button text, system messages, etc.) to facilitate operations for administrators in different language regions.This will not affect the content you actually publish.
How to implement multi-language switching display on the page?
Implement the multi-language switch on the page, mainly relying on the AnQiCMS front-end template providedlanguagestags, as well as reasonablehreflangtag configuration.
Utilize
languagesTag to get the language site list:AnQiCMS provides{% languages websites %}Label, this label can dynamically retrieve all multilingual site information that you have configured on the backend.It will return a list containing details of each language site, including the language name (such as "ChineseYou can use this tag in the public part of the website template (such as the header navigation bar or footer) to build a language switcher. The code structure is roughly as follows:
{%- 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}}" /> {%- else %} {# 否则显示语言Emoji表情或名称 #} {{item.LanguageEmoji}} {% endif %} {{item.LanguageName}} </a> {%- endfor %} </div> {%- endif %} {%- endlanguages %}This code will iterate over all configured language sites and generate a toggle button with the language name and link for each site.When the user clicks a language button, the page will jump to the corresponding language website.
Configuration
hreflangLabel for SEO optimization:To help search engines better understand your multilingual content and display it to the correct users,hreflangtags.hreflangLabels inform search engines that your page has other language or regional versions.You can specify in the template's
<head>section, usinglanguagestag to dynamically generatehreflangLink:{%- languages websites %} {%- for item in websites %} <link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}"> {%- endfor %} {%- endlanguages %}This code will generate a
linktag for each language site,hrefproperties pointing to the URL of the language-specific site,hreflangThe attribute contains the corresponding language code (for exampleen-USorzh-CN). This is very beneficial for improving the performance of multilingual websites in international search engines.
Through the above steps, AnQiCMS can provide a clear, efficient multilingual content management and switching solution, allowing your website to easily reach global users.
Common Questions (FAQ)
Is the multilingual support of AnQiCMS automatic translation, or do different language versions need to be manually created?AnQiCMS does not provide automatic translation functionality, it adopts the strategy of 'one language per site'.This means that you need to create a site independently for each target language, and manually publish and maintain the corresponding content for each site.The benefits of doing so are that it ensures the quality and localization of the content, avoiding the potential inaccuracies or unnaturalness that machine translation may bring.
Do I need to create a completely new website template for each language version?Certainly not.AnQiCMS's template system is very flexible.You can choose to reuse the same website template for all language sites, just make sure that the content tags (such as article titles, descriptions, etc.) in the template can display the content of the corresponding language correctly.At the same time, AnQiCMS also supports customizing different templates for different language sites to meet the design needs of specific markets or cultural backgrounds.
How to optimize multilingual content for search engines (SEO)?First, by placing on the page
<head>Added inhreflangTags (as shown in the article), inform search engines that your page has different language or regional versions.其次,ensure that each language site has high-quality, original, and relevant localized content for its target audience.Use a separate domain, subdomain, or subdirectory to distinguish between sites of different languages, and conduct keyword research and optimization for each language, which also helps to improve the SEO effect of multilingual websites.