How to set up multilingual content switching display function for Anqi CMS website?

Calendar 78

In today's global internet environment, allowing websites to support multiple language displays has become a key step for many enterprises to expand into international markets and serve diverse user groups.AnQiCMS (AnQiCMS) is a powerful content management system that comes with flexible multilingual support mechanisms, helping users easily switch the display of website content in multiple languages.

To set up multi-language content switching functionality for your Anqi CMS website, we need to understand two main implementation approaches: one is for the websitetemplate-level translation of interface text, another is aimed atIndependent management of core contentThis is usually achieved through the multi-site function of Anqi CMS.

1. Multilingual support at the interface level: Using template translation

The AnQi CMS allows you to translate various hints, navigation names, button texts, and other texts in the website through language package files, which are usually fixed texts in the template.

Implementation method:

  1. Create language package file:Under your template directory, create a folder namedlocales. Inside this folder, create a subfolder for each target language, for exampleen-us(American English),zh-cn(Simplified Chinese). In each language subfolder, create adefault.ymlfile.

    • For example, your file structure may look like this:
      
      /template/您的模板名/
      ├── locales/
      │   ├── en-us/
      │   │   └── default.yml
      │   └── zh-cn/
      │       └── default.yml
      └── ...
      
  2. Edit language package content:Indefault.ymlIn the file, define the translation content in key-value pairs.

    • zh-cn/default.ymlExample:
      
      "yourLocation": "您的位置"
      "homePage": "首页"
      
    • en-us/default.ymlExample:
      
      "yourLocation": "Your Location"
      "homePage": "Home"
      
  3. Use translation tags in the template:In your template file, use{% tr "键名" %}tags to call the corresponding translation text.

    • For example, you can inbash.htmlorindex.htmlAs written in the template file:
      
      <div>{% tr "yourLocation" %}:<a href="/">{% tr "homePage" %}</a></div>
      
      AnQi CMS will automatically load the corresponding language pack according to the current website's default language settings,default.ymland display the translated text in the file.
  4. Set the default language package of the website:Log in to the AnQi CMS backend, navigate to "Backend Settings" -> "Global Settings".Here, you can see the option for the 'default language package'.Select the language you want the site to display by default, for example, 'Chinese' or 'English'.This will decide{% tr %}Which language package file does the label read by default.

This method is very suitable for translating static elements and unified interfaces of the website.

Second, multilingual switching at the content level: flexible application of the multi-site mode

For websites that need to publish independent, complete multilingual content (such as product descriptions, article details, news information, etc.), Anqi CMS recommends using its powerful "multi-site management" function.Manage each language as an independent site, which can ensure complete independence of content, is beneficial for SEO, and the background management logic is clear.

Core idea:Treat each language's content as an independent website. For example, your main website iswww.yourdomain.com(English), you can create a sub-siteen.yourdomain.comorwww.yourdomain.com/en(English), they share the same AnQi CMS system, but the content, database, and configuration are independent.

Detailed setup steps:

  1. Step 1: Plan the multilingual site structureBefore starting the setup, please clarify how you want the multilingual site to be presented. Common patterns include the following:

    • Different top-level domains: yourdomain.com(Chinese),yourdomain.de(German)
    • Different subdomains: www.yourdomain.com(Chinese),en.yourdomain.com(English),fr.yourdomain.com(French)
    • Different subdirectories: www.yourdomain.com(Chinese),www.yourdomain.com/en(English),www.yourdomain.com/fr(French) The Anqi CMS multi-site management is very flexible and can support these modes.
  2. Step 2: Add and configure a new language site in the background

    • Log in to the main site background:Log in with the administrator account of the AQCMS site you initially installed (usually your Chinese main site).
    • Enter multi-site management:Find the "Multi-site Management" feature in the left navigation bar.
    • Add a new site:Click the 'Add new site' button. You need to fill in the following key information:
      • Site Name:For example, 'English site', 'French site', etc., for easy identification.
      • Site root directory: This is crucial!Each language site requires an independent physical directory to store its cache and specific data. The recommended naming method is/app/en.yourdomain.comor/www/wwwroot/yourmaindomain.com/enMake sure these directories are unique and exist on the server or can be created by the system.
      • Website address:Enter the complete URL you plan for the language site, for examplehttps://en.yourdomain.comorhttps://www.yourdomain.com/enMake sure to parse these domain names or subdirectories to your server in advance and configure the reverse proxy of the Web server (Nginx/Apache), pointing to the port of the main program of the Safe CMS (usually 8001).
      • Admin account password:Set an independent admin account and password for the new language site.
      • Database name:Set an independent database name for the new language site, for example.en_yourdomain_comTo ensure that content data for each language is completely separated. Selecting 'Reuse default database account information' can simplify the configuration.
      • Select the template to use:You can choose the same template as the main site or a customized template for a specific language.
    • Repeat this step:Repeat the above steps 'Add new site' for each language you plan to support.
  3. **Step 3: Template

Related articles

Does AnQi CMS support lazy loading of images in article content?

In a content management system, the loading efficiency of images is crucial for website performance and user experience, especially for articles with many images.Many users may be concerned, does AnQiCMS (AnQiCMS) support lazy loading of images in article content to optimize page loading speed. The answer is affirmative, Anqi CMS **supports** the lazy loading display of images in article content.This is due to its flexible template engine and fine-grained control over content display.Although Anqi CMS itself as a backend content management system does not execute lazy loading logic directly in the browser

2025-11-08

How to call the article list under a specific category in Anqi CMS template?

Managing and displaying content in Anqi CMS is one of its core strengths, and flexibly calling the list of articles under specific categories is an indispensable function in website content operation.No matter if you want to display the latest articles of a special topic on the homepage or show popular recommendations under the current category in the sidebar, AnQi CMS template tags can help you easily achieve this.The Anqiz CMS template system uses a syntax similar to the Django template engine, which is intuitive and powerful.

2025-11-08

How to customize the display layout of the article detail page in AnQi CMS?

When building a website with AnQiCMS, we often need to give different types of articles or specific articles a unique appearance and layout to better display the content and enhance the user experience.AnQiCMS provides a flexible mechanism that allows users to customize the display layout of article detail pages according to their needs, whether it is for the entire content model, a specific category, or a single independent article.Understand and make good use of these customization capabilities, it is the key to leveraging the advantages of AnQiCMS content management.The detailed steps to implement the personalized layout of the article detail page will be introduced below

2025-11-08

How to retrieve and display detailed information about website users or user groups (such as VIP level, balance)?

In Anqi CMS, implementing the acquisition and display of detailed information of website users or user groups is a key link in building personalized member systems and enriching user experience.Whether it is to display the user's VIP level, account balance, or the name of the user group they belong to, AnQiCMS provides intuitive and powerful template tags to help us easily achieve these functions. ### Deep Understanding of AnQiCMS User and User Group System AnQiCMS is built with a complete user management and user group (VIP system) function.

2025-11-08

How to optimize the URL structure of Anqi CMS to improve search engine display effect?

In website operation, URL structure is one of the key factors affecting search engine visibility and user experience.A clear, logical, and search engine-friendly URL that allows the crawler to better understand the website content, thereby improving the website's ranking in search results.AnQiCMS (AnQiCMS) took this into consideration from the very beginning, providing multiple features to help optimize the URL structure of websites for better search engine display effects. ### Core Function Analysis: How AnQi CMS Creates Friendly URL Structures **1.

2025-11-08

How to implement pagination display of article lists in Anqi CMS?

In a content management system, pagination display of the article list is a basic and important function.It not only effectively manages a large amount of content, improves the loading speed of the website, and avoids users feeling tired from facing an endless scrolling page, but is also a key link in Search Engine Optimization (SEO), helping search engines to better crawl and index website content.For users of AnQiCMS, implementing pagination for the article list is intuitive and powerful, thanks to its flexible and Django-like template engine.The AnQi CMS template system provides us with two core tags

2025-11-08

How does the customized content model of AnQi CMS affect the display of front-end article content?

In AnQiCMS (AnQiCMS), the custom content model plays a core role, which directly determines the structure and display of the front-end article content.For content operators, understanding and making good use of this feature is the key to achieving personalized website content, improving user experience, and enhancing operational efficiency.**I. Understanding Custom Content Models: The Foundation of Flexible Content Management** Traditional CMS systems may only provide fixed content types such as "articles" and "pages", but in actual operation, websites often need to display more diverse content, such as product details, event information

2025-11-08

How to obtain and display the 'previous article' and 'next article' of the current article in AnQi CMS?

In AnQi CMS, implementing the "Previous" and "Next" navigation function on the article detail page can not only significantly improve the user's browsing experience, but also effectively enhance the internal link structure of the website, and has a positive promoting effect on search engine optimization (SEO).The AnQi CMS provides a simple and powerful template tag, making this feature easy to use.

2025-11-08