crowdin / android-studio-plugin

Integrate your Android project with Crowdin
https://support.crowdin.com/android-studio/
MIT License
58 stars 27 forks source link

Add the ability to use different crowdin.properties for different flavors #59

Closed EvgeniyKu closed 11 months ago

EvgeniyKu commented 3 years ago

I have several flavors in a project and want to use a separate project in crowdin for each flavor. But now i can't specify several crowdin.properties in one project. The same issue may be in case, when using several application modules.

Can the plugin grab the crowdin.properties file depending on the flavor selected? If no, can we define several properties in root folder (like crowdin-flavor1.properties, crowdin-flavor2.properties) and show submenu for each properties file (like Tools->Crowdin->flavor1->Upload Sources; Tools->Crowdin->flavor2-> Upload Sources) ?

nhammami commented 3 years ago

Hi Crowdin Team,

I have the same issue @EvgeniyKu , i want to use a separate project in Crowdin for each of my flavors, is this feature can be added in the next version of android studio plugin ?

Best Regards, Nouha.

andrii-bodnar commented 3 years ago

Hi @nhammami!

We will consider the possibility of increasing the priority of this issue. Could you please share some sample Android project that includes different flavors?

This could help us to correctly design this feature. Thanks.

nhammami commented 3 years ago

Hi @andrii-bodnar

So you can check this Sample Android Flavor project

you can see in this project there is three flavors :

and the configuration in gradle

productFlavors {
        free {}
        paid {}
        promo {}
    }

Thank you for your attention.

Best Regards, Nouha.

andrii-bodnar commented 3 years ago

Hi @nhammami

Thanks a lot for the details provided!

nhammami commented 3 years ago

Thank for you @andrii-bodnar

Let me know please if this feature will be applied.

Thanks,

Best Regards, Nouha.

SteinerOk commented 2 years ago

Any updates with this issue?

andrii-bodnar commented 2 years ago

Hi @SteinerOk!

Currently, there is a possibility to use only a single crowdin.properties file but configure patterns for each flavor.

https://github.com/crowdin/android-studio-plugin#filessourcetranslation-parameters

for example:

files.source=**/values/strings.xml
files.translation=/values-%two_letters_code%/%original_file_name%

files.1.source=app/src/main/res/values/file.xml
files.1.translation=app/src/main/res/values-%android_code%/%original_file_name%
files.2.source=ext/src/main/res/values/file.xml
files.2.translation=ext/src/main/res/values-%android_code%/%original_file_name%
SteinerOk commented 2 years ago

@andrii-bodnar I'm in a more difficult situation.

I have several productFlavors, so at the same time I need to decompose the translations into different folders, depending on the language, for example:

Primary language
app/src/main/res/values/strings.xml
Turkish
app/src/omni/res/values-tr/strings.xml
English
app/src/polidesk/res/values-en/strings.xml
andrii-bodnar commented 2 years ago

@SteinerOk, hmm, the source file is located in one module and translation files should be placed inside the other modules?

SteinerOk commented 2 years ago

@andrii-bodnar no, all files in the same module (app), but translation placed in different productFlavors. We have 2 productFlavors: omni and polidesk For omni we need translation to Turkish, and for polidesk we need translation for English

Yakoot commented 2 years ago

Hello! Any news about settings for flavors? We have structure like this, main app and two apps based on the main, but with another translations, another languages etc app --main ----values ------strings.xml ----values-id ------strings.xml ----values-zh ------strings.xml ----values-hi ------strings.xml --flavor1 ----values ------strings.xml ----values-id ------strings.xml --flavor2 ----values ------strings.xml ----values-de ------strings.xml ----values-es ------strings.xml

andrii-bodnar commented 2 years ago

@Yakoot there are no updates regarding flavors. Did you try to set up patterns for each flavor like in this example?