WPLMS – secure translation files from updates / using Poedit

WPLMS is a Learning Management System for WordPress. Translation files in WPLMS are located in

  1. /wp-content/themes/wplms/languages/
  2. /wp-content/plugins/vibe-course-module/languages/
  3. /wp-content/plugins/vibe-customtypes/languages/
  4. /wp-content/plugins/vibe-shortcodes/languages/
  5. /wp-content/plugins/wplms-assignments/languages/
  6. /wp-content/plugins/wplms-dashboard/languages/
  7. /wp-content/plugins/wplms-events/languages/
  8. /wp-content/plugins/wplms-front-end/languages/

These language files will be overwritten with new files on every update, destroying any custom translation changes.

THE THEME

Move your theme into a child theme and translate your theme there (/wp-content/themes/your-child-theme/languages/).

Make sure that language files are loaded from your child theme. Add the following action to your functions.php and use “vibe” as the domain, not the actual theme name.

  1. add_action( 'after_setup_theme', 'my_child_theme_setup' );
  2.  
  3. function my_child_theme_setup() {
  4.  load_child_theme_textdomain( 'vibe', get_stylesheet_directory() . "/languages" );
  5. }

THE PLUGINS

Use the global language folder for the WPLMS plugin translations. The WPLMS plugin loader checks, if a global language file actually exists :)

  1.  if ( file_exists( $mofile_global ) ) {
  2.         load_textdomain( 'vibe', $mofile_global );
  3.     } else {
  4.         load_textdomain( 'vibe', $mofile_local );
  5.     }
  1. /wp-content/languages/plugins/vibe-de_DE.mo
  2. /wp-content/languages/plugins/vibe-customtypes-de_DE.mo
  3. /wp-content/languages/plugins/wplms-assignments-de_DE.mo
  4. /wp-content/languages/plugins/wplms-dashboard-de_DE.mo
  5. /wp-content/languages/plugins/wplms-events-de_DE.mo
  6. /wp-content/languages/plugins/wplms-front-end-de_DE.mo
  7. +++

POEDIT

I suggest using Poedit, as it allows you to do the translation on the Desktop. It also offers options to update your file with an updated WPLMS language file, allowing you to add new translation strings if needed :)

PREPARE

A. Create the structure for the update and download new PO files from WPLMS

  1. /wp-content/themes/wplms/languages/
  2. /wp-content/plugins/vibe-course-module/languages/
  3. /wp-content/plugins/vibe-customtypes/languages/
  4. /wp-content/plugins/vibe-shortcodes/languages/
  5. /wp-content/plugins/wplms-assignments/languages/
  6. /wp-content/plugins/wplms-dashboard/languages/
  7. /wp-content/plugins/wplms-events/languages/
  8. /wp-content/plugins/wplms-front-end/languages/

B. The target structure / your current language files

  1. /wp-content/themes/your-child-theme/languages/de_DE.mo /.po
  2. /wp-content/languages/plugins/vibe-de_DE.mo /.po
  3. /wp-content/languages/plugins/vibe-customtypes-de_DE.mo /.po
  4. /wp-content/languages/plugins/wplms-assignments-de_DE.mo /.po
  5. /wp-content/languages/plugins/wplms-dashboard-de_DE.mo /.po
  6. /wp-content/languages/plugins/wplms-events-de_DE.mo /.po
  7. /wp-content/languages/plugins/wplms-front-end-de_DE.mo /.po
  8. +++

C. Open your current .PO file from target structure

D. Update with new and matching .PO file from A. (Catalog -> Update from POT file)

This will check for new or obsolete strings and update your language file.

E. New strings added

F. Obsolete strings removed

G. Save and upload updated .PO + .MO files from target structure to server.

Again, make sure to use the global language folder and the child theme languages folder !

Panic time after updates is over :)

Enjoy coding ….

Alex

I am a full-stack developer. I love programming,  design and know my way around server architecture as well.  I would never feel complete, with one of these missing. I have a broad range of interests, that’s why I constantly dive into new technologies and expand my knowledge where ever required. Technologies are evolving fast and I enjoy using the latest. Apart from that, I am a peace loving guy who tries to have people around him that think the same.  I truly believe in the principle: “If you help someone, someone will help you, when you need it."

Recent Posts

Particle Network Animations in Javascript

What are particle animations? Particle network animations in JavaScript typically involve creating visual representations of… Read More

2 days ago

B&B / Hotel Booking Solutions for WordPress | 2024

BOOKING SOLUTIONS 202x This is my take on a subset of booking, appointment, PMS or… Read More

1 month ago

WordPress Cron + WP-CLI + Ntfy

THE GOAL Create a system cron for WordPress, that is accessible and can be easily… Read More

2 months ago

2024 is here and now :)

2024, what's cooking? Slowly getting into the 2024 spirit. 3 projects coming to a close… Read More

4 months ago

2023 ends and whats next !

Short look back at 2023 This has been a busy and interesting year. I am… Read More

4 months ago

cubicFUSION Grid Tweaker – Elementor Grid made easy.

Elementor Pro provides grid containers as an experimental feature. The options provided are limited, when… Read More

5 months ago