android-studio-plugin icon indicating copy to clipboard operation
android-studio-plugin copied to clipboard

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

Open EvgeniyKu opened this issue 4 years ago • 12 comments

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) ?

EvgeniyKu avatar May 19 '21 11:05 EvgeniyKu

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.

nhammami avatar Jul 14 '21 10:07 nhammami

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.

andrii-bodnar avatar Jul 27 '21 13:07 andrii-bodnar

Hi @andrii-bodnar

So you can check this Sample Android Flavor project

you can see in this project there is three flavors :

  • free
  • paid
  • promo

and the configuration in gradle

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

Thank you for your attention.

Best Regards, Nouha.

nhammami avatar Jul 28 '21 10:07 nhammami

Hi @nhammami

Thanks a lot for the details provided!

andrii-bodnar avatar Jul 28 '21 11:07 andrii-bodnar

Thank for you @andrii-bodnar

Let me know please if this feature will be applied.

Thanks,

Best Regards, Nouha.

nhammami avatar Jul 28 '21 11:07 nhammami

Any updates with this issue?

SteinerOk avatar Apr 12 '22 12:04 SteinerOk

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%

andrii-bodnar avatar Apr 12 '22 13:04 andrii-bodnar

@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

SteinerOk avatar Apr 12 '22 14:04 SteinerOk

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

andrii-bodnar avatar Apr 12 '22 15:04 andrii-bodnar

@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

SteinerOk avatar Apr 12 '22 15:04 SteinerOk

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

Yakoot avatar Jun 15 '22 08:06 Yakoot

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

andrii-bodnar avatar Jun 15 '22 08:06 andrii-bodnar