rubenv/grunt-angular-gettext

Strings from JS files not being extracted

smehrbrodt opened this issue · 4 comments

I have the following configuration:

    nggettext_extract: {
      pot: {
        files: {
          'po/template.pot': ['app/**/*.html', 'app/**/*.js']
        }
      }
    },

All strings from the html files are included in the template.pot file after running this task, but not a single string from any javascript file (no matter if I use gettext('some string') or gettextCatalog.getString('some other string')).

Am I missing something?

Can you post your JS?

import 'danialfarid/ng-file-upload/dist/angular-file-upload-all';
import 'ngImgCrop/compile/unminified/ng-img-crop';
import 'ngImgCrop/compile/unminified/ng-img-crop.css!';
import 'angularUtils-pagination';
import 'nsPopover';

import 'person/filters/person-filters';
import {PersonController} from 'person/controllers/person-controller';
import {PersonCreateController} from 'person/controllers/person-create-controller';
import {PersonEditController} from 'person/controllers/person-edit-controller';
import {PersonViewController} from 'person/controllers/person-view-controller';
import {PersonService} from 'person/services/person-service';

export var gemPersonModule = angular.module('gem.person',
  [
    'ui.router',
    'lbServices',
    'angularUtils.directives.dirPagination',
    'nsPopover',
    'angularFileUpload',
    'ngImgCrop',

    'personFilters',
    'dateFilters',

    'gem.address'
  ]
).config(
  ($stateProvider, $compileProvider, gettext) => {
    $stateProvider.state('person', {
      url: '/person',
      template: '<ui-view/>',
      data: {
        pageTitle: gettext('Person'),
        component: 'person'
      },
      abstract: true
    }).state('person.list', {

      url: '/list',
      templateUrl: '../person/views/person.list.html',
      data: {
        pageSubTitle: gettext('Create and edit Person')
      },
      acl: {
        needRights: ['$authenticated']
      }
    }).state('person.view', {
      url: '/view/:id',
      templateUrl: '../person/views/person.view.html',
      data: {
        pageSubTitle: gettext('View Person details')
      },
      acl: {
        needRights: ['$authenticated']
      }
    }).state('person.create', {
      url: '/create',
      templateUrl: '../person/views/person.create.html',
      data: {
        pageSubTitle: gettext('Create a Person')
      },
      acl: {
        needRights: ['$authenticated']
      }
    }).state('person.edit', {
      url: '/edit/:id',
      templateUrl: '../person/views/person.edit.html',
      data: {
        pageSubTitle: gettext('Edit a Person')
      },
      acl: {
        needRights: ['$authenticated']
      }
    });

    // Allow skype urls http://stackoverflow.com/a/15769779
    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|file|skype):/);
  }
);

gemPersonModule.controller('PersonController', PersonController);
gemPersonModule.controller('PersonCreateController', PersonCreateController);
gemPersonModule.controller('PersonViewController', PersonViewController);
gemPersonModule.controller('PersonEditController', PersonEditController);

gemPersonModule.factory('PersonService', PersonService);

Closing this since it's an issue with angular-gettext-tools