poeditor-gradle icon indicating copy to clipboard operation
poeditor-gradle copied to clipboard

Possibility to add multiple configurations per project

Open karl-ravn opened this issue 10 years ago • 1 comments

When having several flavours (for android), you need to create multiple projects in order to have different project ids in poeditor. Otherwise, it seems to be uncertain which project will get downloaded.

It seems to not matter which project you run poeditors commands from, both projects will get pulled/pushed.

Workaround in build.gradle file is:

project(':TranslationA') {
    apply plugin: 'poeditor'

    poeditor {
        apikey 'xxxxxxxxxxxxxxxxxxxxxxx'
        projectId '12345'
        type 'android_strings'
        tagsNew '1.0'

        terms 'App/src/main/res/values/localization_strings.xml'
        trans 'en', 'App/src/A/res/values/localization_strings.xml'
        trans 'nl', 'App/src/A/res/values-nl/localization_strings.xml'

    }
}

project(':TranslationB') {
    apply plugin: 'poeditor'

    poeditor {
        apikey 'xxxxxxxxxxxxxxxxxxxxxxx'
        projectId '54321'
        type 'android_strings'
        tagsNew '1.0'

        terms 'App/src/main/res/values/localization_strings.xml'
        trans 'en', 'App/src/B/res/values/localization_strings.xml'

    }

}

karl-ravn avatar May 25 '15 22:05 karl-ravn

@karl-ravn Sorry for the late response. Somehow i didn't got notified by github that you opened an issue. I understand the issue. If you have 2 projects configured and you run gradle poeditorPull it will download the translations from both right?

How can we fix this? Is it possible to make the declaration of poeditor dynamic (i'm not an experience gradle plugin dev:)). For example:

poeditorProjectA {
 ...
}

poeditorProjectB {
 ... 
}

This will add the following tasks to your gradle:

gradle poeditorProjectAInit
gradle poeditorProjectAPull

gradle poeditorProjectBInit
gradle poeditorProjectBPull

Will this work for multi project configuration or do propose another way of configuration?

lukin0110 avatar Jul 09 '15 13:07 lukin0110