How to configure the default language package and switch multi-language sites in AnQiCMS?

As an experienced website operation expert, I am happy to deeply analyze the powerful functions and practical strategies of AnQiCMS in default language package configuration and multi-language site switching.AnQiCMS is a system designed specifically for content management, and its multilingual support is one of the core advantages for expanding into the global market and serving users of different languages.Understand and properly use these features to give your website wings and accurately reach every target audience.


Configure the default language package in AnQiCMS and easily switch between multilingual sites

In today's global digital age, the multilingual capability of a website is no longer just an optional extra point, but a key element for companies and content operators to reach a broader user base and enhance brand international influence.AnQiCMS is well-versed in this, providing a flexible and powerful multilingual solution that allows you to easily meet the needs of users in different languages.This article will delve into how to configure the default language package in AnQiCMS, as well as how to build and switch between multilingual websites using the multi-site feature.

1. Configure the default language package: lay the foundation for the system language

The default language package configuration of AnQiCMS, which is to set a basic display language for the entire website system.This mainly affects the background management interface, system prompt information, and built-in text content, ensuring that your operations team can operate in the most familiar language during daily work.

You need to log in to the AnQiCMS backend management interface to configure this feature, then navigate to“Background Settings”belowGlobal function settings. Here, you will find a feature named“Default language package”The option. AnQiCMS currently built-in Chinese and English two mainstream language packages for you to choose from.According to the primary working language of your team or the initial setting of the target audience of the website, you can choose the appropriate language package.For example, if your main operations team is located in China, selecting 'Chinese' will ensure smooth background operations;If your team is more accustomed to an English environment, it can be set to "English".

It should be emphasized that the default language package configured here mainly affects the system'sBuilt-in textIt will not automatically translate the actual content of your website articles, product descriptions, category names, etc.The translation and display of website content requires the integration of AnQiCMS's powerful multi-site function to build a truly multi-language site.

II. Building multilingual sites: realizing the globalization of content deployment

The multi-site management capability of AnQiCMS is the core foundation for implementing multilingual websites.Different from simple content translation plugins, AnQiCMS encourages you to set up an independent sub-site for each target language.This architecture not only makes content management clearer, but also provides great flexibility for SEO optimization and user experience.

Imagine that your brand needs to provide services to English and French-speaking users. In AnQiCMS, you do not need to deploy two separate CMS systems, but simply create two independent sites under one AnQiCMS instance, for exampleen.yourdomain.comandfr.yourdomain.com.

The process of creating a multilingual sub-site is usually as follows:

  1. Prepare the domain:Firstly, you need to prepare a corresponding domain name or subdomain for each language you plan to support and have it resolved to your server. For example,en.yourdomain.comFor English sites,fr.yourdomain.comfor the French site.
  2. Add a new site in AnQiCMS:Log in to the default main station backend of your AnQiCMS, find“Multi-site management”function. Here, you can easily click“Add new site”Button. In the pop-up configuration interface, you need to specify a new site“Site Name”/“Site Root Directory”(Suggested to use/app/Start,followed by a domain name without periods and separated by underscores to ensure data is stored independently,as well as the most importantWebsite address(That is the domain name you prepare for the language). At the same time, you can also set up independent administrator accounts, passwords, and databases for each sub-site.
  3. Configure the default language package for the new site:For each language sub-site created, log in again to its independent backend management interface (by clicking the "Access Backend" button in the "Multi-site Management" list), following the method introduced in the first part, in itsGlobal function settingsthe middle of“Default language package”Set to the corresponding language. For example, English site is set to "English", French site is set to "French".
  4. Independent content management:Each sub-site has an independent document, category, page and other content management modules.This means you can create, translate, and publish specialized content for each language site based on the cultural characteristics and market demand of different languages.This 'content independent, system unified' model greatly simplifies the maintenance work of multilingual websites.

In this way, not only do you have multiple language versions of the website, but more importantly, each website can have independent configuration and content in the background, realizing true precision operation.

The third: Implement front-end language switching: Optimize user experience and SEO

After building multiple language sites, the next step is to provide a convenient language switch on the website front end and inform search engines of your multilingual content layout.

  1. UselanguagesLabel-based language switcher:AnQiCMS provideslanguagesLabel, allowing you to easily retrieve the list of all multilingual sites configured.You can use this tag in the website template (usually in the header or footer) to dynamically generate language switch links.

    For example, you can write it like this in your template file:

    {%- 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 %}
    

    This code will iterate through all configured language sites and generate a toggle button for each site containing its language name, icon (or Emoji), and corresponding link.Clicking will take you to the corresponding language version of the website.

  2. UtilizehreflangLabel enhances international SEO performance:To help search engines better understand your multilingual content structure and display the most relevant website version to users in different language regions, configure correctlyhreflangTags are crucial. AnQiCMS'languagesTags can also be used to generate these SEO-friendly metadata. You should place the following code in yourbase.htmlOr other public header template files<head>Inside the tag:

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

    This will generate one for each language site<link rel="alternate" hreflang="xx">wherehreflangThe properties will be based onitem.LanguageAutomatically fill in the corresponding language code (such asen/fr)hrefThe attribute points to the URL of the language site. This effectively guides search engines, avoids duplicate content issues caused by multilingual content, and optimizes the search experience for global users.

  3. Localized translation of built-in template text:For text that does not belong to dynamic content in templates, such as navigation menu items ("Home", "About Us"), prompts on pages, etc., AnQiCMS providestr(translate) tag for localization. You need to create it in the template directory.localesfolders and create corresponding language files for eachYAMLfiles (such aszh-cn/default.yml/en-us/default.yml), where you define the key-value pairs.

    For example, inzh-cn/default.ymldefined:"home": "首页"Inen-us/default.ymldefined:"home": "Home"

    Then use it in the template:{% tr "home" %}The system will automatically display "Home" or "Home" based on the current site language settings. This makes the multi-language switch at the template level extremely efficient and flexible.

Summary

AnQiCMS provides a one-stop multilingual website solution for enterprises and content operation teams with its powerful multi-site management and flexible language configuration capabilities. Whether it is to set up system-level default language packages, or manage and display multilingual content through independent sub-sites, or provide seamless language switching experience and deployment of SEO-friendly on the front end.hreflangLabel, AnQiCMS is known for its concise and efficient architecture, helping you easily expand into the global market and enhance your international brand influence.


Frequently Asked Questions (FAQ)

  1. Ask: Does AnQiCMS support automatic content translation? Answer:AnQiCMS itself does not have built-in automatic translation functionality. Its multilingual strategy is based on the principle of 'content independence and system unity', that is, it maintains a set of independent content for each language version.This means you