Under the trend of globalization, providing multilingual content has become a basic requirement for websites to reach a wider audience.The AnQiCMS was designed with this in mind, providing an effective way for users to configure and display multilingual content through its powerful multi-site management and flexible template system, to meet the needs of visitors from different regions.

Understanding the multilingual operation mechanism of AnQi CMS

In the AnQi CMS, the implementation of multilingual support is mainly divided into two levels: one is the language switching of the system backend and front-end interface, and the other is the multilingual display of actual content (articles, products, pages, etc.) for visitors.

For some built-in prompt information in the system backend and front-end interface, Safe CMS provides the "default language package" feature.You can select Chinese or English language packages in the system settings.This will change the system's own language environment, making backend operations and some default prompts appear in the selected language.Please note that this will not automatically translate the core content of your website articles, product descriptions, etc.

To implement multi-language core content of the website, Anqi CMS adopts the strategy of "Multi-site Management".This means that you will create a separate site for each target language, with each site carrying specific language content, collectively forming a multilingual website group.

Background configuration: Build multilingual site clusters

The first step in implementing multilingual content display is to configure the corresponding language site in the Anqi CMS background.

  1. Create independent language sites:Using the 'Multi-site Management' feature of AnQi CMS, you can create a new site for each target language. For example, if your main site is in Chinese, you can create a new site named 'English Site' and bind it to an English domain name (such asen.yourdomain.comoryourdomain.com/en/In creating a new site, please make sure to specify a unique site name, website address, and database name for each language site to ensure data isolation and management.

  2. Prepare specific language content:In each independent language site, you need to create and publish corresponding content separately.For example, publish Chinese articles on Chinese sites and the English translation versions of these articles on English sites.The content model, article management, product management, and other functions of Anqi CMS will allow you to maintain a unique content library for each language site.

  3. Language package settings (auxiliary):In the system settings of each language site, you can select its "default language pack".Although this mainly affects the system interface, it can provide a unified language environment for internal management of multilingual sites and some automatically generated text (such as date formats, etc.).

Front-end template: intelligent display and seamless switching

How to allow users to easily access and understand the multilingual content after the configuration is completed is the key to user experience. The template mechanism of Anqi CMS provides strong support.

  1. Template fixed text translation:Website templates often contain fixed texts such as "Contact Us", "Product Categories", "Read More", and so on. Anqi CMS provides{% tr "键名" %}Translate label,配合localesThe language configuration file (such aszh-cn/default.ymlanden-us/default.yml),can dynamically translate these fixed texts.When the user switches the language, the static text in these templates will automatically display the text in the language corresponding to the current site's language configuration without modifying the template code.

  2. Build a language switcher: {% languages websites %}Labels are a powerful tool for switching languages.Through this tag, you can retrieve the list of all configured language sites, including their language names, language codes, and corresponding link addresses.You can place a language switcher at the top, bottom, or sidebar of the website, and users can click to jump to the corresponding language site.

    {%- languages websites %}
    {%- if websites %}
        <div>
            {%- for item in websites %}
                <a href="{{item.Link}}">{{item.LanguageName}}</a>
            {%- endfor %}
        </div>
    {%- endif %}
    {%- endlanguages %}
    
  3. Intelligent recognition of content tags:Whether{% archiveDetail %}Used to get article details,{% categoryList %}Used to get the list of categories, or{% pageDetail %}Used to retrieve single-page content, these core content tags all have the ability to intelligently recognize the current site.This means that when the user visits the English site, these tags will automatically extract English content from the English site's database; when visiting the Chinese site, it will extract Chinese content.You do not need to write different content call logic for each language.

  4. [en] SEO Optimization:hreflangIntegration of tags:To help search engines understand the structure of your multilingual content, the Anqi CMS{% languages %}Labels also support generationhreflangproperties. You can find them on the website<head>Partially using this tag provides precise language and regional hints to search engines, avoids duplicate content issues, and ensures that users see the most relevant pages matching their language preferences in search results.

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

Optimize user experience and search engine performance

Through the above configuration, Safe CMS helps you build a multilingual website with clear structure, rich content, and friendly to users and search engines.Users can switch seamlessly to the website version in their preferred language to enjoy a more personalized browsing experience.hreflangTags and clear URL structure (configured as subdirectories or subdomains through pseudo-static rules), search engines can accurately understand the relationship between different language versions, enhancing the visibility and ranking of the website globally.

The AutoCMS provides an efficient and easy-to-implement multilingual solution through multi-site management and flexible template tags.Whether it is language support at the system level or refined management at the content level, it is aimed at helping your website easily expand to the global market and reach a wider user base.


Common Questions (FAQ)

1. English CMS of "Default language package" and{% tr %}What are the differences between translation tags?“Default language package” mainly affects the management interface of the Anqi CMS system backend and some prompts generated automatically by the system in the front-end templates that are not edited by users (such as certain date formats, default error messages, etc.).It changes the language of the system environment.{% tr %}Translate label is used to translate the fixed text content hard-coded in your template (such as navigation menu items, button text, footer statements, etc.), which requires you to translate manually inlocalesFiles under the folder language file are performed