How to configure the default language package and switch to a multilingual site in AnQiCMS?

As an experienced website operations expert, I am more than happy to delve into the powerful functions and practical strategies of AnQiCMS in terms of default language package configuration and multilingual site switching.AnQiCMS is a system designed specifically for content management, and its multilingual support is one of the core advantages for expanding the global market and serving users of different languages.Understand and make good use of these features, which will give your website a tiger's wings and accurately reach every target audience.


Configure the default language package and easily switch multi-language sites in AnQiCMS

In today's globalized digital age, the multilingual capability of a website is no longer just an optional bonus, but a key factor for enterprises and content operators to reach a wider audience and enhance the international influence of their brand.AnQiCMS is well-versed in this field, providing flexible and powerful multilingual solutions that allow you to easily meet the needs of users of 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 a foundation for system language

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

To perform this configuration, you need to log in to the AnQiCMS backend management interface, then navigate to“Backend Settings”under“Global Function Settings”. Here, you will find a named“Default Language Package”The option.AnQiCMS currently includes two mainstream language packages in Chinese and English for you to choose from.Select the appropriate language pack based on the main working language of your team or the initial settings for the target audience of your website.For example, if your main operations team is located in China, choosing 'Chinese' will ensure smooth backend operations; if your team is more accustomed to an English environment, it can be set to 'English'.

It is worth emphasizing that the default language package configured here mainly affects the system'sBuilt-in text.It does not automatically translate the actual content of your website articles, product descriptions, category names, etc.The translation and display of website content require the combination of AnQiCMS's powerful multi-site function to build a truly multi-language site.

II. Building Multilingual Sites: Implementing Global Deployment of Content

The multi-site management capability of AnQiCMS is the core foundation for its implementation of a multilingual website.Different from simple content translation plugins, AnQiCMS encourages you to create 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 serve both English and French-speaking users. In AnQiCMS, you don't need to deploy two separate CMS systems; you can simply create two independent sites under one AnQiCMS instance, for exampleen.yourdomain.comandfr.yourdomain.com.

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

  1. Prepare the domain:Firstly, you need to prepare the corresponding domain names or subdomains for each language you plan to support and have them resolved to your server. For example,en.yourdomain.comused for the English site,fr.yourdomain.comused for the French site.
  2. Add a new site in AnQiCMS:Log in to the default master site backend of your AnQiCMS, find:Multi-site managementFunction. Here, you can easily click:Add New SiteButton. In the pop-up configuration interface, you need to specify a new site."Site Name"/"Site Root Directory"(it is recommended to use)/app/Start with, followed by a domain name with points removed and separated by underscores, to ensure data is stored independently), and most importantly“Website address”(That is the domain name you prepare for the language). You can also set independent administrator accounts, passwords, and databases for each sub-site.
  3. Configure the default language package for the new site:For each newly created language sub-site, log in to its independent backend management interface (via the 'Access Backend' button in the 'Multi-site Management' list), and follow the method introduced in the first part.“Global Function Settings”In the middle.“Default Language Package”Set to the corresponding language. For example, the English site is set to “English”, and the French site is set to “French”.
  4. Independent content management:Each child site has an independent content management module for documents, categories, pages, and more.This means that you can create, translate, and publish specialized content for each language site based on the cultural characteristics and market demands of different languages.This 'content independent, system unified' model greatly simplifies the maintenance work of multilingual websites.

This way, you not only have multiple language versions of the website, but more importantly, each website can have independent configurations and content in the backend, realizing true refined operation.

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

After building multiple language websites, the next step is to provide a convenient language switcher on the website frontend and inform search engines of your multilingual content layout.

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

    For example, you can write 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 over all configured language sites and generate a toggle button for each site, containing its language name, icon (or Emoji), and corresponding link.Users can click to jump to the corresponding language version of the website.

  2. UtilizehreflangLabel boosting international SEO performance:To help search engines better understand the structure of your multilingual content and display the most relevant website version to users in different language regions, configure correctlyhreflangLabels are crucial. The AnQiCMS provides.languagesLabels can also be used to generate these SEO-friendly meta data. You should place the following code in yourbase.htmlOr other public 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">tag for each language site,hreflangThe attribute will be filled according toitem.LanguageAutomatically fill in the corresponding language code (e.g.en/fr)hrefThis points to the URL of the language site. It effectively guides search engines, avoids the issue of duplicate content caused by multilingual content, and optimizes the search experience for global users.

  3. Localization translation of built-in template text: For fixed text in the template that is not dynamic content, such as navigation menu items ("Home", "About Us"), tips on the page, etc., AnQiCMS providestr(translate) Tags need to be localized. You need to create a folder under the template directory.localesfolders, and create a corresponding folder for each language.YAMLfiles (such aszh-cn/default.yml/en-us/default.yml), and define key-value pairs within it.

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

    Then use in the template:{% tr "home" %}The system will automatically display "Home" or "Home" based on the language settings of the current site. This makes the multi-language switching 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, manage and display multilingual content through independent sub-sites, or provide seamless language switching experiences and deployment of SEO-friendly on the frontendhreflangTags, AnQiCMS helps you easily expand into the global market with its concise and efficient architecture, enhancing your international brand influence.


Common Questions (FAQ)

  1. Question: Does AnQiCMS support automatic content translation? Answer:AnQiCMS itself does not have a built-in automatic translation feature.Its multilingual strategy is based on the principle of 'content independence and system unity', which means maintaining a set of independent content for each language version.