WordPress.org

Ready to get started?Download WordPress

Ideas

A wat to preserve language files when updating themes and plugins

  1. Jan Egbert
    Member

    12345

    In the current situation when I update a theme or plugin all files are deleted before the updated software is being put in place. This means that language files which are not incorporated in the theme or plugin are gone after update.

    I have two suggestions:

    1. Search for translation files in the languages folder in wp-content and wp-includes.
    2. Let the update script check for extensions .po and .mo before deleting all files.
      Posted: 4 years ago #
    1. Mark
      Member

      12345

      I see the problem. But what if the plugin includes updated translation files?

      Posted: 4 years ago #
    2. Jan Egbert
      Member

      12345

      The best method would probably be to overwrite existing .po and .mo files.

      BTW The reason I submitted this idea is that I rarely use the easy update feature in WordPress. So I'm still stuck with the old fashioned downloading, unpacking, FTP uploading, etc.

      Posted: 4 years ago #
    3. kallumamaji
      Member

      Best thing would be to submit your translation to GLOTPRESS
      available at http://translate.wordpress.org/projects which is also completely in sync with the main repositories and the preferred method for translating WordPress into your language.

      This way your translation will be incorporated into plugin

      Posted: 2 years ago #
    4. brasofilo
      Member

      12345

      I'd suggest that /wp-content/languages/plugin-name.mo be the first place where a plugin/theme search for its language files.

      Then it's up to the user to sync new versions with his translated files.

      Sometimes, you update something (in development or production site) and then "ups..., forgot to backup my translations..."

      Posted: 2 years ago #
    5. Why not make a child theme to preserve the custom language? For me that seems to be the best solution...

      Posted: 2 years ago #
    6. brasofilo
      Member

      12345

      @Binary, only if there were child plugins too :)

      Posted: 2 years ago #
    7. Ipstenu (Mika Epstein)
      Half-Elf Support Rogue & Mod

      The perfect world is supposed to be that the plugin dev will add any language packs you send them. Doesn't always happen.

      Option 1 would be best, IMO. Just totally separate it, so if you have to delete a plugin due to bug sillyness, it's easier to replace.

      Posted: 2 years ago #
    8. OC2PS
      Member

      12345

      I think you should encourage plugin developers to use GlotPress.

      At the same time, the framework should provision for "child translations" for GlotPress (the few fields where site owner can specify a custom translation different from the GlotPress version)

      Posted: 2 years ago #
    9. brasofilo
      Member

      12345

      Just found an excellent article: Loading WordPress language files the right way, by Geert de Deckere.

      My conclusion from 4 lines of code is that it is up to plugin and theme developers to do it the right way: check first inside WP_LANG_DIR and fallback to defaults if not found there.

      IMO, now it's a matter of getting this info in the Codex and related documents. Encourage plugin/theme authors to implement this concept and give a clear advice to users where to put his/hers translated files.

      Just tested with one of my plugins and it works!

      Posted: 2 years ago #

    RSS feed for this topic

    Reply

    You must log in to post.

    • Rating

      12345
      16 Votes
    • Status

      This idea is under consideration