Prevent deletion of languages files with theme and plugins update

Updated: February 13, 2017

If you are creating translations on your own, or you are editing translations provided by us in AIT Languages plugin, you have probably stored your translation files directly in folder of theme ./wp-content/themes/themeName/ait-theme/languages/ or plugin ./wp-content/plugins/pluginName/languages

In both cases mentioned above you will lost your translations with theme or plugin update, because update will delete folder of theme or plugin and replace it with new folder where are stored default theme files.

Where should be stored translations files safely to prevent their deletion?

  • Child Theme – store translation files of Theme in child theme folder: ./wp-content/themes/ChildThemeName/ait-theme/languages/de_DE.mo
  • default WordPress languages folder – store translation files of theme in wordpress folder : ./wp-content/languages/themes/
    name of your .mo file must include the name of active theme, if your active theme is in folder ./wp-content/themes/my-theme, translation file name is my-theme-de_DE.mo.
    The same way you can store translation files for plugins in folder ./wp-content/languages/plugins/
close

If you are going to edit po file and change translations over FTP, download po file to your computer and edit file locally, because generated mo file is not uploaded to your server automatically with saved po file!

About Ivan Hudak

Works as an IT consultant for over 7 years now. He's a manager of our support team. Knows everything about all our themes, HTML, CSS, PHP and jQuery.