How to configure and display multilingual content in the Anqi CMS to serve users in different regions?

In today's global internet environment, businesses and content operators often need to provide content to users from different countries and regions.Auto CMS (AutoCMS) is well aware of this need and therefore provides flexible and powerful multi-language content configuration and display capabilities, helping users easily expand into international markets and ensuring content can directly reach audiences with different language preferences.

Overview of AnQi CMS multi-language capabilities

The multilingual mechanism of Anqi CMS is mainly reflected in two aspects: first, the language switching of the system background and built-in text; second, the construction and display of multilingual content sites for visiting users.

Configure system background language package

Firstly, the Safe CMS provides multilingual support for the system's own operation interface.This means that you can switch the background management interface to Chinese or English according to the working language habits of team members to improve operation efficiency and user experience.

This setting is performed in the background "Global Settings".You just need to go to "System SettingsAfter selection, the built-in texts of the system level such as background menu, buttons, prompt information, etc. will be switched accordingly.

However, it should be noted that this 'default language package' setting mainly affects the system interface and some preset built-in text.It will not automatically translate the content you post and edit in the background, such as articles, products, categories, and other user-generated content.This means that if your goal is to display fully translated content to users of different languages, you need to take further strategies to manage this content.

Build multilingual content site

To truly serve users in different regions, providing content in their native language is crucial.This is the core strategy to achieve multi-language content display, which is provided by the powerful 'multi-site management' feature of AnQi CMS.Through multi-site management, you can create an independent sub-site for each target language and publish and manage the corresponding language content in these sub-sites.

For example, you can set up a site for Chinese userswww.yourdomain.comMain site, and create a sub-site for English usersen.yourdomain.comSub-site, even for French usersfr.yourdomain.comThe child site. Each child site can have its own domain, content, category structure, and even different templates, but they are all unifiedly managed under the powerful framework of the same security CMS.

The specific build steps usually include:

  1. Domain planning and resolution: Determine the domain name for each language site (for example, using subdomains)en.yourdomain.comor independent country code top-level domainsyourdomain.fr),and parse it to your server.
  2. Add multi-site for Anqi CMSIn the "Multi-site Management" feature of the AnQi CMS backend, you can easily add new language sites.During the addition process, specify a separate website address, site root directory (used for storing independent data and cache), admin account, and database information for each language site.
  3. Content is independently created and managedOnce the language site is created successfully, you can log in to the corresponding site backend and write and publish all articles, products, pages, categories, and other content in that language. For example,en.yourdomain.comThe backend publishes English articles, infr.yourdomain.comThe backend publishes French products.
  4. Customize templates and styles:You can apply the same template to each language site and make targeted adjustments for language-related text; you can also design and enable completely independent templates for different language sites to meet the habits and design styles of specific language cultures.

This multi-site management model ensures that content for each language can be organized and presented independently and clearly, greatly enhancing the flexibility and efficiency of content management.

Show language switch function on the front end

To facilitate users switching between different language versions, you need to provide an intuitive language switcher on the website frontend. Anqi CMS provides dedicated template tags for this purpose.{% languages websites %}This tag can fetch all the multilingual site information you have configured, for you to build a switch menu in the template.

Usage is as follows:

In the public header or footer of your website template (usuallybash.htmlorpartial/header.htmlThis file and others can be added like this to switch languages:

{%- 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}} Icon" />
        {%- else %}
        {{item.LanguageEmoji}}
        {% endif %}
        {{item.LanguageName}}
    </a>
    {%- endfor %}
</div>
{%- endif %}
{%- endLanguages %}

In this code block:

  • websitesThe variable contains the list of all configured language sites.
  • item.LinkThe URL pointing to the language site.
  • item.LanguageNameThis is the name of the language (for example, "Chinese
  • item.LanguageIconanditem.LanguageEmojiIt allows you to display language identification in the form of icons or emojis, providing richer visual effects.

Optimize the search engine visibility (SEO) of multilingual content

For a multilingual website, search engine optimization is crucial. Anqi CMS not only provides basic support for your website through advanced SEO tools such as URL rewriting, 301 redirection, Sitemap generation, keyword library management, but also pays special attention to the details of multilingual SEO, especiallyhreflangLabel configuration.

hreflangTags inform search engines that your website has multiple language versions or content versions for different regions, ensuring that the most suitable language or regional URL is displayed to users to avoid duplicate content issues.{% languages websites %}Label, you can create these in the website's<head>Area dynamic generation these`