Skip to content

Support the translate-namespace directive #78

@sgilroy

Description

@sgilroy

Namespaces are supported by grunt-angular-translate, but not the https://angular-translate.github.io/docs/#/api/pascalprecht.translate.directive:translateNamespace directive. The translate-namespace directive allows a developer to avoid repeating the namespace in a view by extracting it to a parent element.

That is, given the following example:

    <div translate-namespace="CONTENT">
      <div translate-namespace=".HEADERS">
          <h3 translate id="example_title">.TITLE</h3>
          <h3 translate id="example_welcome">.WELCOME</h3>
      </div>
      <span translate>COMMON.FIRST_LINE</span>
    </div>

Expected:

{
    "CONTENT": {
        "HEADERS": {
            "TITLE": "",
            "WELCOME": ""
        }
    }
    "COMMON": {
        "FIRST_LINE": ""
    }
}

Actual:

{
    "0": {
        "TITLE": "",
        "WELCOME": ""
    }
    "COMMON": {
        "FIRST_LINE": ""
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions