Today, with the increasing popularity of globalization, many companies hope that their websites can serve users from different language backgrounds.AutoCMS (AutoCMS) understands the importance of this requirement and has integrated powerful multilingual support capabilities from the very beginning of system design, helping you easily build and manage multilingual websites.
To display multilingual content on your AnQiCMS website and allow users to switch between languages, it mainly revolves around its 'Multi-site Management' core feature.Safe CMS treats each language as an independent site for management, but these sites can be unifiedly operated from the same backend, greatly simplifying the maintenance work of multilingual websites.
Understanding the multilingual mechanism of AnQiCMS
Firstly, we need to clarify the basic approach of the security CMS to handle multi-language content.Different from some CMS that add multiple language versions under a single content entry, Anqi CMS adopts the strategy of "site is languageThis means that if you plan to have a website in both Chinese and English versions, you will need to create two separate sites in the Anqi CMS backend: one for Chinese content and one for English content.
This design brings several obvious advantages:
- Content independence is strong:Content for each language is completely independent, which is convenient for targeted content planning, SEO optimization, and localization operations, avoiding interference between different language content.
- Flexible customization:You can choose different templates for different language sites, and even customize unique features or layouts for the needs of specific language sites.
- High management efficiency:Even though the content is independent, these sites are all managed under a unified safe CMS backend, making it convenient for you to publish cross-language content, manage users, and analyze data.
It is worth mentioning that the "default language package" setting of the AnQiCMS background (located in "Global Function Settings"), is mainly used to switch the display language of the background management interface, as well as the language of some built-in system prompt information.It does not automatically translate the specific content of your website's articles, products, or categories.This content needs to be created and maintained separately on your language sites.
Backend settings: Create independent sites for different languages
Building a multilingual website starts with the "Multi-Site Management" feature from the AnQi CMS backend.
- Log in to the back end and go to the multi-site management:Visit your AQS CMS back end, and find the 'Multi-site Management' option in the left navigation menu.
- Add a new site:Click the "Add New Site" button. Here, you will configure the basic information for your new language version website.
- Site Name:Create a recognizable name for the new site, such as “English Site” or “Chinese Site”.
- Site root directory:Specify a separate folder path to store the cache and other data for the language site. To avoid confusion, it is usually recommended to name it with the domain name plus the language identifier, for example,
/app/en_yourdomain_comor/app/cn_yourdomain_com. - Website address:This is the key to the new language website. You need to assign a separate domain name or subdomain for each language site, for example
en.yourdomain.com(English site) andcn.yourdomain.com(Chinese site), or use the directory formyourdomain.com/enandyourdomain.com/cnPlease ensure that these domain names are correctly resolved to your server and have the corresponding reverse proxy configured (if you are using Apache or Nginx). - Administrator account password:Set an independent admin account and password for this new site.
- Database name:Similarly, allocate an independent database for the new site, for example
en_yourdomain_com。If you are installing Ansible CMS via Docker, you usually can choose 'Reuse default database account information', and the system will automatically create the database. - Select the template you want to use:You can choose an existing template or customize a dedicated template for your language site.
- Repeat the steps to create all language sites:Create corresponding independent sites for all target languages as per the above steps.
After completing these settings, each language version has an independent access address and management entry.
Content Management: Fill exclusive content for each language
Once the language site is set up, the next task is to fill them with content.You need to log in to the backend of each language site separately and publish and manage content according to the habits of that language.
For example, when you log in to the English site's backend, all the 'Document Management', 'Document Classification', 'Single Page' and other functions will be used to create and edit English content.Similarly, on the Chinese site's backend, you will focus on publishing Chinese content.This means that the article title, content, category name, tags, and single page content all need to be translated into different languages and entered separately.
This approach ensures the professionalism and accuracy of the content, avoiding the stiffness and unnaturalness that machine translation may bring.
Front-end Implementation: Multilingual Switching and SEO Optimization
On the front-end page, implementing the switch of multi-language content is the key to allowing users to choose their preferred language.AnQi CMS provides convenient template tags to help you achieve this, and combines SEO**practices to ensure that your multilingual website can be correctly understood and indexed by search engines.
1. Create a multilingual switcher:
You can place a language switcher in the header, footer, or sidebar of the website. Safe CMS provides alanguagestag to get all information of configured multilingual sites.
In your template file (for examplebase.html或Public header files), you can use the following code to display the language switch options:
{%- 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 through all configured language sites and generate a link for each language.item.LinkPoint to the home page of the language site,item.LanguageNameDisplay the name of the language (such as “Chinese”, “English”), you can also choose to displayLanguageIcon(flag icon) orLanguageEmoji(Emoticon)。User clicks the link to jump to the corresponding language website.
2. Implement Hreflang tags to optimize search engine visibility:
Hreflang tags are crucial for the SEO of multilingual websites.It informs search engines that your website has multiple language versions, specifies the URL for each language version, thus avoiding duplicate content issues, and ensures that search engines display the correct language content to users of that language.
You need to add the corresponding in each language site HTML<head>parthreflangtags. Similarly, we can use thelanguagestags to dynamically generate these links.
In yourbase.htmlthe file<head>tags, add the following code inside:
{%- languages websites %}
{%- for item in websites %}
<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
{%- endfor %}
{%- endLanguages %}
Here,item.LinkIs the complete URL for each language site,item.LanguageThen this is the language code for the language site (e.g. “zh-CN”、“en-US”)。This way, search engines can accurately identify your multilingual content structure.
Summary
Through the powerful "Multi-site Management" function and flexible template tags of AanQi CMS, you can systematically build and operate multilingual websites.Create independent language sites from the backend, implement intuitive language switching on the frontend, and optimize SEO with Hreflang tags. The entire process is both efficient and controllable.This not only helps you expand your global market, but also provides a better and more personalized browsing experience for users from different cultural backgrounds.
Common Questions and Answers (FAQ)
Q1:Is the multilingual content of AnQi CMS automatically translated?A1:English No.The CMS uses the "site as language" strategy, you need to create an independent site for each language and manually publish and manage the corresponding content for each site.The system will not provide automatic translation, which is done to ensure the quality of translation and the localization accuracy of the content.
Q2:Do I need to install a separate AnQiCMS program for each language site?A2:不需要。The multi-site function of Anqi CMS allows you to create and manage multiple independent language sites with a single program installation.You only need to install once the AnQi CMS, and then add sites of different languages by using the "Multi-site Management" feature in the backend.
Q3: Is the multilingual function of Anqi CMS SEO-friendly?A3:Yes, the multilingual design of Anqi CMS is very friendly to SEO. It allows each language site to have its own domain name or URL structure, independent content and metadata (TDK), and through the front end,languagesLabel easily generatedhreflangAttributes, help search engines accurately understand and index your different languages