0
votes

I've built an Android apk in Delphi with RAD Studio, with messages in English and Spanish.

When I upload the apk in Google Play, Play shows in the apk details:

Localizations - default language only

Does someone know how to add more localizations? (I want to have EN and ES)

PS.- I've already tried the following, but without success:

1.- I've read that in other compilers, you can add a file per language (I.E.- values-es.xml and values-en.xml) under the plugins/android/res/ directory, but I've not found a way to follow this option in RAD-Studio.

2.- In RAD Studio, it's possible to create a .drc file to add localizations (Project > Options > Linking > Output resource string .drc > True ) and then, File > New > Other > Delphi Projects > Resource DLL Wizard > Add languajes... but this looks like is to create Windows DLL files, so, not valid for Android.

THANKS!

-


----- Added after first response from Raffaele ---------

Localizations problem in apk-google play

Localizations in google play description

Thanks a lot for your help!!!

I tried to use sometime ago the Tlang component... but as you comment, it didn't work very well, so, I decided to write the translations in the code (I was not aware of the DKLang component to create & select translations).

So, my app is already working fine in both English and Spanish (and French), no need to translate anymore. My problem is about what Google play recognizes when uploading the apk, describing in "localizations: Default language only" (as per screenshot) while it should be shown EN + ES + FR (as the app works fine in the 3 languages)

In the Google developer console, I also set the 3 languages (as per screenshot), but I believe that is only to show the app description in google play in different languages, and this is different to the apk details just commented.

So, As I built my app with Delphi - RAD Studio, I believe I cannot follow the solution for Android Studio, although as per your suggestion for Embarcadero Delphi I've tried to add an xml file using the Deployment manager and load the data from there... although didn't work... :-(

This is what I've done:

1.- Created under a ./RES/ folder 3 folders:

Values/ Values-en/ Valuse-es/

And created the following files under them:

------------

./RES/resconfig.xml

<?xml version="1.0" encoding="utf-8"?>
android {
    defaultConfig {
        resConfigs "en", "fr", "es"
    }
}

------------

Values/strings.xml and Values-en/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
   <string name="app_name">Example</string>
   <string name="info_text">Hello...</string>
</resources>

------------

Values-es/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
   <string name="app_name">Ejemplo</string>
   <string name="info_text">Hola...</string>
</resources>

------------

2.- Project - Deployement (Deployemnt manager) - Added the 4 files

3.- Re-Built the project, but with same result as before... So, looks like these xml resources were not loaded, or what I did didn't have too much sense...

Would you know how to load an xml file in Embacadero - RAD Studio - to get these languages localized in the app?

PS:- I tried anyway to test the DKLang component, but unfortunately I've been unable to load it (Embarcadero misses a .blp file).. Although a commented, my problem is not anymore about using a component to translate and select the language but about getting Google recognizing my 3 languages in the apk.

THANKS!!!!!

1

1 Answers

0
votes

Delphi has a TLang component that can be useful when you have to localize (translate) some strings but it has a few bugs and it doesn't work very well with all components. You can download and install a component DKLang which is better than TLang.

You can do the localization using the components I have mentioned above, you can write your own class, use resourcestrings or external resource files. When I have to localize the app I always use DKLang or (long time ago) a little class that changes at runtime the text of the components. Also:

  1. You can do that in Android Studio and you have to create a folder called values-xx/strings.xml where xx is the locale (it, en, es, us...). In Embarcadero Delphi you could add an xml file using the Deployment manager and load the data from there but it's too complicated. Better if you use DKLang or something else like a custom class.

  2. Windows DLL and drc files are two different things, read here about resource strings in Delphi.


On the Google Developer console side you can see this:

enter image description here

You can add different languages on the page that will be shown on the store but here you cannot change the languages of the app. To localize the app see what I have suggested above.