Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Splitting plugin language files for frontend and admin

Discussion in 'Misc WordPress Requests' started by Seguinot, Mar 27, 2018.

  1. Seguinot


    Reply To: Splitting plugin language files for frontend and admin, by Seguinot

    I implemented a personal solution to split my pot file into 4 different pot files.
    This solution is based on a modified version of makepot.php which contains a new function (or project) called ‘wp-plugin-split’

    Attention: the proposed tools is in beta release, it needs further test to validate the method.

    The modified makepot.php and accompanying file makepot_args.php can be found in the i18n folder of my plugin
    You can test it by just modify your call to makepot using a command line like: php makepot.php wp-plugin-split /path/to/my/plugin-dir

    If the makepot_args.php is not present, makepot will render a single .pot file like the command php makepot.php wp-plugin /path/to/my/plugin-dir do.

    See my explanation about how to configure multiple pot files in makepot_args.php file.

    Please care to not erase old translation when switching to multiple pot files. For each language you must manually copy/split every existing .po file into several .po file as explained in makepot_args.php

    Similarly, when switching back to one single pot file every .po files of one language must be merge manually into one single file.

    If my method were to be used for splitting plugin pot files, several problems must be adressed:

    • Is makeplots_args.php a good solution for this problem ? Where should we locate this file ? (currently I put it in /i18n folder)
    • admin frontend and common pot filenames may be normalized.
    • Should the common pot file be named plugin_name.pot (that name is already used for single pot file) or plugin_name-common.pot (that creates a new pot file but avoid confusion with single pot file)?

    Reply To: Splitting plugin language files for frontend and admin

Share This Page

Monarch Social Sharing Plugin