Die geänderten Texte dürfen nicht länger sein, als die alten und wenn sie kürzer sind musst du sie auffüllen bis zur ursprünglichen Länge.
Aus diesem Grund benutze ich keine hardgecodeten Strings, sondern nur
Resourcenstrings (resourcestring). Die werden in einem Stringtable in die Ressource kompiliert und können mit einem Ressourcen-Editor leicht geändert werden. So habe ich es auch mit meinen
XP Usermanager gemacht. So war es mir sehr leicht möglich eine englische Version des Programmes zu erstellen. Öffne einfach mal beide Exedateien mit einem Ressourcen-Editor und vergleiche sie.
| Zitat: |
Resource strings are stored as resources and linked into the executable or library so that they can be modified without recompiling the program. For more information, see Internationalization and localization and the topics that follow it.
Resource strings are declared like other true constants, except that the word const is replaced by resourcestring. The expression to the right of the = symbol must be a constant expression and must return a string value. For example,
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7:
| resourcestring
CreateError = 'Cannot create file %s'; OpenError = 'Cannot open file %s'; LineTooLong = 'Line too long'; ProductName = 'Borland Rocks\000\000'; SomeResourceString = SomeTrueConstant; |
The compiler automatically resolves naming conflicts among resource strings in different libraries.
|