How to configure multi-language content in AnQi CMS to ensure that users of different languages can browse the website normally?

Calendar 👁️ 77

The AnQi CMS provides an efficient and flexible solution for multilingual content configuration, aimed at helping us easily meet the needs of global content promotion.It cleverly distinguishes between system-level language settings and the localization of website content and templates, allowing us to finely manage content in different languages and ensure that users of different languages can browse the website smoothly.

We will learn in detail how to configure multilingual content in AnQi CMS and ensure its normal operation.

Understand the multilingual mechanism of AnQi CMS.

In Anqi CMS, the implementation of multilingualism can be understood from two levels:

  1. Translation of system interface and built-in textThis mainly refers to the language of built-in texts such as the background management interface and system messages.
  2. Localization of website content and templates.This is the dynamic content displayed on our website's front end to users, including articles, products, pages, and fixed text in templates.

First, in the "global feature settings" on the backend, we can find an option for the "default language package".Here usually built-in Chinese, English and other languages for us to choose from.The purpose of this setting is to change the language of the background management interface and some built-in prompts generated automatically by the system.For example, if we select 'English', then the background menu, prompts, and so on will all be displayed in English.

However, it should be noted that the settings of this "default language package" will not directly affect the language of specific content such as articles, products, categories, etc. on our website's front-end.The translation of this dynamic content requires a more powerful mechanism to be implemented - namely, by creating multiple independent "sites" to host content in different languages.

Configure multi-language site

To achieve multilingual display of website content, Anqi CMS adopts the core function of "multi-site management".This means that, for each language version, we can configure it as an independent "site" in AnQi CMS.The benefits of doing this are that each language site can have its own independent domain (or subdomain, subdirectory), content, template, even database, and achieve high isolation and flexibility.

The steps to configure a multilingual site are as follows:

  1. Domain planning and resolutionBefore starting, we need to plan the domains for different language sites. For example, the main site iswww.yourdomain.com, an English site can been.yourdomain.com, a Japanese site can beja.yourdomain.com. After planning, you need to resolve these domain names to your server.

  2. Create a new site: Log in to your AnQi CMS main station backend and find the 'Multi-site Management' feature in the left menu.Click the "Add new site" button to start creating an independent site for a new language version.

    On the new site configuration interface that pops up, you need to fill in the following key information:

    • Site name: Give this language site a name that is easy to identify, for example, "English site", "Japanese site".
    • Site root directorySpecify an independent root directory path for this new site. This is to ensure that the data and configuration of different sites can be stored independently. It is recommended to use/app/Start, and use the domain name after removing the periods and converting it to underscores as the directory name, such as/app/en_yourdomain_com.
    • website address: Enter the complete access address you have planned for this language site, for examplehttp://en.yourdomain.com.
    • Administrator account/passwordSet a separate admin account and password for this new site.
    • Database name: To ensure data independence, it is recommended to create a new database for each language site. Similarly, the domain name can be used as the database name by removing the dots and converting it to underscores, such asen_yourdomain_comIf your database permissions are sufficient, you can choose to 'reuse the default database account information', and Anqi CMS will automatically create a new database.
    • Select the template to useYou can specify different templates for each language site, or use a set of multilingual compatible templates.
  3. Reverse proxy configurationIf your CMS is deployed using Docker or Baota panel tools and accesses the domain name through reverse proxy, then the newly created site also needs to be configured with reverse proxy. This usually involves adding a new one in the Nginx or Apache configuration file.serverBlock, point the domain name of the new language site to the internal port of the Aqin CMS (for example, 8001), and configure the pseudo-static rules.In the Baota panel, you can easily add it in "Website" -> "Reverse Proxy".

After completing these steps, your new language site will be created and configured. It will have independent backend and frontend access paths.

Prepare multilingual content

Now, we already have an independent language site, and the next step is to fill in the content.

  1. Localization of dynamic contentFor articles, products, single-page applications, and other core dynamic content, you need to log in to the backend of the corresponding language site to publish and manage.For example, to publish an English article, you need to log in to the English site's backend, then as usual in "Content Management" to "Add Document", but at this time all the content is written in English.This means that if you have an "About Us" page, you will need to create a Chinese version of "About Us" in the Chinese site backend, and then create an English version of "About Us" in the English site backend.Each site's 'document classification', 'content model', and so on can also be independently configured as needed.

  2. Translation of static template text: For fixed text in website templates, such as navigation menu items like 'Home', 'Contact Us', or form buttons like 'Submit', 'Search', we can use the template translation function of Anqi CMS to achieve this.

    • Under your template directory (for example/template/default), create a subdirectory namedlocalesThe directory.
    • InlocalesUnder the directory, create subdirectories for each language andymlTranslate the file. For example:
      
      ./locales
      ├── en-us
      │   └── default.yml
      └── zh-cn
          └── default.yml
      
    • Inzh-cn/default.ymlIn, you can define Chinese translation:
      
      "home": "首页"
      "contactUs": "联系我们"
      
    • Inen-us/default.ymlIn, you can define English translation:
      
      "home": "Home"
      "contactUs": "Contact Us"
      
    • In the template file, use{% tr "key" %}tags to call translation:
      
      <a href="/">{% tr "home" %}</a>
      <a href="/contact.html">{% tr "contactUs" %}</a>
      
      when the user accesses the corresponding language

Related articles

How to customize the Anqi CMS content model to meet the personalized display needs of different types of content?

Today, with the increasing sophistication of content operation, personalized display of website content has become a key to attracting users and enhancing user experience.AnQiCMS (AnQiCMS) provides us with powerful tools with its flexible content model, allowing us to customize the structure and display of content according to various business needs.This article will delve into how to flexibly use the content model in Anqi CMS, making your website content more distinctive and practical.

2025-11-09

How to use the “Recommended Attributes” feature of Anqi CMS to flexibly display specific content on the front page?

When operating a website, we always hope to prioritize the most important and popular content for visitors, so that the focus area of the website can always present the freshest and most attractive information.Manually updating this content is time-consuming and prone to errors. Fortunately, Anqi CMS provides a very practical 'recommended attribute' feature that allows us to easily achieve flexible content display and automated management.What is the "recommended attribute" feature of Anqi CMS?In simple terms, 'Recommended Properties' is like putting a special tag on your website content

2025-11-09

How to make full use of the flexible content model feature of AnQiCMS to detail product information

In website content operations, the product detail page is the key link between users and products, and its richness of content, clarity of structure, and flexibility of display directly affect users' purchase decisions and the conversion rate of the website.AnQiCMS (AnQiCMS) provides an ideal solution with its powerful flexible content model features, allowing us to break free from the constraints of traditional CMS fixed fields, and build highly customized, attractive product detail pages based on product characteristics and business needs.### One, Flexible Content Model

2025-11-09

Under AnQiCMS multi-site management, how to set up independent templates for different sites to display content?

It is crucial to maintain a unique style and presentation for each site when operating multiple websites, as this not only helps to build the brand but also better meets the needs of different audiences.AnQiCMS provides strong support for multi-site management, one of its core advantages is that it can flexibly set independent templates for each site, making content display more personalized.

2025-11-09

How to optimize website URL display and SEO effects through AnQi CMS's pseudo-static and 301 redirect functions?

In today's highly competitive online environment, a website's URL (Uniform Resource Locator) is not only the address of the content but also a key factor affecting user experience and search engine rankings.A clear and meaningful URL can enhance the professionalism of a website and help search engines better understand page content, thereby optimizing SEO effects.AnQiCMS provides two core functions, pseudo-static and 301 redirect, for URL optimization, allowing users to easily build a website structure that is more friendly to search engines and users.### Optimize URL Display

2025-11-09

How to set up the 'Document Image' or 'Thumbnail' feature in AnqiCMS backend so that images are displayed correctly on the front page?

In AnQi CMS, managing and displaying images, especially document thumbnails or cover images, is a core link in website content operation.AnQi CMS provides flexible backend configuration and a powerful template tag system, allowing you to easily display these images correctly on the front page.This article will guide you step by step on how to set up and call it, ensuring that your website images are presented in **status to visitors. ### Back-end Settings: Make Sure Image Processing is Proper In the AnQi CMS back-end, there are several key areas that affect images, especially the generation and processing of thumbnails.Content Setup

2025-11-09

What are the conditions under which the "Custom URL" feature of Anqi CMS takes effect, and how can uniqueness be ensured to optimize content display?

Our company, Anqi CMS, has provided us with many flexible and powerful tools in content operation, among which the "Custom URL" feature is a very valuable feature.It not only relates to the website's search engine optimization (SEO), but also directly affects the perception and trust of users in the content.So, under what circumstances does this custom URL feature take effect, and how can we ensure its uniqueness to optimize content display? ### The activation time of the custom URL function In AnQi CMS, the custom URL is not always in the "working state".

2025-11-09

How to use the "Scheduled Publishing" feature of AnQi CMS to automatically display content on the front end according to a plan?

In daily website content operation, maintaining continuous updates and accurate targeting is the key to attracting users and enhancing website activity.However, manually publishing content is often limited by factors such as time and personnel.AnQiCMS (AnQiCMS) fully understands the pain points of operators and has specially provided the powerful and practical function of "scheduled release" to help users achieve automated content management and automatically display content on the front page according to the plan.

2025-11-09