Loco Translate issues and how to fix them?

loco translate

Loco Translate is a powerful tool for translating WordPress themes and plugins. However, users often face challenges that affect the quality and efficiency of the translation process. 

In this guide, we’ll address the most common issues users face with Loco Translate, explain why they occur, and provide practical solutions to ensure that your translations are displayed correctly and efficiently on the front end.

1. Translations Not Displaying on the Frontend

Detection:

Translations appear correctly in the backend but do not reflect on the live site.

Possible Causes:

  • Browser or server caches serve outdated content, which prevents the latest translations of strings from appearing correctly on your website.
    • Solution: Clear your browser cache, site cache, and any Content Delivery Network (CDN) caches to ensure the latest translations are displayed.
  • The site language may not be set to the desired language, because of which untranslated strings or default content are shown.
    • Solution: Navigate to Settings → General in your WordPress dashboard and set the ‘Site Language’ to your target language.
Site language settings
  • Some themes or plugins load their own translation files or modify strings using hooks or filters because of which they might have overridden the translations.
    • Solution: Temporarily deactivate other plugins and switch to a default theme to identify conflicts.
  • Updates typically replace all existing files, including any translation files that were manually edited or added, thus updated themes or plugins overwrite translation files stored in their directories, which leads to the loss of custom translations.
    • Solution: Save translations in the languages/loco/plugins or languages/plugins directory to protect them from being overwritten during updates.
.po files location selection

2. Missing or Incomplete Translations

Detection:

Certain strings remain untranslated despite being translated in Loco Translate.

Possible Causes:

  • Outdated Translation Templates: The .pot file does not include all translatable strings.
  • Dynamic or Database-Stored Strings: Some strings are generated dynamically or are stored in the database, making them inaccessible to translation tools like Loco Translate.
  • Incorrect Text Domain Usage: Themes or plugins with incorrect text domains, cause translations to fail.

Solution: 

  • Use Loco Translate’s ‘Sync’ feature to update the translation template with the latest strings.
Edit template
Loco Translate Sync setting
  • Consult the theme or plugin developer to understand how these strings can be translated. 
  • Ensure that the text domain in the translation files matches the one used in the theme or plugin code.

3. Errors When Saving or Syncing Files

Detection:

Encountering HTTP errors (e.g., 404 Not Found, 403 Forbidden) during save or sync operations.

Possible Causes:

  • Server settings might have blocked certain operations, such as file permissions or script executions, which restrict the translation functionalities.
  • Insufficient permissions prevent file modifications, restricting the ability to create, edit, or save translation files. If the translation tool or WordPress itself cannot access or write to the necessary files due to restricted permissions, updates to translations will also fail. 

Solution: 

  • Check server error logs for details and consult your hosting provider to adjust configurations as needed. 
  • Ensure that the WordPress installation has the necessary permissions to read and write translation files.

4. Memory Limit Exhausted Errors

Detection:

Errors indicate that the allowed memory size has been exhausted, especially during sync operations.

Possible Causes :

  • When translation files are large, they require more resources to load and process, which impacts website speed or leads to errors.

Solution: Increase the PHP memory limit by editing the wp-config.php file or by consulting your hosting provider.

5. Specific Strings Not Translating

Detection:

Certain words or phrases remain in the original language despite being translated.

Possible Causes:

  • The string in the translation file doesn’t exactly match the one in the code. Even a small difference, such as extra spaces, punctuation, or case sensitivity, causes the translation to fail.
  • Some text shown via JavaScript is not translatable through standard methods, as translation tools like Loco Translate typically rely on PHP-generated strings. When text is dynamically generated by JavaScript, it’s often not included in the translation files, meaning it can’t be translated automatically.

Solution

  • Ensure that the source text in the translation file matches the exact string in the code, including punctuation and spacing. 
  • Check if the theme or plugin properly localizes JavaScript strings and consult the developer for guidance.

6. Translation Files Disappearing After Updates

Detection:

Translations are lost after updating themes or plugins.

Possible Causes:

  • Updates overwrite Theme/Plugin directories, leading to a loss of translations, especially if the translation files are stored within the theme or plugin’s folder. When a theme or plugin is updated, its files are replaced with the new version, which removes or overwrites any custom translation files.

Solution: Store translations in the languages/loco/plugins or languages/plugins directory to prevent them from being overwritten during updates.

.po files location selection

7. Issues with Translating WooCommerce

Detection:

WooCommerce-specific strings not translating as expected.

Possible Causes:

  • Themes are overriding WooCommerce templates, affecting translations, because when a theme customizes WooCommerce templates, it alters or replaces default WooCommerce strings. If the theme’s custom templates do not support the translated strings, it causes the translations to fail or display incorrectly.

Solution: Check if the theme contains its translation files for WooCommerce and ensure they are properly translated.

By identifying these common issues and applying the corresponding solutions, users can enhance their experience with Loco Translate and ensure accurate translations across their WordPress sites.

For an even more powerful translation experience, consider using the Loco Translate Addon Plugin. It allows you to auto-translate thousands of strings within just a few clicks, saving time and effort. You don’t need any extra API subscriptions for services like Google or Yandex, and you can handle unlimited translations without additional costs. This addon is beneficial for handling large websites or multiple language files.

Share This Post...
Table of Contents

Add a Comment

Share This Post...