Mass Create All Translation Sets with GlotPress

November 28, 2018|

We’ve been setting up translation support for extensions using GlotPress. If you’re using this too you may have hit the problem of having to add each set one by one, from GlotPress. When you create a new project, it doesn’t have any translations and all translation sets have to be created one by one This was super time consuming with over 200+ translation sets to add. Sure, you could just add the main ones, but why not do it properly and add them all? The solution? Some code 🙂 I wrote a small snippet of code to do this for me, which I hacked in to fire on the first translation set create. This then loops through and adds them all for me. It uses the English name for the name of the set and the default option for the slug.  Be sure to change your project ID (if it isn’t…    read more