Difference between revisions of "IDE Window: Make ResourceString/de"
(New page: {{IDE Window: Make ResourceString}} This wizard helps to convert a string constant into a resourcestring. Place the cursor on a string constant or select the part of the constant that sh...) |
m |
||
Line 3: | Line 3: | ||
This wizard helps to convert a string constant into a resourcestring. | This wizard helps to convert a string constant into a resourcestring. | ||
− | Place the cursor on a string constant or select the part of the constant that should be converted. | + | Place the cursor on a string constant or select the part of the constant that should be converted. Dann rufen sie Werkzeuge -> Make Resource String auf. |
− | + | Eine Stringkonstante ist zum Beispiel 'Some text'. | |
== Konvertierungseinstellungen == | == Konvertierungseinstellungen == | ||
Line 11: | Line 11: | ||
=== Bezeichner-Präfix === | === Bezeichner-Präfix === | ||
− | + | Sie können einen neuen Bezeichner automatisch erzeugen. The new identifier will start with the prefix, followed by the words of the string constant. If there is already a resourcestring with this value, the old identifier will be suggested. | |
The IDE remembers the prefixes for each unit, so the last used prefix for the current unit is preselected first. | The IDE remembers the prefixes for each unit, so the last used prefix for the current unit is preselected first. | ||
=== Bezeichnerlänge === | === Bezeichnerlänge === | ||
− | + | Dies ist die maximale Länge des automatisch erzeugten Bezeichners. | |
=== Benutzerdefinierter Bezeichner === | === Benutzerdefinierter Bezeichner === | ||
Line 34: | Line 34: | ||
If a new identifier is created, this defines where it will be added in the resourcestring section. | If a new identifier is created, this defines where it will be added in the resourcestring section. | ||
− | * An Ressourcenstring-Abschnitt anhängen - | + | * An Ressourcenstring-Abschnitt anhängen - fügt den neuen Bezeichner am Ende des Abschnitts hinzu. |
− | * Alphabetisch einfügen - | + | * Alphabetisch einfügen - ordnet den Bezeichner alphabetisch ein. |
* Kontextsensitiv einfügen - search the code above and below the current code position and search for resourcestring identifiers. If it finds one, then the new identifier is added there, otherwise it is appended at the end of the section. | * Kontextsensitiv einfügen - search the code above and below the current code position and search for resourcestring identifiers. If it finds one, then the new identifier is added there, otherwise it is appended at the end of the section. | ||
− | == | + | == Quelltext-Vorschau == |
− | + | Dies ist eine Vorschau, wie die Stringkonstante ersetzt wird, gefolgt von einer gestrichelten Linie und dann einer Vorschau, wie der Ressourecestring aussehen wird. | |
− | == Quelltext | + | == Stringkonstanten im Quelltext == |
− | + | Dies zeigt den alten bzw. gegenwärtigen Quelltext. | |
== Beispiele == | == Beispiele == | ||
Line 50: | Line 50: | ||
=== Beispiel 1: Setting the caption of a form === | === Beispiel 1: Setting the caption of a form === | ||
− | If you do not have already a resource | + | If you do not have already a resource string section, start one in the interface part of the unit. For example right above the 'implementation' keyword: |
<pascal> | <pascal> | ||
Line 57: | Line 57: | ||
</pascal> | </pascal> | ||
− | + | Fügen sie im FormCreate Ereignis die folgende Zeile hinzu: | |
<pascal> | <pascal> | ||
Line 68: | Line 68: | ||
Set in the identifier prefix 'rs' without the '. | Set in the identifier prefix 'rs' without the '. | ||
The new automatically suggested identifier will be 'rsAnExampleCaption'. | The new automatically suggested identifier will be 'rsAnExampleCaption'. | ||
− | + | Die Vorschau zeigt | |
Caption:=rsAnExampleCaption; | Caption:=rsAnExampleCaption; | ||
Line 74: | Line 74: | ||
rsAnExampleCaption = 'An example caption' | rsAnExampleCaption = 'An example caption' | ||
− | + | Klicken sie auf OK. | |
=== Beispiel 2 : Complex string constants === | === Beispiel 2 : Complex string constants === | ||
− | When converting a complex string expression with variables and functions, the tool will use the '''Format''' function. | + | When converting a complex string expression with variables and functions, the tool will use the '''Format''' function. Zum Beispiel wird die Anweisung: |
<pascal> | <pascal> | ||
Line 84: | Line 84: | ||
</pascal> | </pascal> | ||
− | + | ersetzt durch | |
<pascal> | <pascal> |
Revision as of 23:04, 28 October 2007
│
Deutsch (de) │
English (en) │
français (fr) │
日本語 (ja) │
This wizard helps to convert a string constant into a resourcestring.
Place the cursor on a string constant or select the part of the constant that should be converted. Dann rufen sie Werkzeuge -> Make Resource String auf.
Eine Stringkonstante ist zum Beispiel 'Some text'.
Konvertierungseinstellungen
Bezeichner-Präfix
Sie können einen neuen Bezeichner automatisch erzeugen. The new identifier will start with the prefix, followed by the words of the string constant. If there is already a resourcestring with this value, the old identifier will be suggested. The IDE remembers the prefixes for each unit, so the last used prefix for the current unit is preselected first.
Bezeichnerlänge
Dies ist die maximale Länge des automatisch erzeugten Bezeichners.
Benutzerdefinierter Bezeichner
Instead of using an automatically created identifier, you can specify the identifier on your own here.
Ressourcestring-Abschnitt
This combobox contains all available resourcestring sections of all units in scope. That means all sections of the current unit plus all sections in the interface parts of all used units.
Strings mit identischen Werten
This combobox contains all resourcestring identifiers with the same value as the new resourcestring. You can choose here, if you want to take one of them.
Where to put the new identifier in the resourcestring section
If a new identifier is created, this defines where it will be added in the resourcestring section.
- An Ressourcenstring-Abschnitt anhängen - fügt den neuen Bezeichner am Ende des Abschnitts hinzu.
- Alphabetisch einfügen - ordnet den Bezeichner alphabetisch ein.
- Kontextsensitiv einfügen - search the code above and below the current code position and search for resourcestring identifiers. If it finds one, then the new identifier is added there, otherwise it is appended at the end of the section.
Quelltext-Vorschau
Dies ist eine Vorschau, wie die Stringkonstante ersetzt wird, gefolgt von einer gestrichelten Linie und dann einer Vorschau, wie der Ressourecestring aussehen wird.
Stringkonstanten im Quelltext
Dies zeigt den alten bzw. gegenwärtigen Quelltext.
Beispiele
If you do not have already a resource string section, start one in the interface part of the unit. For example right above the 'implementation' keyword:
<pascal>
resourcestring rsSomeText = 'Some text';
</pascal>
Fügen sie im FormCreate Ereignis die folgende Zeile hinzu:
<pascal>
Caption:='An example caption';
</pascal>
Place the cursor on the string constant, i.e. somewhere between the two '. Then do Tools -> Make Resource String
Set in the identifier prefix 'rs' without the '. The new automatically suggested identifier will be 'rsAnExampleCaption'. Die Vorschau zeigt
Caption:=rsAnExampleCaption; -------------------------------------------------------------------------------- rsAnExampleCaption = 'An example caption'
Klicken sie auf OK.
Beispiel 2 : Complex string constants
When converting a complex string expression with variables and functions, the tool will use the Format function. Zum Beispiel wird die Anweisung:
<pascal>
Caption:='Left='+IntToStr(Left)+' Top='+IntToStr(Top);
</pascal>
ersetzt durch
<pascal>
Caption:=Format(rsLeftTop, [IntToStr(Left), IntToStr(Top)]);
</pascal>
and the new resourcestring will be
<pascal>
rsLeftTop = 'Left=%s Top=%s'
</pascal>
The Format function is defined in the SysUtils unit. If your unit uses section does not already contain it, you must add it yourself.