📄 how_translater_works.txt
字号:
How the multilanguage translator works:
*******************************************************
http://www.softwareschule.ch/download/laz_multilang.zip
----------------------------------------------------------
first you got a rc file produced by Borland Resource Workshop like below
second you translate it to a res-file binary by
-----------------------
D:\Programme\Borland\Delphi7\Bin\brc32.exe -r SecureCenterXPCheckAdminSTR.RC
pause
-----------------------
start it with:
language_resource.BAT
or
in the main form
{$R 'SecureCenterXPCheckAdminSTR.res' 'SecureCenterXPCheckAdminSTR.RC'}
so you don't need the resource batch !!!
registry key is:
HKEY_LOCAL_MACHINE\Software\GST\SecureCenterXP\Language
SSecLangDep_SOFTWAREGSTSecureCenterXP = '\SOFTWARE\GST\SecureCenterXP';
Sequence:
objMultilang:= TMultiLangSC.Create(self);
objMultilang.LanguageOffset:= objMultilang.currentLanguage;
function TMultiLangSC.currentLanguage: integer;
TMultilangSC.SetLanguage(const Value: integer);
procedure TMultilangSC.ChangeLanguage(const languageOffset: integer);
ChangeComponent(GetTopComponent,languageOffset);
else if (theComponent is TCheckBox) then
(theComponent as TCheckBox).Caption:= GetResourceString(theComponent.tag)
Description:
Changes the language of captions of controls on a form to a
particular language. The Tag property of the controls have to
be set to values corresponding with the accoding resource strings.
Leaving a Tag value 0 means that the caption of the according control
isn't changed. Note that languages are distinguished by an offset of a
multiple of 1000. For instance german is 0, English has an offset of 1000,
French has one of 2000 and Italian's offset is 3000. If a Tag is set to the value of a language dependend resource string this multiple of 1000 has
to be omitted. An example:
Excerpt of a resource file:
1, "Dies ist ein Test"
1001, "This is a test"
2001, "C'est une essay" // might be written wrong, sorry for that
3001, "Would be an Italian text if I would have a clue" // I don't speak Italian
In this case to a Tag of a control which should show this text in the propper
language we have to assign the value 1. This can be done with the ObjectInspector.
Currently TSecureLanguageDependend supports the following controls:
TForm,
TLabel,
TCheckBox,
TToolButton,
TButton,
TRadioButton,
TPanel,
TTabSheet,
TMenuItem
This concept can be easily extended to other controls not listed
above.
// on a non visual component:
//ldLanguageDependency := TSecureLanguageDependend.Create(nil);
Text of a component:
frmMain.memInfo.lines.Add(ldSecureLanguageDependend.GetResourceString(5));
frmMain.memInfo.lines.Add('');
frmMain.memInfo.lines.Add(ldSecureLanguageDependend.GetResourceString(6));
Text of a string literal inside a form
dont needed!
resourcestring
SAdmin_StringLiteralFromInside = 'string literal from inside';
Delphi syntax:
procedure Loaded; virtual;
Initializes the component after the form file has been read into memory.
Description
Do not call the protected Loaded method. The streaming system calls this method after it loads the component抯 form from a stream.
When the streaming system loads a form or data module from its form file, it first constructs the form component by calling its constructor, then reads its property values from the form file. After reading all the property values for all the components, the streaming system calls the Loaded methods of each component in the order the components were created. This gives the components a chance to initialize any data that depends on the values of other components or other parts of itself.
Note: All references to sibling components are resolved by the time Loaded is called. Loaded is the first place that sibling pointers can be used after being streamed in.
As implemented in TComponent, Loaded clears the csLoading flag in the ComponentState property, indicating that the component is no longer loading.
Warning: Loaded may be called multiple times on inherited forms. It is called every time a level of inheritance is streamed in. Do not allocate memory in an overridden Loaded method without first checking that the memory has not been allocated in a previous call.
/****************************************************************************
strings.rc
produced by Borland Resource Workshop
*****************************************************************************/
/****************************************************************************
** Deutsch
*****************************************************************************/
STRINGTABLE
{
1, "F黵 die Installation brauchen Sie Admininstratoren-Rechte."
2, "Setup kann nicht gestartet werden!"
3, "&Schliessen"
4, " Installation/Deinstallation"
5, "F黵 die Deinstallation brauchen Sie Admininstratoren-Rechte."
6, "Beenden Sie die Deinstallation falls dies nicht automatisch erfolgt!"
7, " Deinstallation"
8, "Ihre Registry-Einstellungen k鰊nen nicht durchgef黨rt werden!"
9, "Falsches Betriebssystem!"
10, "MAX und armasuisse"
11, "SecureCenterXP kann nicht installiert werden!"
12, "Sie m黶sen zuerst Winsec deinstallieren."
13, "Entschl黶seln Sie vorher wenn n鰐ig Ihre Winsec Chiffrate!"
14, "Sie m黶sen zuerst SecureCenter Version 1 deinstallieren."
15, "Entschl黶seln Sie vorher Ihre Chiffrate, sie werden von der Version 2 nicht mehr unterst黷zt!"
}
/****************************************************************************
** Englisch
*****************************************************************************/
STRINGTABLE
{
1001, "You require administrator rights for the installation."
1002, "Impossible to start setup!"
1003, "&Close"
1004, " Installation/Deinstallation"
1005, "You need administrator rights for the deinstallation."
1006, "Terminate deinstallation if not done automatically!"
1007, " Deinstallation"
1008, "Impossible to set your registry settings correctly!"
1009, "Wrong operating system!"
1010, "MAX and armasuisse E"
1011, "Impossible to install SecureCenterXP!"
1012, "Deinstall Winsec first."
1013, "If necessary decipher your Winsec crypts!"
1014, "Deinstall SecureCenter version 1 first."
1015, "Decipher your crypts, version 2 won't support them!"
}
/****************************************************************************
** Franz鰏isch
*****************************************************************************/
STRINGTABLE
{
2001, "Pour l'installation, vous avez besoin des droits d'administrateur."
2002, "Impossible de lancer le programme d'installation !"
2003, "&Fermer"
2004, " Installation/D閟installation"
2005, "Pour la d閟installation, vous avez besoin des droits d'administrateur."
2006, "Terminez la d閟installation si ceci ne se fait pas automatiquement !"
2007, " D閟installation"
2008, "Impossible de changer vos entr閑s dans la base de registre !"
2009, "Syst鑝e d'exploitation incorrect !"
2010, "MAX et armasuisse"
2011, "Impossible d'installer SecureCenterXP !"
2012, "D閕nstaller d'abord Winsec."
2013, "Si n閏essaire d閏hiffrer au pr閍lable vos donn閑s chiffr閑s avec Winsec !"
2014, "D閕nstaller d'abord SecureCenterXP version 1."
2015, "Dechiffrer au pr閍lable vos donn閑s chiffr閑s, elles ne sont pas support閑s par la version 2 !"
}
/****************************************************************************
** Italienisch
*****************************************************************************/
STRINGTABLE
{
3001, "Per l'installazione sono necessari diritti d'amministratore."
3002, "L'installazione non pu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -