Skip to content

customRegex as object #73

@Ulrikop

Description

@Ulrikop

Hi,
I saw at master that I can use an object for customRegex. I was happy, because I searched a way to add prefix to some translation keys:

$stateProvider.state( /* i18nextract */ 'stateName', {
  ...
}

stateName should save as "navigation.state.statename".

So I added the following to the i18nextract options:

i18nextract: {
  default_options: {
    ...
    namespace: true,
    customRegex: {
      '\\/\\*\\s*i18nextract navigation-state\\s*\\*\\/\\s\'((?:\\\\.|[^\'\\\\])*)\': function(key) {
        return 'navigation.state.' + key;
      }
    }
  }
}

But that doesn't work. So I searched at the src of grunt-angular-translate, what I did wrong. So I found out, that this.data.customRegex is an empty object, when an object is set as customRegex.

I am not familiar with grunt task developing, so I can't find the failure. What do I do wrong?

When is it planed to build a tag with that new feature?

Thank you

edit:
I use windows 10,
node 4.4.0
grunt 0.4.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions