Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 11 commits ahead, 1 commit behind WP-Translations:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Grunt Transifex WordPress

Prepared for WordCamp SLC 2015 by Dovy Paukstys

A set of grunt tasks to integrate i18n tools and Transifex to your WordPress plugin/theme Grunt workflow.

  • Create a .pot file

  • Create a .pot file and push it to Transifex

  • Pulls translations from Transifex and create the needed .mo files

  • Compile: Builds a zip folder of all your files - ready to deploy

Also light support for WebTranslateIt if preferred.


Getting started

If you haven't used Grunt before, check out Chris Coyier's post on getting started with Grunt.

And for more WP-Grunt optimization Supercharging your Gruntfile.

All Grunt configuration are separated into different files already setup for you and almost all Grunt config setups are done in the package.json file

Clone this repo, cd to the directory, run npm install to install the necessary packages.

git clone
cd grunt-transifex-wordpress
npm install

Setup & Configuration


TX configuration

Make sure you have a ~/.transifexrc. It is unique per user and stores the hostname, username and password for every Transifex server that you are using. It is stored in the user's home directory.

username = user
token =
password = p@ssw0rd
hostname =

More info about setting up your Transifex client

TX client config file

In .tx->config replace the project_slug and the pot_slug by your own Transifex project and organization.


All variables are setup in this file. Change all settings to reflect your own project details. Should be pretty strait forward.

package.json customizations

In your package.json, replace in the section named pot the data below:

  "directories": {
    "js": "",
    "sass": "",
    "css": "",
    "build": "./build",
    "languages": "./languages"
  "pull_percentage": "75",
  "pot": {
    "type": "wp-plugin", // wp-plugin or wp-theme
    "textdomain": "example-textdomain", // Your custom textdomain
    "default_lang": "en_US", // Default language of your project
    "include": [], // Files you want to include outside of this directory
    "exclude": [], // Files you want to exclude from within this directory
    "header": {
      "bugs": "", // Header for your pot file
      "team": " <>", // Team name
      "last_translator": " <>" // Last person to update the pot

That's it you're ready to take over the world with these commands!

How it works

Generate .pot file

grunt makepot

Check/replace textdomains and run makepot

grunt build:i18n

Generate .pot file and push it to Transifex

grunt tx-push

Pulls translations from Transifex and create the .mo files

grunt tx-pull

Automatically change all textdomains in the project with the declared pot.textdomain value

BE SURE to include all possible textdomains in your project to the grunt/addtextdomain.js file under updateDomains OR you'll get duplicated domains added to functions that will mess things up.

grunt updatedomains

Extras: Builds a zip folder of all your files - ready to use

grunt build

Thanks to:

grunt-transifex-wordpress by FX Bénard of for the base of this repo.

grunt-potomo by AxisThemes to generate automatically the .mo files.

transifex client the client command tool and much more ...

All the Grunt Crew & @grappler, the i18n Petit-Suisse expert ;)


A Grunt workflow for integrating Transifex in your WordPress projects






No releases published


No packages published


  • PHP 55.8%
  • JavaScript 44.2%