doceditor: fix localization by Maxim Genetsky:

1. Disable i18n (makes too big .po file), use resource strings instead.
  2. Review and restruct resource strings
  3. Localize most of gui (not everything).
  4. Fix russian translation.
  5. Modify localize.bat/localize.sh to update doceditor PO-files.

git-svn-id: trunk@23843 -
This commit is contained in:
paul 2010-03-05 17:53:24 +00:00
parent 21102ec585
commit d0c907a7fd
9 changed files with 543 additions and 1929 deletions

View File

@ -158,7 +158,7 @@ var
implementation
uses IniFiles, frmSource, lazdeopts;
uses IniFiles, frmSource, lazdeopts, lazdemsg;
{$R *.lfm}
@ -190,38 +190,6 @@ Const
DefaultTargetCPU = '';
DefaultImport = '';
resourcestring
SAddDescriptionFile = 'Select a new description file';
SEditDescriptionFile = 'Change description file';
SSelectOutputFile = 'Select output file name';
SSelectOutputDirectory = 'Select output directory';
SUsingCommand = 'Building docs using command: ';
SErrFPDoc = 'Building failed with exit code %d. Please check log.';
SBuildOK = 'Documentation successfully built.';
sBuildDocumentation = 'Build documentation';
sPackage = '&Package';
sFormat = '&Format';
sOutput = '&Output';
sCreateContentFile = 'Create cont&ent file';
sBuild = '&Build';
sLoad = '&Load';
sSave = '&Save';
sClose = '&Close';
sAdd = '&Add';
sDelete = '&Delete';
sEdit = '&Edit';
sAddAll = 'Add All';
sDescription = 'Description';
sSourcesCapt = 'Sources';
sOtherOptions = 'Other options';
sBuildOutput = 'Build output';
sHideProtectedMethods = '&Hide protected methods';
sImportContentFile = 'Import content file';
sTargetOS = 'Target OS';
sCPU = 'CPU';
sShowPrivateMethods = 'Show p&rivate methods';
sWarnIfNoDocumentationNodeFound = 'Warn if no documentation node found';
{ TBuildForm }

View File

@ -189,6 +189,10 @@ uses
Const
mbYesNo = [mbYes, mbNo];
var
NewNodeNames : Array[TNodeType] of String
= (sNewFile,sNewPackage,sNewModule,sNewElement,sNewTopic);
function MessageDlg(Fmt: string; Args : Array of const; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;
@ -226,6 +230,35 @@ end;
procedure TMainForm.MainFormCreate(Sender: TObject);
begin
MMain.Items[0].Caption:=sMenuFile;
MMain.Items[0].Items[0].Caption:=SMenuFileNew;
MMain.Items[0].Items[1].Caption:=SMenuFileOpen;
MMain.Items[0].Items[2].Caption:=SMenuFileNewFromFile;
MMain.Items[0].Items[3].Caption:=SMenuFileSave;
MMain.Items[0].Items[4].Caption:=SMenuFileSaveAs;
MMain.Items[0].Items[6].Caption:=SMenuFileClose;
MMain.Items[0].Items[7].Caption:=SMenuFileRecent;
MMain.Items[0].Items[9].Caption:=SMenuFileQuit;
//Insert Menu
MMain.Items[1].Caption:=sMenuInsert;
MMain.Items[1].Items[0].Caption:=SMenuInsertPackage;
MMain.Items[1].Items[1].Caption:=SMenuInsertModule;
MMain.Items[1].Items[2].Caption:=SMenuInsertTopic;
MMain.Items[1].Items[3].Caption:=SMenuInsertElement;
MMain.Items[1].Items[4].Caption:=SMenuInsertLink;
MMain.Items[1].Items[5].Caption:=SMenuInsertTable;
MMain.Items[1].Items[6].Caption:=SMenuInsertShortDescLink;
MMain.Items[1].Items[7].Caption:=SMenuInsertQuickLink;
//Extra Menu
MMain.Items[2].Caption:=sMenuExtra;
MMain.Items[2].Items[0].Caption:=sMenuExtraOptions;
MMain.Items[2].Items[1].Caption:=sMenuExtraBuild;
//Help Menu
MMain.Items[3].Caption:=sMenuHelp;
MMain.Items[3].Items[0].Caption:=sMenuHelpAbout;
if Sender=nil then ;
FRecent:=TStringList.Create;
LoadCommandLine;
@ -767,7 +800,7 @@ begin
If (CurrentEditor<>Nil) then
With TNewNodeForm.Create(Self) do
Try
S:=SNew+' '+NodeNames[nt];
S:=NewNodeNames[nt];
Case nt of
ntPackage : S:=S+SForFile+ExtractFileName(CurrentEditor.FileName);
ntModule: If (CurrentEditor.CurrentPackage<>Nil) then

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,6 @@
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N Value="True"/>
<OutDir Value="languages"/>
</i18n>
<VersionInfo>

View File

@ -33,10 +33,10 @@ ResourceString
---------------------------------------------------------------------}
SFileTemplate = 'template.xml';
SFPDE = 'Free Pascal documentation editor';
SName = 'Name';
SOK = ' OK ';
SCancel = ' Cancel ';
//SFPDE = 'Free Pascal documentation editor';
//SName = 'Name';
//SOK = ' OK ';
//SCancel = ' Cancel ';
SNewDocument = 'New document';
SNew = 'New';
SInsertLink = 'Insert link';
@ -46,17 +46,17 @@ ResourceString
SForPackage = ' in package ';
SForModule = ' in module ';
SForTopic = ' in topic';
SLinkTarget = 'Link target';
SLinkText = 'Link text';
STableRows = 'Rows';
STableCols = 'Columns';
STableHeader = 'Use header row';
//SLinkTarget = 'Link target';
//SLinkText = 'Link text';
//STableRows = 'Rows';
//STableCols = 'Columns';
//STableHeader = 'Use header row';
SPackages = 'Packages';
SFileModified = 'Document "%s" was modified, would you like to save it?';
SDeletePackage = 'Are you sure you want to delete package "%s" ?';
SDeleteModule = 'Are you sure you want to delete module "%s" ?';
SDeleteTopic = 'Are you sure you want to delete topic "%s" ?';
SDeleteElement = 'Are you sure you want to delete element "%s" ?';
//SDeleteElement = 'Are you sure you want to delete element "%s" ?';
SRenamePackage = 'Rename package';
SRenameModule = 'Rename module';
SRenameTopic = 'Rename topic';
@ -64,87 +64,129 @@ ResourceString
SNoElement = 'No element selected';
SDataForElement = 'Documentation for element "%s":';
SShortDescription = 'Short';
SDescription = 'Description';
//SDescription = 'Description';
SErrors = 'Errors';
SSeeAlso = 'See Also';
SCodeExample = 'Example code File';
SMakeSkelFromSource = 'Make new document from source file';
SSkelErrorWithFile = 'makeskel reported an error (%d). Try to load produced file anyway ?';
SSkelErrorWithoutFile = 'makeskel reported an error (%d) and produced no file.';
SOptConfirmDelete = 'Confirm node deletion';
SOptCreateBackup = 'Backup existing files';
SOptSkipEmptyNodes = 'Do not create empty nodes';
SOptBackupExtension = 'Backup file extension';
SOptDefaultExtension = 'Default extension for new files';
SOptMaxRecentUsed = 'Items in MRU list';
SAboutText = 'fpdoc editor 1.0'#10'(c) 2002 Michael Van Canneyt'#10+
'See http://www.freepascal.org/';
//SOptConfirmDelete = 'Confirm node deletion';
//SOptCreateBackup = 'Backup existing files';
//SOptSkipEmptyNodes = 'Do not create empty nodes';
//SOptBackupExtension = 'Backup file extension';
//SOptDefaultExtension = 'Default extension for new files';
//SOptMaxRecentUsed = 'Items in MRU list';
//SAboutText = 'fpdoc editor 1.0'#10'(c) 2002 Michael Van Canneyt'#10+
// 'See http://www.freepascal.org/';
SFileStructure = 'Documentation structure';
SModuleElements = 'Elements for selected node';
sNewFile = 'New file';
sNewPackage = 'New package';
sNewModule = 'New module';
sNewElement = 'New element';
sNewTopic = 'New topic';
//Build Form strings
SAddDescriptionFile = 'Select a new description file';
SEditDescriptionFile = 'Change description file';
SSelectOutputFile = 'Select output file name';
SSelectOutputDirectory = 'Select output directory';
SUsingCommand = 'Building docs using command: ';
SErrFPDoc = 'Building failed with exit code %d. Please check log.';
SBuildOK = 'Documentation successfully built.';
sBuildDocumentation = 'Build documentation';
sPackage = '&Package';
sFormat = '&Format';
sOutput = '&Output';
sCreateContentFile = 'Create cont&ent file';
sBuild = '&Build';
sLoad = '&Load';
sSave = '&Save';
sClose = '&Close';
sAdd = '&Add';
sDelete = '&Delete';
sEdit = '&Edit';
sAddAll = 'Add All';
sDescription = 'Description';
sSourcesCapt = 'Sources';
sOtherOptions = 'Other options';
sBuildOutput = 'Build output';
sHideProtectedMethods = '&Hide protected methods';
sImportContentFile = 'Import content file';
sTargetOS = 'Target OS';
sCPU = 'CPU';
sShowPrivateMethods = 'Show p&rivate methods';
sWarnIfNoDocumentationNodeFound = 'Warn if no documentation node found';
{ ---------------------------------------------------------------------
Menu strings
---------------------------------------------------------------------}
SMenuOpen = '_Open';
SMenuNew = '_New';
SMenuNewFromSource = 'New from so_urce';
SMenuSave = '_Save';
SMenuSaveAs = 'Save _as';
SMenuRecent = '_Recent';
SMenuClose = '_Close';
SMenuExit = 'E_xit';
SMenuFile = 'File';
SMenuInsert = 'Insert';
SMenuInsertPackage = '_Package';
SMenuInsertModule = '_Module';
SMenuInsertTopic = 'T_opic';
SMenuInsertElement = '_Element';
SMenuInsertLink = '_Link';
SMenuInsertTable = '_Table';
SMenuFormat = 'Format';
SMenuFormatBold = '_Bold';
SMenuFormatUnderLine = '_Underline';
SMenuFormatItalics = '_Italic';
SMenuformatVariable = '_Variable';
SMenuFormatRemark = '_Remark';
SMenuFormatParaGraph = '_Paragraph';
SMenuFormatCode = '_Code';
SMenuFormatFile = '_File';
SMenuFile = '&File';
SMenuFileNew = '&New';
SMenuFileOpen = '&Open';
SMenuFileNewFromFile = 'New from fi&le';
SMenuFileSave = '&Save';
SMenuFileSaveAs = 'Save &as';
SMenuFileClose = '&Close';
SMenuFileRecent = '&Recent';
SMenuFileQuit = '&Quit';
SMenuInsert = '&Insert';
SMenuInsertPackage = '&Package';
SMenuInsertModule = '&Module';
SMenuInsertTopic = 'T&opic';
SMenuInsertElement = '&Element';
SMenuInsertLink = '&Link';
SMenuInsertTable = '&Table';
SMenuInsertShortDescLink = '&Short description link';
SMenuInsertQuickLink = '&Quick Link';
//SMenuFormat = 'Format';
//SMenuFormatBold = '_Bold';
//SMenuFormatUnderLine = '_Underline';
//SMenuFormatItalics = '_Italic';
//SMenuformatVariable = '_Variable';
//SMenuFormatRemark = '_Remark';
//SMenuFormatParaGraph = '_Paragraph';
//SMenuFormatCode = '_Code';
//SMenuFormatFile = '_File';
SMenuRename = 'Rename';
SMenuDelete = 'Delete';
SMenuExpandAll = 'Expand All';
SMenuCollapseAll = 'Collapse All';
SMenuExtra = 'Extra';
SMenuExtraoptions = 'Options';
SMenuExtra = '&Extra';
SMenuExtraOptions = '&Options';
SMenuExtraBuild = '&Build';
SMenuHelp = 'Help';
SMenuHelpAbout = 'About';
SMenuHelp = '&Help';
SMenuHelpAbout = '&About...';
{ ---------------------------------------------------------------------
Hint strings
---------------------------------------------------------------------}
SHintFileNew = 'New file';
SHintFileOpen = 'Open file';
SHintFileSave = 'Save file';
SHintFileSaveAs = 'Save file as';
SHintInsertPackage = 'New package';
SHintInsertModule = 'New module';
SHintInsertTopic = 'New topic';
SHintInsertElement = 'New element';
SHintInsertLink = 'Insert link';
ShintInsertTable = 'Insert table';
SHintInsertPrintShortLink = 'Insert a short description link';
//SHintFileNew = 'New file';
//SHintFileOpen = 'Open file';
//SHintFileSave = 'Save file';
//SHintFileSaveAs = 'Save file as';
//SHintInsertPackage = 'New package';
//SHintInsertModule = 'New module';
//SHintInsertTopic = 'New topic';
//SHintInsertElement = 'New element';
//SHintInsertLink = 'Insert link';
//ShintInsertTable = 'Insert table';
//SHintInsertPrintShortLink = 'Insert a short description link';
SMarkSelection = 'Mark selection %s';
SHMenuExtraOptions = 'Show options dialog';
SHMenuHelpAbout = 'About this program';
//SHMenuExtraOptions = 'Show options dialog';
//SHMenuHelpAbout = 'About this program';
SHintToolbarAdd = 'Add';
SHintToolbarEdit = 'Edit';
SHintToolbarDelete = 'Delete';
@ -159,12 +201,12 @@ ResourceString
SErrNoNodeForPackage = 'No node found for package "%s"';
SErrNoNodeForModule = 'No node found for module "%s"';
SErrNoModuleForElement = 'No module found to insert element "%s"';
SErrNoNodeForElement = 'No node found for element "%s"';
//SErrNoNodeForElement = 'No node found for element "%s"';
SErrUnknownDomElement = 'Unknwon DOM element as parent for selected element: "%s"';
SSaveFileTitle = 'Enter filename to save to';
SOpenFileTitle = 'Select file to open';
//SSaveFileTitle = 'Enter filename to save to';
//SOpenFileTitle = 'Select file to open';
Function FormatHint(S : String) : String;

View File

@ -146,7 +146,6 @@ var
begin
GetLanguageIDs(Lang,FallbackLang); // in unit gettext
TranslateUnitResourceStrings('LazDEMsg','languages/lazde.%s.po', Lang,FallbackLang);
TranslateUnitResourceStrings('frmBuild','languages/lazde.%s.po', Lang,FallbackLang);
end;
Initialization

View File

@ -113,6 +113,10 @@ tools\updatepofiles %MessageComposer_RST% components\messagecomposer\languages\m
@set LazDataDesktop_RST=tools\lazdatadesktop\lib\%ArchOS%\lazdatadeskstr.rst
tools\updatepofiles %LazDataDesktop_RST% tools\lazdatadesktop\languages\lazdatadesktop.po
@REM LazDoc
@set LazDoc_RST=doceditor\units\%ArchOS%\lazdemsg.rst
tools\updatepofiles %LazDoc_RST% doceditor\languages\lazde.po
@REM LazReport editor sample
@set LREditor_RST=components\lazreport\samples\editor\maincalleditor.rst
if not exist %LREditor_RST% goto SkipLREditor

View File

@ -46,6 +46,7 @@ RSTFILES=(
"components/projecttemplates frmtemplatevariables"
"components/projecttemplates idetemplateproject"
"tools/lazdatadesktop lazdatadeskstr lazdatadesktop"
"doceditor lazdemsg lazde"
"lcl lclstrconsts"
)