Skip to content

Instantly share code, notes, and snippets.

@UVLabs
Last active July 16, 2024 04:58
Show Gist options
  • Save UVLabs/acd63b7ffe01d677f58c7bbb73a48ed3 to your computer and use it in GitHub Desktop.
Save UVLabs/acd63b7ffe01d677f58c7bbb73a48ed3 to your computer and use it in GitHub Desktop.

Revisions

  1. UVLabs revised this gist Nov 15, 2019. No changes.
  2. UVLabs revised this gist Nov 15, 2019. No changes.
  3. UVLabs revised this gist Nov 15, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions using-makepot.md
    Original file line number Diff line number Diff line change
    @@ -35,3 +35,5 @@ If you want to generate a theme pot file, run(while inside i18n folder):
    `php makepot.php wp-theme /path/to/your/theme themename.pot`

    You can go further by creating a bash script to always run the command and move the i18n folder out of your working directory.

    Note: After running command you might get the message `sh: 1: msguniq: not found` inside your terminal. That just means it worked :)
  4. UVLabs revised this gist Nov 15, 2019. 2 changed files with 10 additions and 10 deletions.
    4 changes: 2 additions & 2 deletions make-pot.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    #!/bin/bash
    php makepot.php wp-plugin /path/to/your/plugin pluginname.pot
    #php makepot.php wp-theme /path/to/your/theme themename.pot
    php path/to/makepot.php wp-plugin /path/to/your/plugin pluginname.pot
    #php path/to/makepot.php wp-theme /path/to/your/theme themename.pot
    16 changes: 8 additions & 8 deletions using-makepot.md
    Original file line number Diff line number Diff line change
    @@ -1,37 +1,37 @@
    // All the tutorials online seem to be missing something. I was able to put them together. The following requires you being able to use wget and php commands inside your terminal. You can use svn in place of wget.
    `All the tutorials online seem to be missing something. I was able to put them together. The following requires you being able to use wget and php commands inside your terminal. You can use svn in place of wget.`

    ### Step 1:

    Download the i18n files from: http://i18n.svn.wordpress.org/tools/trunk/

    You can do this using wget by running the following command in your terminal:

    wget -r -np -R "index.html*" http://i18n.svn.wordpress.org/tools/trunk/
    `wget -r -np -R "index.html*" http://i18n.svn.wordpress.org/tools/trunk/`

    ### Step 2:

    Download the WordPress development trunk: http://develop.svn.wordpress.org/trunk/

    Again you can do this using wget by running the following command in your terminal:

    wget -r -np -R "index.html*" http://develop.svn.wordpress.org/trunk/
    `wget -r -np -R "index.html*" http://develop.svn.wordpress.org/trunk/`

    ### Step 3:

    Navigate the contents of the development trunk folder which you downloaded in Step 2 and copy the 'pomo' folder located in trunk/src/wp-includes/ and paste it inside the i18n folder which you downloaded in Step 1, located in /tools/i18n
    Navigate the contents of the development trunk folder which you downloaded in **Step 2** and copy the `pomo` folder located in `trunk/src/wp-includes/` and paste it inside the **i18n folder** which you downloaded in **Step 1**, located in `/tools/i18n`

    At the end your i18n folder should have both the makepot.php file as well as the 'pomo' folder and the other files that were already present inside the i18n folder.
    At the end your i18n folder should have both the `makepot.php` file as well as the `pomo` folder and the other files that were already present inside the i18n folder.

    ### Step 4:

    Now you just need to run the command so that your pot file can be generated.

    If you want to generate a plugin pot file, run(while inside i18n folder):

    php makepot.php wp-plugin /path/to/your/plugin pluginname.pot
    `php makepot.php wp-plugin /path/to/your/plugin pluginname.pot`

    If you want to generate a theme pot file, run(while inside i18n folder):

    php makepot.php wp-theme /path/to/your/theme themename.pot
    `php makepot.php wp-theme /path/to/your/theme themename.pot`

    You can go further by creating a bash script to always run the command.
    You can go further by creating a bash script to always run the command and move the i18n folder out of your working directory.
  5. UVLabs created this gist Nov 15, 2019.
    3 changes: 3 additions & 0 deletions make-pot.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/bin/bash
    php makepot.php wp-plugin /path/to/your/plugin pluginname.pot
    #php makepot.php wp-theme /path/to/your/theme themename.pot
    37 changes: 37 additions & 0 deletions using-makepot.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    // All the tutorials online seem to be missing something. I was able to put them together. The following requires you being able to use wget and php commands inside your terminal. You can use svn in place of wget.

    ### Step 1:

    Download the i18n files from: http://i18n.svn.wordpress.org/tools/trunk/

    You can do this using wget by running the following command in your terminal:

    wget -r -np -R "index.html*" http://i18n.svn.wordpress.org/tools/trunk/

    ### Step 2:

    Download the WordPress development trunk: http://develop.svn.wordpress.org/trunk/

    Again you can do this using wget by running the following command in your terminal:

    wget -r -np -R "index.html*" http://develop.svn.wordpress.org/trunk/

    ### Step 3:

    Navigate the contents of the development trunk folder which you downloaded in Step 2 and copy the 'pomo' folder located in trunk/src/wp-includes/ and paste it inside the i18n folder which you downloaded in Step 1, located in /tools/i18n

    At the end your i18n folder should have both the makepot.php file as well as the 'pomo' folder and the other files that were already present inside the i18n folder.

    ### Step 4:

    Now you just need to run the command so that your pot file can be generated.

    If you want to generate a plugin pot file, run(while inside i18n folder):

    php makepot.php wp-plugin /path/to/your/plugin pluginname.pot

    If you want to generate a theme pot file, run(while inside i18n folder):

    php makepot.php wp-theme /path/to/your/theme themename.pot

    You can go further by creating a bash script to always run the command.