0

Mastering Language and Localization with WPML: A Comprehensive Guide

Mastering WPML Language Localization

In the dynamic and interconnected digital landscape, breaking through language barriers is essential for reaching diverse audiences and expanding the reach of your WordPress website. WPML is the WordPress Multilingual Plugin that empowers website owners to create multilingual experiences with ease and efficiency.

Understanding the intricacies of language management is crucial, Whether you’re a business looking to tap into new markets or an individual blogger seeking to connect with a global audience. From basic language configuration to advanced customization options, WPML offers various tools and functionalities to cater to your multilingual needs. In this guide, we’ll see in detail WPML language localization on the multilingual website. Let’s break this topic into some useful questions that enhance your understanding of WPML settings.

How to change language code?

WPML (WordPress Multilingual Plugin) allows you to create multilingual websites in WordPress. Changing the language code in WPML can be done through the WPML settings. Here’s how you can do it:

  • Log in to your WordPress admin dashboard. Navigate to WPML settings by clicking on “WPML” in the WordPress admin menu.
  • In the WPML settings, click on “Languages” to access language settings.
  • You should see a list of languages that you’ve added to your site. Find the language for which you want to change the language code and click the “Edit” link next to it.
  • In the language editing screen, you should see various settings related to the language you’ve selected. Look for the option to change the language code. This might be labeled as “Language code” or “Language tag.”
  • After you’ve entered the new language code, make sure to save your changes.
  • Changing the language code might affect the URLs of your translated content. For that update links and references across your site to reflect the changes in language codes.

Useful Tips

  • Once you’ve made the changes, it’s a good idea to browse your site to ensure everything is working as expected. Check both the front end (public-facing pages) and the back end (admin dashboard) to make sure there are no issues.
  • It’s essential to exercise caution when making changes to language settings, especially if your site is already live and has content in multiple languages. 
  • Always backup your site before making significant changes like this to ensure you can revert if needed. 
  • Consider testing changes on a staging or development site before implementing them on your live site.

How to change the original language in WPML

Changing the original language in WPML can be essential when you’ve initially set up your website with one language but later decide to change to another primary language. 

To change the original language,

  • Navigate to WPML and select String translation
  • Tick the checkbox of the desired string that you want to change the original language for
  • On the bottom of the string lists, change the language of the string to the language you want

Useful tips

After saving your changes, navigate back to your website’s front end to verify that the original language has been updated successfully. Check various pages and elements to ensure that everything displays correctly in the new original language.

Update Translations (if necessary): Remember that changing the original language may affect your existing translations. If you’ve already translated content into other languages, you may need to review and update those translations to align with the new original language.

By following these steps, you can change the original language in WPML and adapt your website to better suit your linguistic preferences and audience demographics. Remember to double-check your changes and test your site thoroughly to ensure everything functions as expected in the new original language.

How to change URL Structure

With WPML, you can format the language URLs for your website using distinct domains (or sub-domains), virtual folders, or a language argument in the URL. Although all languages are kept in one WordPress database internally, they may appear to visitors to be on separate websites.

Changing the URL structure in WPML involves adjusting how your website’s URLs are formatted to accommodate different languages or language versions. 

When configuring WPML for the first time, you have the option to select the preferred format. After configuring WPML, you can switch to a different format by navigating to WPML → Languages and scrolling to Language URL format.

From the below options you can select one:

  • Different languages in directories
  • A different domain per language
  • Language name as a parameter

Different languages in Directories:

On enabling this option, WPML will arrange the translations in different virtual folders

For example:

www.sampletest.com

www. sampletest.com/ja

A different domain per language

On selecting this option, you can completely place the different language in the independent domain

For example:

www.sampletest.es

Language name as a parameter

You can select this option if you want to display your language at the end of your site URL

for  example:

www.sampletest.com/?lang=ar

Useful Tips

Update Permalinks: Once you’ve changed the URL structure, it’s important to update your website’s permalinks to reflect the new format. Go to Settings > Permalinks in your WordPress Dashboard and click “Save Changes” to regenerate your permalinks.

Test URLs: After saving your changes, navigate to different pages on your website to ensure that the URLs are displaying correctly in the new format. Check both the front end and back end to verify that the links are working as expected.

SEO Considerations: If you’ve already indexed your website with search engines, changing the URL structure may affect SEO. Make sure to set up proper redirects (if necessary) and update any internal or external links pointing to your site.

How to change flags in WPML?

WPML has 65 pre-configured languages along with the extra flags for widely used language variations found in certain nations (such as Canadian French, Brazilian Portuguese, or Swiss German). You can download SVG or PNG versions of these flags at the following file path:

../wp-content/plugins/sitepress-multilingual-cms/res/flags

Changing flags in WPML involves updating the flag icons displayed on your website to represent different languages. If you want to choose a different flag style that best suits your website, then you can add custom flags.

Specifications for Custom Flags

  • A flag can be uploaded as an SVG, PNG, JPG, or GIF file.
  • Please be aware that SVG uploads are not supported by WordPress by default. This indicates that to upload SVG files to your WordPress website, you will want an alternative plugin.
  • Additionally, if you want the SVG source file to appear exactly next to WPML’s default flags, you must ensure that it measures 18 by 12 pixels.

Steps to Add Custom Flags

  • Navigate to WPML-> Languages-> Edit Languages
  • Enable the custom flag option of your desired language and click on choose file corresponding to it.
  • Here upload to your flag file and click on save 
  • Now your custom flag on your language switcher

Useful Tips

Verify Changes: After saving your changes, navigate to your website’s front end to verify that the custom flag icons are displaying correctly in the language switcher. Check different pages and language versions to ensure consistency.

Adjust CSS (if necessary): Depending on your website’s theme and styling, you may need to adjust the CSS to ensure that the custom flag icons are displayed correctly. Use browser developer tools to inspect the elements and make any necessary CSS adjustments.

SEO Considerations: Keep in mind that using flag icons to represent languages may not always be the most accessible option for users. Consider providing alternative text or labels for each language in addition to the flag icons for better accessibility and SEO.

By following these steps, you can change the flags in WPML to customize the language switcher on your website and enhance the user experience for multilingual visitors. Make sure that you have tested thoroughly and consider accessibility and SEO implications when making changes to the flag icons.

How to disable language

Disabling a language in WPML removes it from the language switcher and prevents it from being displayed on your website. That is if you are still translating your website and don’t want to display your website as partially translated, then you can disable/hide the language to prevent it from displaying on the front end.

To disable the language,

Navigate to the WPML Languages page and check all the languages you wish to hide under the Hide Languages section. Click the Save button once the languages have been chosen

  • After saving your changes, navigate to your website’s front to verify that the disabled language is no longer displayed in the language switcher or any other language-related elements
  • If you’ve disabled a language that was set as the default language or had translations associated with it, you may need to adjust language relationships or assign a new default language.
  • Remember that disabling a language may affect SEO, especially if you’ve already indexed your website with search engines. Make sure to set up proper redirects or update any internal or external links pointing to the disabled language.

How to use browser language redirect

Using browser language redirect in WPML allows you to automatically redirect visitors to the most suitable language version of your website based on their browser’s language preferences. 

Navigate to the WPML → Languages page and locate the Browser language redirect option to enable browser language redirect.

To redirect visitors, you have two options,

  • Only redirect visitors if translations exist
  • Always redirect visitors. If you select “always redirect,” users will be taken to the homepage in the default language if no corresponding translation is available, or to translated content when it is.
  • The default option is Not to redirect visitors.

How to use currency switcher

To use the currency switcher feature in WPML, you’ll need to follow a few steps to set it up properly. 

  1. Access WPML Settings: Log in to your WordPress Dashboard and navigate to the WPML settings. You can find this option in the WordPress admin sidebar under “WPML”.
  1. Enable WooCommerce Multilingual: If you haven’t already done so, make sure to enable the WooCommerce Multilingual plugin, which is included with WPML. This plugin allows you to translate WooCommerce products and enables currency-switching functionality.
  2. Configure Currency Settings: Within the WPML settings, locate and click on the “Currency” tab or a similar option related to currency settings. Here, you’ll be able to configure the currency switcher options.
  3. Enable Currency Switcher: Look for an option to enable the currency switcher. This may be by selecting a checkbox that allows you to activate the currency switcher feature.
  4. Select Available Currencies: After enabling the currency switcher, you’ll need to select the currencies you want to make available on your website. You can choose from a list of supported currencies or add custom currencies if needed.
  5. Set Exchange Rates: WPML allows you to manually set exchange rates for each currency or use an automatic exchange rate provider to update rates regularly. Choose the option that works best for your needs and configure the exchange rates accordingly.
  6. Configure Currency Switcher Display: Depending on your theme and preferences, you may want to customize how the currency switcher is displayed on your website. WPML provides options to display the currency switcher in the header, footer, sidebar, or as a dropdown menu.
  7. Save Changes: After configuring the currency switcher settings, make sure to save your changes. There should be a “Save” or “Update” button at the bottom of the settings page.
  8. Test Currency Switching: To ensure that the currency switcher is working correctly, visit your website and test the currency-switching functionality. Try switching between different currencies to see if prices update accordingly.
  9. SEO Considerations: Keep in mind that currency switching may affect SEO, especially if you have different currency versions of your website indexed with search engines. Make sure to set up proper hreflang tags and update any SEO-related settings to ensure that search engines can crawl and index the correct currency versions of your website.

By following these steps, you can use the currency switcher feature in WPML to offer multi-currency support on your WooCommerce website, providing customers with the flexibility to shop in their preferred currency.

How to set up different domains per language

Setting up different domains per language in WPML allows you to create a multilingual website where each language version of your site is accessible via its domain. 

Steps to set up different domains per language:

  1. Configure Language Domains:
  • Go to WPML > Languages > Language URL Format.
  • Scroll down to the “Domain per language” section.
  • Enable the “Different domain per language” option.
  • Enter the domain for each language. For example:
    • English: sampletest.com
    • French: sampletest.fr
    • German: sampletest.de
  1. DNS Configuration:
    • Set up DNS records to point each domain to your WordPress installation. This involves adding A records or CNAME records pointing to your server’s IP address.
  2. Update WordPress Address and Site Address:
    • Go to Settings > General in your WordPress admin dashboard.
    • Update the WordPress Address (URL) and Site Address (URL) to match your default domain (e.g., sampletest.com).
    • This step is important to ensure that WordPress generates correct URLs for internal links and resources.
  3. Test and Verify:
    • Once everything is set up, test your language-specific domains to ensure they’re correctly pointing to the respective language versions of your site.
    • Verify that language switching between domains works as expected.
  4. Optional: Content and SEO Considerations:
    • Ensure that your content, including posts, pages, and menus, is properly translated and localized for each language.
    • Pay attention to SEO settings for each language version, including meta tags, titles, and descriptions.
    • Consider setting up hreflang tags to indicate language and regional variations to search engines.

By following these steps, you can set up different domains per language in WPML, allowing you to create a multilingual website with language-specific URLs for each version of your content.

How to change the country flag

To change the country flag in WPML, you need to adjust the language settings within the plugin. Here’s a general guide on how to do it:

  1. Language Switcher Settings: Navigate to WPML -> Languages. Look for the option related to language switcher settings. This is where you can configure how the language switcher appears on your website, including the flags.
  2. Change Flag Icons: Within the language switcher settings, there should be an option to choose the flag icons for each language. WPML provides a default set of flag icons, but you can also upload custom flag icons if needed.
  3. Save Changes: After you’ve selected the flag icons for each language, make sure to save your changes.
  4. View Changes: Visit your website to see the updated language switcher with the new flag icons.

Conclusion

The WPML plugin offers powerful tools for website localization and language management, making creating a multilingual website customized to your audience’s needs easier than ever. Through its intuitive interface and extensive features, WPML streamlines the process of translating and localizing content, while also providing options for customizing language switchers, including country flags. By manipulating WPML’s capabilities, website owners can effectively reach and engage with diverse global audiences, enhancing user experience and expanding their online presence across language barriers.