Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating partial files #71

Open
pixelfriese opened this issue Mar 10, 2016 · 0 comments
Open

Generating partial files #71

pixelfriese opened this issue Mar 10, 2016 · 0 comments

Comments

@pixelfriese
Copy link

Hi,

i´m using the angular-translate partialLoader for my project with the following file structure:

i18n
-- de
-- -- app.json
-- -- global.json
-- en
-- -- app.json
-- -- global.json

In my code the placeholder have the following naming:
{{ 'app.title' | translate }} or {{ 'global.sitename' | translate }}

I put all keys with the first notation in the representing json files, e.g. app.title is a translation entry of the file app.json:

en:
app.json

{
    "app": {
        "title": "My title",
        "subname": "another translation"
    }
}

global.json

{
    "global": {
        "sitename": "My sitename"
    }
}

de:
app.json

{
    "app": {
        "title": "Mein Titel",
        "subname": "eine weitere Übersetzung"
    }
}

global.json

{
    "global": {
        "sitename": "Mein Seitenname"
    }
}

And now the question: Is it possible with grunt-angular-translate to extract the first key of the naming, e.g. app.title.[...] and write (or update) the translation in the corresponding file (here app.json)? If there is no file with this name, create it. How is it possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant