How to enable or configure AnQiCMS's core multilingual feature?

As an experienced website operations expert, I fully understand the importance of multilingual websites for a company to expand into international markets.AnQiCMS (AnQiCMS) is an efficient and flexible content management system that naturally understands this and provides powerful and practical multilingual support features.

Today, let's delve into how AnQiCMS enables and configures its core multilingual functionality, helping your website easily go international.

The cornerstone of the AnQi CMS multilingual function

In AnQiCMS, the implementation of multilingualism is not a simple one-click operation, it integrates into multiple levels of system design to ensure that content and interface can accurately reach users of different languages. Its core advantage lies in its ability to supportMulti-site managementandFlexible content modelThese are the solid foundation for implementing multilingual websites. Through AnQiCMS, you can directly face the global users, greatly enhancing the efficiency of international market expansion.

The system内置的语言包支持,is the first line of defense for implementing multilingual functionality. But we need to make it clear that,AnQiCMS处理“多语言”,mainly体现在两个维度:一是Backstage management interface and language switching of system built-in prompts; SecondlyThe actual content displayed on the website front-end (articles, products, pages, etc.) and the translation of static text in templates. Understanding these two dimensions is the key to efficiently configuring multilingual functions.

Step 1: Configure the system default language package (backend interface and built-in prompts)

First, AnQiCMS provides support for the system default language package, which mainly affects the background management interface and some hints generated by the system on the front end.

You can go to the AnQiCMS backgroundGlobal SettingsFind the "Default Language Pack" option. Currently, the system has built-in Chinese and English language packs for you to choose from.Once you set the default language here, the corresponding background interface text, system messages, and so on will be displayed according to the selected language.

It should be noted that this setting only changes the built-in text display of the system and will not automatically translate the articles, documents, categories, and other content you have published on your website.This means that for actual content, we need to adopt a more refined strategy.

Step two: Implementing deep multilingualization of the website's frontend content.

To present your website content (such as news articles, product details, about us pages, etc.) in multiple languages to visitors, AnQiCMS mainly recommends usingMulti-site managementandtemplate translation tagsTo achieve this in combination, which provides great flexibility for content independence and SEO optimization.

2.1 Adding multilingual support for template static text ({% tr %}Label)

In your website template, many navigation menus, button text, footer information, etc. are usually static and need to be translated for different languages. AnQiCMS provides{% tr %}Translation label.

To enable this feature, you need to create a folder namedlocalesin the root directory of the template. In thislocalesfolder, create a separate folder for each target language (for example,en-usUsed for American English,zh-cnUsed for Simplified Chinese,jaUsed for Japanese and others.). Create another folder in each language folder..ymlfile (usually named as)default.yml)

For example, your file structure may look like this:

/template/your_theme/
├── locales/
│   ├── en-us/
│   │   └── default.yml
│   └── zh-cn/
│       └── default.yml
└── ... (其他模板文件)

Inzh-cn/default.ymlIn English, you can define key-value pairs:

"yourLocation": "您的位置"
"readMore": "阅读更多"

and in theen-us/default.ymlIn English, the corresponding content is:

"yourLocation": "Your Location"
"readMore": "Read More"

When you need to use these static texts in the template, you can simply call them:{% tr "yourLocation" %}or{% tr "readMore" %}. The system will automatically load and display the corresponding translation content according to the language setting of the current website, allowing your website interface to switch seamlessly.

2.2 Manage multilingual content (through multiple sites)

For dynamic content like articles, products, and single pages, AnQiCMS encourages you to adopt the 'multi-site' strategy.This means that the content of each language can be considered as an independent 'site', although they may share the same core program of AnQiCMS, but they are independent in content management.

The specific operation process is as follows:

  1. Plan an independent domain or subdirectory for each language.For example,www.yourbrand.comUsed for Chinese site,en.yourbrand.comorwww.yourbrand.com/enUsed for English site.
  2. Through the AnQiCMS "Multi-site Management" feature, create a new site for each language.When creating a new site, you need to specify a separate database name and site root directory (even if they share the same AnQiCMS program directory), and set the corresponding website address and administrator account password. For example, the database name for an English site isyourbrand_en_dbThe site root directory is/app/yourbrand_en.
  3. Publish and manage content for each independent language site.For example, publish English articles on the English site backend and Chinese articles on the Chinese site backend.The benefits of doing this are that the content of each language can be independently optimized for SEO, keyword settings, etc., without interference.

This separation management approach, although it may require you to switch between different sites to publish content, brings significant advantages such as clear content structure, independent database, and maximized SEO effects, which is very suitable for enterprise-level and global content operations.

Step 3: Display the language switcher on the website front-end ({% languages %}Label)

To make it convenient for visitors to switch the website language, AnQiCMS provides{% languages %}tags to build the language switcher.

This tag can retrieve the list of all multilingual sites that have been configured.You can loop through these sites in the template to display their language names, links, and even language emojis or icons.

Here is an example code snippet for creating a language switcher:

{%- languages websites %}
{%- if websites %}
<div class="language-switcher">
    <span>切换语言:</span>
    {%- for item in websites %}
    <a href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %}>
        {%- if item.LanguageIcon %}
        <img src="{{item.LanguageIcon}}" alt="{{item.LanguageName}}" />
        {%- else %}
        {{item.LanguageEmoji}}
        {% endif %}
        {{item.LanguageName}}
    </a>
    {%- endfor %}
</div>
{%- endif %}
{%- endLanguages %}

By this code, your website will display a clear language switch option, and the user can click to jump to the website of the corresponding language.

Step 4: Optimize International SEO (Hreflang Tag)

For multilingual websites,hreflangTags are the key to international SEO. They tell search engines which pages are alternative language versions of the same content, thus avoiding duplicate content issues and ensuring that users see the correct language pages when searching.

You can use{% languages %}Tags on your website,<head>Partially dynamically generatedhreflangTags:

{%- languages websites %}
{%- for item in websites %}
<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
{%- endfor %}
{%- endLanguages %}

This code will generate a Hreflang tag for each language version of the website<link rel="alternate" hreflang="xx">The tag, withinhrefURL pointing to the language version,hreflangspecifies the language code (for examplezh-CNoren-US). This is crucial for enhancing your website's visibility and ranking in global search engines.

Summary

Aanqi CMS provides a comprehensive solution for building efficient multilingual websites through its multi-site management, flexible template tags, and deep support for SEO.From the configuration of the background system language to the translation of static text in the front-end template, to the independent multi-site management of core content, and finally to the language switching display and SEO optimization, AnQiCMS strives to provide operators with a stable, flexible, and easy-to-use tool.Just by following the above steps and making reasonable planning and configuration, your AnQiCMS website can easily overcome language barriers and successfully expand into the global market.

Frequently Asked Questions (FAQ)

1. How does AnQiCMS handle the multi-language translation of dynamic content such as articles, products, etc?Is it directly adding different language versions on the same content editing page, or are there other ways?

AnQiCMS mainly achieves dynamic content multilingual translation through 'multi-site management'.This means that each language version of an article or product is usually created as an independent website content item and managed on the corresponding language "site".For example, you will have a Chinese site for publishing Chinese articles, and an English site for publishing English articles.This method may need to be different in