AnQiCMS provides powerful multilingual support capabilities, which is crucial for websites that want to expand into global markets and provide localized content experiences for users of different languages.It not only affects the way website front-end content is presented, but also provides users with a smooth language switching experience.Understanding its working principle can help us better plan and operate multilingual websites.
In AnQiCMS, multilingual support is mainly reflected in two aspects: first, the translation of built-in text or fixed text in templates, and second, the independent management and display of actual content (such as articles, products, single pages, etc.).These two together constitute the multilingual experience of the website.
Firstly, for the static text of the website interface, such as navigation menu items, copyright information, form prompts, etc., AnQiCMS provides a convenient translation mechanism. We can createlocalesFolder, and configure independent for each language.ymlTranslate files to achieve this. For example, create for Chinesezh-CN/default.yml, create for Englishen-US/default.yml. In these files, we can define key-value pairs, such as"yourLocation": "您的位置"and"yourLocation": "Your Location"When used in the front-end template,{% tr "yourLocation" %}Such labels, the system will automatically display the corresponding translated text based on the currently selected language.Additionally, the 'Default Language Pack' setting in the AnQiCMS backend also ensures that some built-in prompts or common texts in the system can be switched according to the selected language, providing a unified language environment for administrators and visitors.
其次,也是更为关键的一点,AnQiCMS 对于动态内容的管理方式是“多版本”而非“自动翻译”。This means that if we need to provide a Chinese and English version of a product introduction, we need to create two pieces of product content separately, one written in Chinese and the other in English.Although this may sound like additional work, it ensures the accuracy and authenticity of the content, and allows each language version to have its own independent SEO titles, keywords, and descriptions, even enabling content differentiation for different markets.This strategy offers very high flexibility, avoiding the stiffness and inaccuracy that may be introduced by machine translation, allowing us to provide high-quality, native reading experiences for users of each target language.Through AnQiCMS's content model and flexible publishing features, we can easily manage these versions of content in different languages.
To enable visitors to easily switch between different language versions, AnQiCMS provides,{% languages websites %}Label. This label will retrieve the list of all configured multilingual sites. We can iterate overwebsitesvariables, and useitem.LinkGenerate links to different language versions, while utilizingitem.LanguageName/item.LanguageEmojioritem.LanguageIconShow the language name or icon. This allows visitors to easily switch to their preferred language version with just one click or a dropdown menu, greatly enhancing the user experience.
In addition, an important SEO strategy in implementing a multilingual website is to usehreflangtags. AnQiCMS also uses{% languages websites %}tags, which can facilitate<head>parts to generate thesehreflangLink. For example, by traversingwebsitesAnd output<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">It can clearly inform search engines that the specific page of the website has other language or regional versions, thus avoiding duplicate content issues and ensuring that the correct language version of the content is displayed to the corresponding users.This is crucial for enhancing the visibility and ranking of the website in international search results.
In summary, AnQiCMS's multilingual support is achieved through template-level translation of static text and independent management of dynamic content, along with flexible front-end language switch tags and SEO-friendlyhreflang机制,共同构建了一个高效、可定制的全球化内容发布平台。它赋予网站运营者极大的自由度,以满足不同市场和用户的多样化需求。
Common Questions (FAQ)
AnQiCMS Will it automatically translate my website content?AnQiCMS does not provide automatic content translation functionality.For articles, products, single pages, and other dynamic content, you need to manually create and manage independent content versions for each language.For example, if you have a Chinese product page, you need to create an English version of the product page separately, and manually translate and input the content.This ensures the accuracy and professionalism of the content, serving the target users better.
How can I set different URL structures for each language?AnQiCMS's multilingual content management is usually combined with its multilingual site management feature. You can set up an independent site for each language (for example,
zh.yourdomain.comanden.yourdomain.com),or by configuring different URL prefixes for content in different languages (for exampleyourdomain.com/zh/article/andyourdomain.com/en/article/)。In the background configuration of multiple sites, you can specify the domain name and content root directory for each site to achieve different URL structures.hreflangWhat is the function of the label, and how should I use it?hreflangLabels are an important SEO attribute, telling search engines that your site has content versions in different languages or regions. Use correctlyhreflangHelps search engines display the correct language content to the right users, avoid duplicate content issues, and enhance the international SEO performance of the website. In AnQiCMS, you can use{% languages websites %}Label traverses all language sites, and<head>partially generated<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">where,item.Linkis the link of the current language site,item.Languageis the corresponding language code (such aszh-cn,en).