Mass Create All Translation Sets with GlotPress

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

https://glotpress.blog/2010/04/09/mass-create-translation-sets/

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 your first project in your GlotPress install)

    public function make_all_sets(){
        $locales = GP_Locales::locales();
        foreach($locales as $k => $v){      
            $the_set = array(
                'locale' => $k,
                'name' => $v->english_name,
                'slug'  => 'default',
                'project_id' => 1 //update as your own ID
            );
            $created_set = GP::$translation_set->create_and_select( $the_set );
            if ( !$created_set ) {
                continue;
            }
        }
    }

That’s all there is to it, the above will loop through all the sets and create them for you.

If this has helped you in any way, please like, share and comment on this post 🙂 

Less is More

It’s been a while since I’ve written on this blog. Epic Plugins has been in operation since 2012. In that period we’ve changed brand design, and changed eCommerce solutions and even changed hosts a number of times.

e-Commerce solutions

Since starting Epic Plugins in 2012, we started using WP eStore, which was good at the time but then started hitting limitations around the time of VATmoss. After WP eStore we moved to WooCommerce, for selling annually renewing subscriptions, which seemed great for a time. BUT, again this had some major limitations.

Today, we have changed again to use Easy Digital Downloads, it does what it says on the tin, makes digital downloads super easy.

WooCommerce is geared towards stores, t-shirt shops, and doesn’t do as good a job for the digital downloads.

Hosting

We’ve also changed host a number of times. There’s lots of options with hosting and we the website has developed we’ve changed our host to keep track. Again, we’ve now moved to Amazon as our host, moving away from hosting which is hard to control, and unreliable (at best)

By choosing Amazon, the sheer size of the company and software kit really makes it an attractive choice for hosting.

Plugins

We’ve also taken the opportunity to downsize the plugins which are available for purchase via Epic Plugins. We had grown and were selling 30+ different plugins through the site. While this made the store look busy, there was the following trends

  1. Only a handful of plugins sold well, some smaller plugins trickled in sales
  2. A lot of choice can be confusing, so we are now selling our main flagship plugins
  3. Support was spread thin across 30+ plugins. Downsizing helps keep updates and support manageable.

What about other plugins?

If you’ve purchased a plugin in the past which is no longer displayed on the store don’t worry, as long as your subscription is active, support and updates will continue 🙂

5 Simple Reasons You Do Not Want Too Many WordPress Plugins

How many WordPress plugins should you have on your site? There are thousands upon thousands to choose from, for every conceivable tweak or addition to your WordPress website.

It’s great for options and for extending WordPress’s already versatile and powerful abilities. You can transform your site and add amazing capabilities.

Continue reading “5 Simple Reasons You Do Not Want Too Many WordPress Plugins”