Guide

Effortless String Translation: A Step-by-Step Guide

Merve Alsan
Written by
Merve Alsan
Merve Alsan
Written by
Merve Alsan
Elizabeth Pokorny
Reviewed
Elizabeth Pokorny
Elizabeth Pokorny
Reviewed by
Elizabeth Pokorny
Effortless String Translation: A Step-by-Step Guide

String translation is a fundamental aspect of creating a multilingual WordPress website. It involves translating all text elements on your site, from visible content to hidden metadata, ensuring every piece of text is available in multiple languages.

This process can be complex, especially when dealing with theme and plugin strings, dynamic content, and special elements like URL slugs.

However, WordPress solutions like Weglot make string translation stress-free. Unlike traditional methods that require manual identification and translation of strings, Weglot automates much of the process.

This guide will walk you through the process of using Weglot for comprehensive string translation on your WordPress site.

What WordPress Strings Do You Need to Translate?

Before diving into the translation process, it's important to understand the different types of strings you'll encounter in WordPress:

  1. Content Strings: Text in your posts, pages, and custom post types.
  2. Theme Strings: Text hardcoded in your theme files.
  3. Plugin Strings: Text from various plugins, including form labels, pop-up messages, and error notifications.
  4. WordPress Core Strings: Default text from WordPress itself.
  5. URL Slugs: The part of a URL that identifies a specific page or post.
  6. Widget Text: Content within your website's widgets.
  7. Menu Items: The text of your navigation menu items.

Weglot can translate all of these string types.

WordPress String Translation Tutorial

Weglot offers a unique approach to string translation:

  1. Automatic Detection and Translation: Weglot automatically detects all translatable content on your site and translates it instantly.
  2. Language Switcher: A language switcher is automatically added to your site's front-end, giving you more customization options than WPML's language switcher.
  3. Rapid Setup: You can have a fully functional multilingual WordPress site in just a few minutes.
  4. Manual Refinement: After automatic translation, you can manually refine translations or outsource them to professional services.

Follow these steps to translate strings on your WordPress site:

1. Install and Activate Weglot

Download and install Weglot from the WordPress repository or weglot.com.

2. Configure Basic Settings

Set up your desired languages in the Weglot configuration panel.

Weglot configuration - setting up your desired languages

3. Automatic Translation

Weglot automatically detects and translates all strings on your site upon setup.

4. Access Translation Management Interfaces

Weglot offers two interfaces for managing translations:

a) Translation List Interface

  • Go to your Weglot dashboard > Translations > Languages page
  • View original strings on the left and translations on the right
  • Search for specific strings
Translation List
  • Edit translations directly in this interface
  • Mark translations as “assigned to” or “reviewed by”

b) Visual Editor

  • To start translating strings, go to you Visual Editor
How to get to the Visual Editor
  • Click “Start editing”, which redirects you to an editable visual preview of your site
  • To translate a string, click on the blue pencil and start editing

5. Refine Translations

Use either interface to:

  • Navigate through your site's content
  • Edit automatic translations for accuracy
  • Save changes as you go

6. Handle Special String Types

Some strings require special attention due to their nature or location in your WordPress site. Weglot provides specific tools to handle these:

URL Slugs

URL slugs are part of your site's permalink structure and require careful translation:

  1. In your Weglot account, go to Translations > URL Slugs
  2. You'll see a list of all URL slugs on your site
  3. Translate each slug, ensuring it makes sense in the target language
  4. Be cautious not to create duplicate slugs across languages

Remember that translating slugs can affect your site's URL structure

Dynamic Strings

Dynamic strings are those generated by JavaScript and can be challenging to detect and translate:

  1. In Weglot's advanced settings, locate the "Dynamic content" section
  2. Add CSS selectors for elements containing dynamic content
  3. This helps Weglot identify and translate strings loaded via AJAX or generated dynamically
  4. Common examples include pop-ups, chat widgets, and dynamically updated content

Test thoroughly to ensure all dynamic strings are detected and translated correctly

Excluded Words or Phrases

Sometimes, you may want to keep certain words or phrases untranslated:

  1. For recurring terms, add them to your translation glossary
Adding a glossary rule
  1. Enter the word and set the rule: you can choose between “always translate” or “never translate”
Interface to add a glossary rule to your Weglot project

7. Review and Test

After translating:

  1. Preview your site in different languages
  2. Check all translated elements, including menus and widgets
  3. Verify that dynamic content is correctly translated
  4. Test functionality to ensure translated strings display properly in all contexts

Handle WordPress String Translation with Weglot

String translation is a critical component of creating a truly multilingual WordPress website.

With Weglot, this complex process becomes significantly more manageable. By automatically detecting and translating a wide range of string types - from content and theme strings to dynamic JavaScript-generated text - Weglot ensures comprehensive coverage of your site's translatable elements.

The step-by-step approach outlined in this guide demonstrates how Weglot simplifies string translation:

  1. Automatic detection and initial translation of all strings
  2. Two intuitive interfaces for managing translations: the Translation List and Visual Editor
  3. Tools for handling special string types like URL slugs and dynamic content
  4. Options for refining translations and maintaining consistency across your site

By leveraging Weglot, you can efficiently translate all text elements on your WordPress site, regardless of their origin or complexity.

The setup process is quick, and you’ll be up and running with a multilingual site in just a few minutes. Click here to get started with your free trial today.

In this guide, we're going to look into:

Explore more about working with Weglot

Try for free