As an experienced website operations expert, I fully understand your concern for the various functions of AnQiCMS, especially the configuration details of its multilingual capabilities.In modern website operations, multilingual support has become an indispensable part in expanding the market and improving user experience.Today, we will delve deeply into AnQiCMSconfig.jsonThe relationship between files and multilingual functions.
config.json: The 'ID card' of the template and metadata
In the ecosystem of AnQiCMS,config.jsonThe file plays a very clear and important role - it is eachIndependent template's 'ID card' and core metadata configuration file. When you are in AnQiCMS's/templateWhen creating a new template for your website in the directory, this template folder must contain oneconfig.jsonThe file. Its main function is to declare the basic information and behavior characteristics of the template to the system, so that AnQiCMS can correctly identify and manage this template.
To be specific,config.jsonThe configuration items contained in the file are mainly focused on the properties of the template itself, for example:
name: The display name of the template, convenient for identification in the background management.package: The folder name of the template, usually the unique identifier of the template.version: The version number of the template, for update and iteration management.descriptionBrief introduction of the template.authorandhomepage: Information about the template author and their website.created: The creation time of the template.template_type: The type of the template, 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 from these configuration items that,config.jsonFocusing 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 function in these core template metadata.
The powerful multi-language capabilities of AnQiCMS: flexible rather than focused onconfig.json
Does this mean that AnQiCMS does not support multilingual functions well?Absolutely not. On the contrary, AnQiCMS provides very flexible and comprehensive support in terms of multilingualism, but the configuration and implementation of these features are scattered across different levels of the system, rather than unified in the template.config.jsonThis design philosophy allows the multilingual function to be deeply integrated into content management and front-end display in all aspects.
The multilingual capabilities of AnQiCMS are mainly reflected in the following aspects:
Global default language package settings (backend level)In the AnQiCMS backend "Global Function Settings", there is a configuration item called "Default Language Package".This allows you to select a default language package for the entire website or admin panel, for example, Chinese or English.This setting mainly affects the system's built-in prompts, management interface text, and some default texts that have not been translated at the template level.This is a system-level setting that is independent of specific template files.
Content translation at the template level (
localesDirectory and{% tr %}tags)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 ownlocales(Language environment) directory, and within it, create corresponding directories according to the language code (such aszh-cn/en-us) create correspondingymlfile (for exampledefault.yml)。TheseymlThe file stores translation text in key-value pair format.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 makes it very convenient for template developers to provide multilingual versions of static text, navigation names, button text, and so on without modifying themconfig.json.Multilingual site list and
hreflang(Template tags and SEO optimization)To better support international SEO and user experience, AnQiCMS also provides{% languages %}Such a template tag. Through this tag, you can conveniently display a list of all language versions supported by the current website on the front-end page, and provide users with an entry to switch languages.What's more,
{% languages %}Tags can be used to generate automaticallyhreflangproperties<link>These tags are usually placed in HTML's<head>area.hreflangIt informs search engines about the language versions and target regions of specific pages, which is crucial for avoiding duplicate content and improving the SEO performance of multilingual sites.Multi-site management (deployment strategy)One of the core strengths of AnQiCMS is its powerful multi-site management capabilities.This is not a direct language configuration item, but 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.For example, you can have a dedicated English site
en.yourdomain.comand a Chinese sitecn.yourdomain.comThey share the same AnQiCMS program, but can be completely independent in terms of content, template, and backend settings, thus achieving a more thorough multilingual isolation and optimization. In this mode, the language selection and content presentation at the site level, andconfig.jsonis not directly related.
Summary
In summary,config.jsonThe file is a service in AnQiCMS.metadata of the template itselfThe configuration file, such as the name, version, and type of the template.It does not contain any configuration items directly related to multilingual functionality. AnQiCMS's multilingual support is reflected at a broader level: it includes both the global language settings in the background that affect the default system behavior, and templateslocalesUnder the directoryymlcombined with the file{% tr %}精细化 frontend content translation implemented by tags, more{% languages %}Label-assisted language switching and SEO optimization, as well as the independent language version deployment strategy achieved through the multi-site feature.
This layered design makes the multilingual function of AnQiCMS both powerful and flexible, able to meet a variety of needs from simple interface switching to complex internationalized content operation without needing to modify each template'sconfig.jsonLanguage settings are repeated and maintainedconfig.jsonThe singularity of responsibility.
Frequently Asked Questions (FAQ)
Question: Since
config.jsonI am not responsible for multi-language configuration, where should I set the default display language of my website?Answer: You need to go to the AnQiCMS backend management interface, enter "Global Function Settings" under "Backend Settings", find the option "Default Language Package", and select the language you want the website to display by default.This setting will affect the system's built-in interface language and the display of some default text.How can I translate fixed text like navigation menus, copyright information, etc. in the template? Need to modify
config.json?No need to modifyconfig.json. You should create or edit it in the template directory you are currently usinglocalesCreate a folder, and within the corresponding language subfolder (for exampleen-us/zh-cn) inside itdefault.ymlFile. In thisymlIn the file, you can define key-value pairs to store your translation text (for example"home": "Home")。Then, use it in the template.{% tr "home" %}This translation tag is used to reference these texts, the system will automatically load the correct translation according to the website language.Ask: If I need to launch completely independent content and design for different countries and regions, does AnQiCMS support it? How should it be implemented?Answer: AnQiCMS fully supports this requirement. You can achieve it through its powerful "multi-site management" function.This means you can create multiple independent sites under the same AnQiCMS program, each site can be bound to a different domain (such as
en.example.comandcn.example.com), it has an independent database, root directory, template, and content.In this way, you can customize the design and content of each site according to the needs of users in different countries and regions, and achieve more thorough international operation.