1

Even if I have found a lot online I still am not able to find how to really use resourcestrings. I have an iOS only application made with seattle and I have a file called italian.pas which is the following:

unit italian;

interface

resourcestring
 word1 = "parola1";
 test1 = "prova1";

implementation

end.

I don't want to use localization tools. From what I have understood the compiler generates a .drc file containing my resourcestrings. What to do now to localize my iOS app? (or android)


I have created other 2 files like above called french.pas and american.pas. They are the copy of italian.pas but the string values are of course different according with the language. In this answer Allen Bauer said:

This .drc file can then be translated or otherwise processed and then recompiled into a .res file This .res file can then be linked into a special "resource-only" dll with a specific extension other than ".dll" that indicates the language.

First of all consider that I am not a Delphi expert! From what I have understood here the compiler should generate somewhere a drc file from my italian.pas and the drc is going to contain my strings. Now (from the quote above) I should edit the drc adding the localization that I need.

How do I edit the drc file with the localization? Also I guess that the edited drc files containing the localizations must be linked with the executable somehow. Do I really need to create 3 different pas files files or I just need a single drc file and then localize it?

Emma Rossignoli
  • 935
  • 7
  • 25
  • 3
    Did you read Embarcadero's documentation yet? [Internationalization and Localization](http://docwiki.embarcadero.com/RADStudio/en/Internationalization_and_Localization) – Remy Lebeau Oct 10 '17 at 22:06
  • Try Soluling https://www.soluling.com. It has a solution for FireMonkey localization – Jaska Nov 28 '19 at 04:58

1 Answers1

1

At the moment there is no easy way to localize mobile Delphi applications. The reason is that those platforms do not support resource libraries such as resource DLLs in Windows. When compiler compiles code where is a resource string the compiler takes the strings and inserts it a string resource inside the application file. Of course you can modify this after compilation but it is not easy because you also have to calculate all internal references inside the ELF (Android) or Mach (iOS) file.

The only viable solution is not to use resource strings at all but uses some kind of translate function (similar to gettext) and to uses some kind of translations component that stores the translations in some format and the on runtime changes the form strings and provides the right language strings for the translate function. The problem however are the several resourcestring used in RTL and FireMonkey libraries. There is not just any easy way to localize them.

Jaska
  • 1,007
  • 10
  • 9