In the current global digital environment, a website that can support multiple languages can undoubtedly greatly expand its user base and enhance brand influence.AnQiCMS (AnQi Enterprise Content Management System) is an efficient tool designed specifically for enterprise-level content management, naturally understanding this path, and providing a comprehensive and flexible multi-language support function.As an experienced website operation expert, I will guide you to understand how AnQiCMS implements multi-language configuration and usage, helping your website go international.
The core concept of AnQiCMS multilingual support
In AnQiCMS, multilingual support is not just a simple translation of all text, but takes a layered, flexible strategy.It divides the multilingual needs of the website into several levels: system interface language, translation of fixed text in templates, and the most core, business content carrying multilingual site management.Understanding this core concept is the key to efficiently configuring and using the AnQiCMS multilingual function.
In short, AnQiCMS encourages the management of content in different languages (such as articles, product details, single pages, etc.) on independent sites, which complements its 'multi-site management' function.At the same time, for the back-end operation interface, system prompt information, and some fixed text in the template that does not change with the content, it is implemented through built-in language packages and template translation tags.
Specific steps to configure and use the multilingual feature of AnQiCMS
Step 1: Establish a multilingual site architecture
The mainstream way AnQiCMS handles multi-language content is through the "Multi-Site Management" feature.This means that if you plan to have a Chinese version and an English version of the website, it is usually necessary to establish an independent website for each language version.The benefit of doing this is that each language site can have its own domain, its own content, its own SEO optimization strategy, and they do not interfere with each other, making management clearer.
In the AnQiCMS backend, you can easily add new language sites through the 'Multi-site Management' module. When creating a new site, you can configure a separate domain for it (such asen.yourdomain.comoryourdomain.com/en/),and specify a default template. Although the content is independent, these sites all share the same AnQiCMS core program and database, which greatly simplifies the complexity of deployment and maintenance.
Operation tips:When adding a new site, make sure to specify a default language pack that matches the language (such as English for an English site), which will affect the new site's backend interface and some system prompt languages.
Step 2: Configure default language package and backend language
AnQiCMS includes various language packages for translating the back-end operation interface, system prompts, and some public text that does not belong to the article content.You can find the 'Default Language Pack' option under 'Global Settings' in the 'Background Settings'.
When you select a specific language pack (such as "English") for a site, then the site's backend management interface will display in English, and built-in system-level text like "Read more", "Latest articles" will also switch to English.
Important note:This default language pack mainly affects the system-level text.The specific business content such as article title, body, category name, etc. will not be automatically translated.This content needs to be translated independently on each language site.
Step 3: Use the template to translate tags({% tr %})
For some hard-coded text in the website front-end template that does not change with the article content (such as the navigation menu items "Home", "Contact Us", and the copyright statement "All rights reserved" etc.), AnQiCMS provides{% tr %}Translation tags. This makes the UI text translation of the template very efficient.
To use this feature, you need to create a file named under the root directory of the current template.localesThe folder. In this folder, create a subfolder for each language (such aszh-CNrepresenting Simplified Chinese,en-USrepresenting American English). In each language folder, create anotherdefault.ymlA file used to store translation text in key-value pairs.
Example:Suppose there is a fixed text 'Your location' in your template.
- Create a language file:
template/your_template_name/locales/zh-CN/default.ymlyourLocation: "您的位置"template/your_template_name/locales/en-US/default.ymlyourLocation: "Your location" - Use in the template:In your HTML template file (such as
base.htmlorheader.htmlIn it, you can use{% tr "yourLocation" %}Translate. When the user visits the Chinese site, it will display 'Your location'; when visiting the English site, it will display 'Your location'.
This way allows the static text in the front-end template to dynamically switch according to the language set by the current site, without the need to maintain a separate template file for each language.
Step 4: Implement language switching between sites and SEO optimization
To allow users to easily switch between different language versions and for search engines to correctly identify multilingual content, you need to add a language switcher to the template and utilizehreflangLabel for SEO optimization. AnQiCMS provides{% languages %}tags to get the list of all configured multilingual websites.
Create a language switcher:You can use it in your template file (usually in the header or footer)
{% languages websites %}Label to iterate over all language sites and generate switch links.{%- 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}} {# 如果有语言Emoji #} {% endif %} {{item.LanguageName}} </a> {%- endfor %} </div> {%- endif %} {%- endlanguages %}This code will list all multilingual sites and generate links for each site, so that users can click and jump to the corresponding language website.
Implement hreflang tags:
hreflangTags inform search engines that your website has pages in different languages or regions, which is an important SEO element. It can effectively prevent multilingual content from being misjudged as duplicate content. You should place these tags on every page of your website.<head>Section.{%- languages websites %} {%- for item in websites %} <link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}"> {%- endfor %} {%- endlanguages %}item.LinkIt will generate URLs for each language version,item.Languagethen it generates the corresponding language codes (such aszh-CN,en-US)。This way, search engines can accurately understand your multilingual content structure and display the most relevant pages to different language users.
Content operation strategy considerations
Once the multilingual infrastructure is set up, content operators should note that:
- Content independent:Maintain the independence of content on each language site. Although the themes may be the same, translation is not just a literal conversion and needs to consider cultural context and localization habits.
- SEO localization:Conduct keyword research for each language market and optimize the corresponding page titles, descriptions, and content.
- Update synchronization:Establish a reasonable content update process to ensure that all language versions of the content are updated in a timely manner and maintain consistency of information.
The multilingual support feature of AnQiCMS, through multi-site management combined with a flexible template translation mechanism, provides an efficient and scalable global content management platform for enterprises and operations teams. Mastering these configuration and usage skills will enable your website to better serve the global market.