1

I am building an angular app, with internationalization using angular-gettext. I would like to know how to better automate the workflow when updating the translation files.

Currently it is the following: - running "grunt" (generation of pot file + translation files) - opening all "po" files in poedit - in poedit, update po file with the new "pot" file - update translations in poedit & save - run grunt again

Is there a way to have something better? Like, is it possible to apply the pot file to all "po" files using a grunt command?

Here is my gruntfile currently. Thanks a lot

module.exports = function(grunt) 
{
    grunt.initConfig({
          nggettext_extract: {
            pot: {
              files: {
                'po/template.pot': ['www/app/**/*.html']
              }
            },
          },
          nggettext_compile: {
            all: {
              options: {
                module: 'app'
              },
              files: {
                'www/resources/translations.js': ['po/*.po']
              }
            },
          }
        });

    grunt.loadNpmTasks('grunt-angular-gettext');

    // Default task(s).
    grunt.registerTask('default', ['nggettext_extract', 'nggettext_compile']);
}
bobby
  • 674
  • 3
  • 10
  • 14
  • I too am trying to find a way to do this. A similar implementation i used once with asp.net mvc did the job of adding blank translations to the po files (from the pot file) for me. Its terribly tedious otherwise – Sam Apr 03 '15 at 14:33

2 Answers2

0

poedit doesn't have a command line argument to execute the "Update from pot" file feature. So I don't think it will be possible with it.

Gaetan
  • 488
  • 4
  • 13
0

Actually there is a way to do this!

We wrote grunt tasks to call command line gettext utilities. They are also available for windows here.

Basically you need to call msgmerge with the po file and the pot file to update it. See the online documentation for msgmerge to see what you may need. It's pretty slick once you get it going.

Austin Thompson
  • 2,251
  • 1
  • 17
  • 23