As an experienced website operation expert, I fully understand your concern for the various functions of AnQiCMS, especially the detailed configuration of its multi-language capabilities.In modern website operations, multilingual support has become an indispensable part of expanding the market and enhancing user experience.config.jsonThe relationship between files and multilingual functions.

config.jsonThe 'ID card' of the template and metadata.

In the AnQiCMS ecosystem,config.json文件扮演着一个非常明确且重要的角色——它是每个 English独立模板 English的“身份证”和核心元数据配置文件。当您在AnQiCMS的 English/templateWhen creating a new template for your website in the directory, this template folder must contain aconfig.json文件。它的主要作用是向系统声明该模板的基本信息和行为特性,让AnQiCMS能够正确识别并管理这套模板。

To be specific,config.jsonThe configuration items included in the file mainly focus on the attributes of the template itself, for example:

  • name: The display name of the template, convenient for identification during backend management.
  • package: Template folder name, usually the unique identifier for the template.
  • version: Template version number, convenient for update and iterative management.
  • description: Brief introduction of the template.
  • authorandhomepage: Information about the template author and their website.
  • created: Template creation time.
  • template_type: Template type, such as adaptive, code adaptation, or PC + mobile independent mode.
  • status: The enabled status of the template determines whether it is the template currently being used on the website.

We can clearly see these configuration items from here,config.jsonFocus onthe management and description of the template itselfIt defines the identity, version, author, and supported adaptation modes of the template.However, we did not find any configuration items directly related to the AnQiCMS multilingual feature in these core template metadata.

AnQiCMS's powerful multilingual capabilities: flexible rather than focusedconfig.json

So, does this mean that AnQiCMS does not support multilingual features well?Absolutely not.config.jsonThis design philosophy makes it possible for multilingual functionality to be deeply integrated into all aspects of content management and frontend display.

AnQiCMS's multilingual capabilities are mainly reflected in the following aspects:

  1. Global default language package settings (backend level)In the AnQiCMS backend "Global Function SettingsHere you can select a default language pack for the entire website or the admin backend, such as Chinese or English.This setting mainly affects the built-in prompt information, management interface text, and some default texts that have not been translated at the template level.This is a system-level setting, independent of the specific template file.

  2. Content translation at the template level (localesDirectories and{% tr %}Label)For the text content that needs to be switched according to the language environment in the front-end template, AnQiCMS adopts a more refined management method. Each template can have its ownlocalesThe directory of (language environment) and create the corresponding one according to the language code (such aszh-cn/en-us)。“ymlfiles (for example)default.yml). TheseymlThe file stores the translation text in the form of key-value pairs.

    When you need to output these translated texts in the template, you can use{% tr "键名" %}such translation tags. The system will automatically translate from the correspondingymlLoad and display the matching translation content in the file. This mode allows template developers to easily provide multi-language versions of static text, navigation names, button text, etc. in templates without modificationconfig.json.

  3. English language site list withhreflang(Template tags and SEO optimization)In order to better support international SEO and user experience, AnQiCMS also provides{% languages %}This template tag. Through this tag, you can conveniently display a list of all language versions supported by the current website on the front page, and provide users with an entry to switch languages.

    What's more,{% languages %}Labels can be used for automatic generationhreflangattributes<link>Labels, these labels are usually placed in HTML's<head>area.hreflangIt tells search engines which language versions of a specific page exist and their target regions, which is crucial for avoiding duplicate content and improving the SEO performance of multilingual sites.

  4. Multi-site management (deployment strategy)One of AnQiCMS's core strengths is its powerful multi-site management capabilities.Although this is not a direct language configuration option, it provides a solid foundation for building multilingual websites.By creating multiple independent sites within the same AnQiCMS system, each site can be planned and operated for different languages or regions.en.yourdomain.com, and a Chinese sitecn.yourdomain.comThey share the same AnQiCMS program, but can be completely independent in content, templates, and backend settings, thus achieving a more thorough multi-language isolation and optimization. In this mode, the language selection and content presentation at the site level, andconfig.json也无直接关联。

Summary

综上所述,config.json文件在AnQiCMS中是一个服务于模板自身元数据The configuration file, such as the name, version, and type of the template.It does not contain any configuration items directly related to multilingual functionality.localesthe directory.yml文件结合{% tr %}Label implementation of refined front-end content translation, more{% languages %}Label auxiliary language switching and SEO optimization, as well as the independent language version deployment strategy achieved through the multi-site function.

This layered design makes the multi-language function of AnQiCMS both powerful and flexible, meeting a variety of needs from simple interface switching to complex international content operations, without the need to modify each template.config.jsonThe language setting is duplicated, and it has maintained.config.jsonThe singularity of responsibility.

Common Questions (FAQ)

  1. Question: Sinceconfig.jsonI am not responsible for multi-language configuration, where should I set my website's default display language?答:You need to go to the "Background Settings" under the "Global Function Settings" in the AnQiCMS background management interface, find the option "Default Language Pack", and select the language you want the website to display by default.This setting will affect the built-in interface language of the system and the display of some default texts.

  2. 问:How do I translate fixed texts like navigation menu, copyright information, etc. in the template? Do I need to make any changes?config.json?答:No changes are needed.config.json。You should create or edit it in the template directory you are currently using.localesFolder, and in the corresponding language subfolder (for exampleen-us/zh-cn) createdefault.ymlFile. In thisymlfile, you can define key-value pairs to store your translated text (for example"home": "Home"). Then, use it in the template.{% tr "home" %}Such translation tags are used to refer to these texts, and the system will automatically load the correct translation according to the website language.

  3. 问:If I need to launch completely independent content and design for different countries and regions, does AnQiCMS support it? How should it be implemented?答:EnglishQiCMS completely supports this requirement.You can achieve this through its powerful "multi-site management" feature.en.example.comandcn.example.com),has an independent database, root directory, templates, and content.So, you can customize the design and content of each site according to the needs of users in different countries and regions, realizing a more thorough international operation.