How to configure AnQiCMS to implement multilingual content switching and display?

Calendar 👁️ 60

Today, with the increasing popularity of globalization, multilingual support for websites is no longer an optional feature, but an important cornerstone for enterprises to expand into international markets and serve global users.AnQiCMS (AnQiCMS) is an efficient and customizable enterprise-level content management system that fully considers this need and provides a flexible multilingual content switching and display solution.This article will discuss in detail how to configure and manage multi-language content in AnQiCMS, making your website easily accessible to the world.


I. AnQiCMS Multilingual Function Overview

AnQiCMS was designed with multilingual support from the beginning, aiming to help users efficiently promote global content.One of its core functions is to support the switching and display of multilingual content, which allows the website to meet the access needs of users from different languages.From the built-in language package of the system, to the localization of fixed text in templates, and to the multi-language version management of core content (such as articles, products), AnQiCMS provides a relatively complete mechanism.It is particularly noteworthy that its powerful multi-site management function provides an excellent solution for achieving an independent and complete multilingual site cluster.


II. Configuring the Basic Language Environment of AnQiCMS

Before starting to manage multilingual content, we need to configure the basic language environment of AnQiCMS first.This mainly includes the settings of the system default language package and the localization of fixed text in the template.

1. Set the Default System Language Package

AnQiCMS provides a "default language package" option, mainly used for switching the system backend interface, prompt information, and built-in text language.This is very helpful for operators to operate the backend in different language environments.

  • Operation path: Log in to the AnQiCMS backend and go to the "Global Function Settings".
  • In the settings, you will see the "Default Language Pack" option, currently supporting "Chinese" and "English".
  • Select the default language you want and save it.

Please note: This setting only affects the interface language of the AnQiCMS system itself, and will not automatically translate the specific content of your website articles, products, etc.The localization of website content requires more detailed configuration later.

2. Fixed text in the localization template (translation tags)

The website template often includes some fixed and unchangeable text, such as navigation menu items (Home, About Us), and the location information before the copyright information at the bottom of the page, etc.This text also needs to be switched according to the language environment. AnQiCMS passes through{% tr %}Translate labels andlocalesThe directory structure to support this localization.

  • Preparation:

    • Under the root directory of your website template (usually/template/your_template_name/), create a subdirectory namedlocales.
    • Inlocalesin the folder, create a subfolder for each target language, such aszh-cn(Simplified Chinese),en-us(American English).
    • Create a file in each language subfolder,.ymllanguage files in thedefault.yml.
  • Configure language file:

    • Open.zh-cn/default.ymlYou can define Chinese key-value pairs, for example:
      
      "yourLocation": "您的位置"
      "homePage": "首页"
      
    • Open.en-us/default.ymlYou can define English key-value pairs, for example:
      
      "yourLocation": "Your Location"
      "homePage": "Home"
      
  • Use translation tags in the template:

    • In your template file, any fixed text that needs to be switched according to language can be{% tr "键名" %}replaced with tags. For example:
      
      <span>{% tr "yourLocation" %}</span>
      <a href="/">{% tr "homePage" %}</a>
      
    • When the website language is switched, AnQiCMS will automatically load the correspondingdefault.ymlGet and display the corresponding text from the file.

3. Implement multilingual content management: Build a multilingual site cluster

AnQiCMS is the most powerful and recommended multilingual content management system, which uses its "multi-site management" feature to build independent language station clusters.This means you can create an independent website for each language, each with its own domain (or subdomain), content, and template.This method can achieve high isolation of content, making it easy to manage, and more friendly for search engine optimization (SEO).

1. Create an independent site for each language

Through the multi-site management feature, you can easily create and manage websites in different languages.

  • Operation path: Log in to the backend of your AnQiCMS main site and navigate to 'Multi-site Management'.
  • Click the "Add new site" button.
  • Enter site information:
    • Site name: To distinguish different language versions, for example, "AnQiCMS English Site".
    • Site root directory:Specify an independent root directory for the new language site, for example/app/en_anqicms_com。This ensures that the data for each site is stored independently.
    • website address:Enter the domain name or subdomain of the new site, for exampleen.yourdomain.comMake sure the domain is resolved to your server.
    • Administrator account/passwordSet up independent backend login credentials for the new site.
    • Database nameSpecify an independent database name, for exampleen_anqicms_dbThus, the content data of different language sites will be completely isolated.
    • Select the template to use: You can choose an existing template for the new site or upload a template customized for that language.
  • Click "OK" to complete the site creation.

Repeat the above steps to create a separate site for each language you support. For example, you might have awww.yourdomain.com(Chinese main site), en.yourdomain.com(English site),jp.yourdomain.com(Japanese site) etc.

2. Release content on new language sites

Each new language site has an independent backend management interface.You need to log in to the backend of each language site, then follow the normal content publication process to publish the corresponding language version of the content.

  • Content typeIncluding articles, products, single pages, categories, tags, etc., each language site needs to be created and managed separately.
  • Template customization: To better adapt to the reading habits of different languages and market demands, you can choose or customize different templates for each language site.

The advantages of this multi-site model lie in:

  • Content is completely isolatedDifferent language versions of content do not interfere with each other, management is clear.
  • Independent SEO strategyEach language site can have independent keyword, TDK (title, description, keywords) settings and pseudo-static rules, which is beneficial for targeted SEO optimization.
  • Personalized operation: Based on the regional and cultural differences of different language users, more accurate content marketing and user experience design can be carried out.

IV. Implement multi-language switching and SEO optimization

A multilingual website must not only be able to manage multilingual content but also facilitate language switching for users and ensure that search engines can correctly identify different language versions.

1. User language switching menu

The front-end of the website needs to provide an intuitive language switcher, making it convenient for users to select their preferred language version. AnQiCMS provides{% languages %}Tag to get all configured multilingual site information, making it easy to build a language switch menu.

  • Operation instructionsIn your website template (usually the headerheader.htmlor footerfooter.htmland other public parts), use{% languages %}Label cycles output language switch link.

    {%- 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 %}
            {{item.LanguageEmoji}}
            {% endif %}
            {{item.LanguageName}}
        </a>
        {%- endfor %}
    </div>
    {%- endif %}
    {%- endlanguages %}
    
  • item.LinkIt will automatically point to the root directory of the corresponding language site.

  • You can useitem.LanguageIcon(Language Icon),item.LanguageEmoji(Language Emoji) oritem.LanguageName(Language Name) to display the switch options.

2. Configure Hreflang tags to optimize SEO

Related articles

How to ensure that custom fields of the content model are correctly displayed on the front page in AnQiCMS?

In AnQiCMS, we often encounter situations where we need to display various personalized content.The built-in articles and product models are powerful, but sometimes they still cannot meet specific business needs.At this time, the custom fields in the content model become our helpful assistants, making website content management more flexible.But the custom field is set up, how can we ensure that they are displayed correctly on the website front-end for visitors to see?Today, let's delve deep into this issue. ### Custom Field Creation and Management of Content Model Firstly

2025-11-08

How to customize AnQiCMS URL static rules to optimize search engine link display?

In today's digital world, a clear, friendly, and easily searchable URL structure is crucial for the visibility of a website.As one of the core functions of a content management system, the custom ability of URL static rules can make your website perform better in search engines.AnQiCMS is a content management system that focuses on SEO optimization and provides very flexible static configuration options, allowing you to easily achieve this goal.### Understanding the Importance of URL Rewrite Static Firstly, let's briefly understand what a pseudo-static URL is

2025-11-08

How does AnQiCMS achieve independent display of multi-site content under different domain names?

When using AnQiCMS to build and manage websites, users often face the need to create independent sites for different brands, businesses, or regions, and they also hope that these sites can be displayed independently under their respective domain names.AnQiCMS powerful multi-site management function, which is designed to solve this pain point.It allows users to easily create and operate multiple websites with independent content and domain names on the basis of a set of AnQiCMS core programs.### AnQiCMS The Core Concept of Multi-Site Management AnQiCMS

2025-11-08

How to set and display the TDK information (title, keywords, description) on the home page of AnQiCMS?

In website operation, TDK (Title, Description, Keywords) information is the foundation of Search Engine Optimization (SEO), especially for the homepage, its importance is self-evident.A clear and accurate homepage TDK can effectively help search engines understand the core content of the website, thereby improving the visibility and attractiveness of the website in search results.How can we conveniently and quickly set up and manage these key information in AnQiCMS and ensure that they are presented correctly to users?### One

2025-11-08

How to control the special display of articles in different areas of AnQiCMS's 'recommended attributes'?

In AnQiCMS, the 'recommended attribute' is a very practical feature that allows us to fine-tune the marking and classification of the content we publish, thereby achieving characteristic displays in different areas of the website.The core of this feature lies in assigning specific "flags" or "tags" to articles, allowing them to be selectively called in templates, thereby enhancing the visibility of the content and the overall operational efficiency of the website.What is a 'Recommended Attribute'? To put it simply, a 'Recommended Attribute' is some special tags that we can add to an article when we publish or edit it.

2025-11-08

How can I automatically convert AnQiCMS document content to Markdown format and correctly render it on the webpage?

AnQiCMS as a powerful content management system provides great flexibility in content creation and presentation.For users accustomed to writing in Markdown syntax, AnQiCMS also provides convenient support, allowing content creators to focus on the text itself without paying too much attention to formatting details.Starting from version 2.1.1, AnQiCMS has deeply integrated support for Markdown editors, making it easy to format document content in Markdown and render web pages

2025-11-08

How to set image lazy loading in AnQiCMS to optimize page display performance?

Website loading speed is one of the key factors in user experience and search engine optimization.Among the many factors affecting page performance, images are often the elements that consume the most resources and take the longest to load.To provide users with a smoother browsing experience and improve the website's performance in search engines, it is particularly important to optimize the image loading strategy.AnQiCMS itself is known for its efficiency and lightness, developed in Go language, with excellent high concurrency processing capabilities and fast response speed.On this basis, by introducing the Lazy Load image technology

2025-11-08

How to display the category list and its hierarchical relationship in AnQiCMS template?

When building a website, a clear classification structure is the key to improving user experience and content discoverability.AnQiCMS with its flexible content model and powerful template engine, allows us to easily display category lists and their hierarchical relationships on the website front-end.Today, let's delve deeper into how to implement this feature in the AnQiCMS template.### Get to know the AnQiCMS category list tag: `categoryList` The AnQiCMS template is based on the Django template engine syntax in Go language

2025-11-08