[Initranslator-svncheckins] SF.net SVN: initranslator: [98] translator/trunk
Brought to you by:
peter3
|
From: <pe...@us...> - 2006-09-23 15:39:31
|
Revision: 98
http://svn.sourceforge.net/initranslator/?rev=98&view=rev
Author: peter3
Date: 2006-09-23 08:37:41 -0700 (Sat, 23 Sep 2006)
Log Message:
-----------
- Added new MsTermBuild project to convert MS Terminology Translations to IniTranslator dictionaries
- Dictionary class now removes empty translations automatically when loading and merging etc
- Changed the way fonts are specified so we can use the MS Shell Dlg substituions
- DictEditFrm: Fixed error where the TTranslations = 1 returned all items with < 2 translations
Modified Paths:
--------------
translator/trunk/Changelog.txt
translator/trunk/help/Dictionaries.html
translator/trunk/help/Index.html
translator/trunk/src/AppConsts.pas
translator/trunk/src/AppOptions.pas
translator/trunk/src/AppUtils.pas
translator/trunk/src/DictEditFrm.dfm
translator/trunk/src/DictEditFrm.pas
translator/trunk/src/Dictionary.pas
translator/trunk/src/MainFrm.dfm
translator/trunk/src/MainFrm.pas
translator/trunk/src/MsDictBuild/MSDictBuild.dpr
translator/trunk/src/MsDictBuild/MSDictBuild.res
translator/trunk/src/MsDictBuild/MainFrm.dfm
translator/trunk/src/OptionsFrm.dfm
translator/trunk/src/OptionsFrm.pas
translator/trunk/src/TRANSLATOR.INC
translator/trunk/src/ToolListEdit/ToolListEditFrm.dfm
translator/trunk/src/ToolListEdit/ToolListEditFrm.pas
translator/trunk/src/ToolTreeView/ToolTreeViewFrm.dfm
translator/trunk/src/ToolTreeView/ToolTreeViewFrm.pas
translator/trunk/src/WideIniFiles.pas
translator/trunk/src/translator.dpr
translator/trunk/src/translator.res
translator/trunk/translator.bpg
Added Paths:
-----------
translator/trunk/help/MSDictBuild.html
translator/trunk/help/MSTermBuild.html
translator/trunk/help/images/MSTermBuild.jpg
translator/trunk/help/images/MsDictBuild.jpg
translator/trunk/src/MsTermBuild/
translator/trunk/src/MsTermBuild/MSTermBuild.exe.manifest
translator/trunk/src/MsTermBuild/MainFrm.dfm
translator/trunk/src/MsTermBuild/MainFrm.pas
translator/trunk/src/MsTermBuild/MsTermBuild.dof
translator/trunk/src/MsTermBuild/MsTermBuild.dpr
translator/trunk/src/MsTermBuild/manifest.rc
Modified: translator/trunk/Changelog.txt
===================================================================
--- translator/trunk/Changelog.txt 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/Changelog.txt 2006-09-23 15:37:41 UTC (rev 98)
@@ -1,5 +1,14 @@
Ini Translator Changelog
========================
+2006-09-23:
+- Added new MsTermBuild project to convert MS Terminology Translations to IniTranslator dictionaries
+- Dictionary class now removes empty translations automatically when loading and merging etc
+- Changed the way fonts are specified so we can use the MS Shell Dlg substituions
+- DictEditFrm: Fixed error where the TTranslations = 1 returned all items with < 2 translations
+
+
+
+
2006-08-17:
- Added support for Headers and Footers
- UI for setting default encoding for new files (OptionsFrm)
Modified: translator/trunk/help/Dictionaries.html
===================================================================
--- translator/trunk/help/Dictionaries.html 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/help/Dictionaries.html 2006-09-23 15:37:41 UTC (rev 98)
@@ -11,9 +11,9 @@
in software are identical (labels like OK, Cancel, Apply, File, Edit etc are
used in just about every program in the world). To avoid having to translate
these items manually time after time, the program has support for dictionaries.
- A dictionary is simply a file containing pairs of text strings for a specific
- language combination. For example, one file might contain english and polish string
- pairs, another file might contain german and french string pairs etc.</p>
+ A dictionary is simply a file containing a list of original strings and
+ one or more translations for each original string for a specific
+ language combination. For example, one file might contain english and polish, another file might contain german and french etc.</p>
<p> </p>
<p>The following functionality is available for dictionaries:</p>
<p> </p>
Modified: translator/trunk/help/Index.html
===================================================================
--- translator/trunk/help/Index.html 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/help/Index.html 2006-09-23 15:37:41 UTC (rev 98)
@@ -30,11 +30,19 @@
<img border="0" src="images/HelpItem.jpg" width="16" height="16"><a href="Known%20issues.html">Known Issues</a>
</dl>
- <p>
- <img border="0" src="images/HelpBookClosed.jpg" width="16" height="16">Appendix A</p>
+ <p><img border="0" src="images/HelpBookClosed.jpg" width="16" height="16">Tools</p>
<dl>
<dd>
+ <img border="0" src="images/HelpItem.jpg" width="16" height="16"><a href="MSTermBuild.html">MS Terminology Translations Builder</a>
<br />
+
+ <img border="0" src="images/HelpItem.jpg" width="16" height="16"><a href="MSDictBuild.html">MS Dictionary Builder</a>
+ </dd>
+ </dl>
+ <p><img border="0" src="images/HelpBookClosed.jpg" width="16" height="16">Appendix A</p>
+
+ <dl>
+ <dd>
<img border="0" src="images/HelpItem.jpg" width="16" height="16"><a href="Appendix%20A.html">The ini file format</a>
</dd>
</dl>
Added: translator/trunk/help/MSDictBuild.html
===================================================================
--- translator/trunk/help/MSDictBuild.html (rev 0)
+++ translator/trunk/help/MSDictBuild.html 2006-09-23 15:37:41 UTC (rev 98)
@@ -0,0 +1,54 @@
+<html>
+
+ <head>
+ <title>MS Dictionary Builder</title>
+ <link href="styles/default.css" type="text/css" rel="stylesheet" />
+ </head>
+
+<body>
+<h1>MS Dictionary Builder</h1>
+<hr/>
+The MS Dictionary Builder application is a utility program to convert Microsoft's Glossary CSV files to IniTranslator dictionaries.
+You can download the csv files you are interested in from Microsofts FTP site at
+this adress: <a href="ftp://ftp.microsoft.com/developr/msdn/newup/Glossary">
+ftp://ftp.microsoft.com/developr/msdn/newup/Glossary</a>.<p> </p>
+<p>The application looks like this:</p>
+<p> </p>
+<p><img border="0" src="images/MsDictBuild.jpg"></p>
+<p> </p>
+<dl>
+ <dt>Input Files</dt>
+ <dd>The files you want to convert to dct format. Add one file specification
+ per row. Click the Select button to browse for files using the standard open
+ dialog. Note that wildcards are <b>not</b> supported.</dd>
+ <dt>Save converted items to</dt>
+ <dd>Specify the name of the dictionary file you want to create or append to.
+ Select <b>Append</b> to add the new items to an existing file or <b>
+ Overwrite</b> to replace an existing file. If the file does not exist, it
+ doesn't matter which option you select.</dd>
+</dl>
+<p>Click on the <b>Convert</b> button to extract the strings fro m the CSV file
+and put them into the dictionary file.</p>
+<p> </p>
+<div class="InfoField"><b>Note</b>
+<p>As of 2006, Microsoft no longer provide the glossary CSV for free download.
+Instead, they now have a single consolidated csv file known as the MS
+Terminology Translations CSV. If you still want the old glossary file, you can
+request them from Microsoft. More information about how to obtain the old CSV
+files and how to get the new CSV file, go to
+<a href="http://www.microsoft.com/globaldev/tools/MILSGlossary.mspx">
+http://www.microsoft.com/globaldev/tools/MILSGlossary.mspx</a>.</p>
+</div>
+<p> </p>
+<div class="InfoField"><b>Note</b>
+<p>
+Some of the CSV files are not correctly formatted. Specifically, they may contain additional linebreaks that the application cannot
+handle and the end result is an incorrect dictionary file. To fix this, open the CSV in Notepad or WordPad and remove the line breaks and save as text.
+You should now be able to create a valid dictionary with this application.
+</p>
+</div>
+
+
+</body>
+
+</html>
\ No newline at end of file
Added: translator/trunk/help/MSTermBuild.html
===================================================================
--- translator/trunk/help/MSTermBuild.html (rev 0)
+++ translator/trunk/help/MSTermBuild.html 2006-09-23 15:37:41 UTC (rev 98)
@@ -0,0 +1,42 @@
+<html>
+
+ <head>
+ <title>MS Terminology Translations Builder</title>
+ <link href="styles/default.css" type="text/css" rel="stylesheet" />
+ </head>
+
+<body>
+<h1>MS Terminology Translations Builder</h1>
+<hr />
+The MS Terminology Translations Builder application is a utility program to convert the
+Microsoft's Terminology Translations CSV file to IniTranslator dictionaries.
+You can get more information and download the csv file from
+<a href="http://www.microsoft.com/globaldev/tools/MILSGlossary.mspx">http://www.microsoft.com/globaldev/tools/MILSGlossary.mspx</a>.<p>The application looks like this:</p>
+<p> </p>
+<p><img border="0" src="images/MSTermBuild.jpg"></p>
+
+<p> </p>
+<dl>
+ <dt>Input filename</dt>
+ <dd>The CSV file to read from. Type in a path and filename or click the <b>
+ Browse</b> button to select a file.</dd>
+ <dt>Original</dt>
+ <dd>If you selected a valid input file, this list is filled with all
+ available languages in the file. Select the language to use as the original
+ string in the dictionary.</dd>
+ <dt>Translation</dt>
+ <dd>If you selected a valid input file, this list is filled with all
+ available languages in the file. Select the language to use as the
+ translation string in the dictionary.</dd>
+ <dt>Output filename</dt>
+ <dd>Type in the path and filename of the dictionary file you want to save or
+ click the <b>Browse</b> button to select a file.</dd>
+ <dt>Overwrite output file</dt>
+ <dd>If the output file already exists, use this option to either append to
+ or overwrite the file.</dd>
+</dl>
+<p>Click the <b>Create dictionary</b> button to create the dictionary.</p>
+
+</body>
+
+</html>
Added: translator/trunk/help/images/MSTermBuild.jpg
===================================================================
(Binary files differ)
Property changes on: translator/trunk/help/images/MSTermBuild.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: translator/trunk/help/images/MsDictBuild.jpg
===================================================================
(Binary files differ)
Property changes on: translator/trunk/help/images/MsDictBuild.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: translator/trunk/src/AppConsts.pas
===================================================================
--- translator/trunk/src/AppConsts.pas 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/AppConsts.pas 2006-09-23 15:37:41 UTC (rev 98)
@@ -90,7 +90,7 @@
SArgumentsPrompt = 'Arguments:';
SErrToolExecFmt = 'Failed to execute "%s %s": %s';
SNewToolNameFmt = '(New Tool %d)';
- SErrCreateFileFmt = 'Could not create file "%s".'#13#10'Please check that you have sufficient permissions to create and modify files in the affected folder.';
+ SErrCreateFileFmt = 'Could not create file "%s".'#13#10'Please check that the file is writable and that you have sufficient permissions to create and modify files in the affected folder.';
SPromptDeleteItem = 'Delete selected item?';
SConfirmDelete = 'Confirm Delete';
Modified: translator/trunk/src/AppOptions.pas
===================================================================
--- translator/trunk/src/AppOptions.pas 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/AppOptions.pas 2006-09-23 15:37:41 UTC (rev 98)
@@ -94,7 +94,6 @@
FHelpFile: WideString;
FDictionaryFile: WideString;
FFilename: WideString;
- FAppFont: TFont;
FFilterIndex: integer;
FGlobalPath: boolean;
FPinCommentWindow: boolean;
@@ -138,6 +137,8 @@
FDefaultTransEncoding: integer;
FFooter: TTntStrings;
FHeader: TTntStrings;
+ FFontSize: integer;
+ FFontName: WideString;
procedure ReadWindowInfos(ini: TWideCustomIniFile);
procedure WriteWindowInfos(ini: TWideCustomIniFile);
function GetWindowInfo(AForm: TForm): TAppWindowInfo;
@@ -183,7 +184,8 @@
property SplitterPosition: integer read FSplitterPosition write FSplitterPosition default 160;
property FilterIndex: integer read FFilterIndex write FFilterIndex default 1;
property AppTitle: WideString read FAppTitle write FAppTitle;
- property AppFont: TFont read FAppFont;
+ property FontName: WideString read FFontName write FFontName;
+ property FontSize:integer read FFontSize write FFontSize;
property MonitorFiles: boolean read FMonitorFiles write FMonitorFiles default true;
property Theme: WideString read FTheme write FTheme;
property Header:TTntStrings read FHeader write SetHeader;
@@ -411,8 +413,6 @@
inherited Create;
FTools := TToolItems.Create;
// set defaults
- FAppFont := TFont.Create;
- FAppFont.Name := 'MS Shell Dlg 2';
FWindowInfos := TTntStringlist.Create;
TTntStringlist(FWindowInfos).Sorted := true;
FHeader := TTntStringlist.Create;
@@ -427,13 +427,14 @@
PinCommentWindow := true;
MonitorFiles := true;
Theme := sDefault;
+ FontName := 'MS Shell Dlg 2';
+ FontSize := 9;
LoadFromFile(AFilename);
end;
destructor TAppOptions.Destroy;
begin
ClearWindowInfos;
- FAppFont.Free;
FWindowInfos.Free;
FTools.Free;
FHeader.Free;
@@ -486,10 +487,8 @@
ini := TWideMemIniFile.Create(AFilename);
try
FFilename := AFilename;
- FAppFont.Name := ini.ReadString('Font', 'Font.Name', FAppFont.Name);
- FAppFont.Height := ini.ReadInteger('Font', 'Font.Height', FAppFont.Height);
- FAppFont.Style := StrToFontStyles(ini.ReadString('Font', 'Font.Style', FontStylesToStr(FAppFont.Style)));
- FAppFont.Color := ini.ReadInteger('Font', 'Font.Color', FAppFont.Color);
+ FontName := ini.ReadString('Font', 'FontName', FontName);
+ FontSize := ini.ReadInteger('Font', 'FontSize', FontSize);
ShowQuotes := ini.ReadBool('General', 'ShowQuotes', ShowQuotes);
InvertDictionary := ini.ReadBool('General', 'InvertDictionary', InvertDictionary);
@@ -594,10 +593,8 @@
ini := TWideMemIniFile.Create(AFilename);
try
FFilename := AFilename;
- ini.WriteString('Font', 'Font.Name', FAppFont.Name);
- ini.WriteInteger('Font', 'Font.Height', FAppFont.Height);
- ini.WriteString('Font', 'Font.Style', FontStylesToStr(FAppFont.Style));
- ini.WriteInteger('Font', 'Font.Color', FAppFont.Color);
+ ini.WriteString('Font', 'FontName', FontName);
+ ini.WriteInteger('Font', 'FontSize', FontSize);
ini.WriteBool('General', 'ShowQuotes', ShowQuotes);
ini.WriteBool('General', 'InvertDictionary', InvertDictionary);
Modified: translator/trunk/src/AppUtils.pas
===================================================================
--- translator/trunk/src/AppUtils.pas 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/AppUtils.pas 2006-09-23 15:37:41 UTC (rev 98)
@@ -134,7 +134,8 @@
SetLength(AnsiBuff, MAX_PATH * 2);
Result := SHGetFolderPathA(hwnd, csidl, hToken, dwFlags, PAnsiChar(AnsiBuff));
AnsiBuff := AnsiString(PAnsiChar(AnsiBuff));
- pszPath := WStrPLCopy(pszPath, AnsiBuff, Length(AnsiBuff));
+ // pszPath :=
+ WStrPLCopy(pszPath, AnsiBuff, Length(AnsiBuff));
end;
end;
Modified: translator/trunk/src/DictEditFrm.dfm
===================================================================
--- translator/trunk/src/DictEditFrm.dfm 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/DictEditFrm.dfm 2006-09-23 15:37:41 UTC (rev 98)
@@ -151,7 +151,7 @@
Top = 316
Width = 184
Height = 21
- Hint = 'CHange the selection to see different subsets of the dictionary'
+ Hint = 'Change the selection to see different subsets of the dictionary'
Style = csDropDownList
Anchors = [akLeft, akRight, akBottom]
ItemHeight = 13
Modified: translator/trunk/src/DictEditFrm.pas
===================================================================
--- translator/trunk/src/DictEditFrm.pas 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/DictEditFrm.pas 2006-09-23 15:37:41 UTC (rev 98)
@@ -270,7 +270,7 @@
if FItems[i].Translations.Count > 1 then
cbOriginal.Items.Add(FItems[i].Original);
4:
- if FItems[i].Translations.Count < 2 then
+ if FItems[i].Translations.Count = 1 then
cbOriginal.Items.Add(FItems[i].Original);
end;
if cbOriginal.Items.Count > 0 then
Modified: translator/trunk/src/Dictionary.pas
===================================================================
--- translator/trunk/src/Dictionary.pas 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/Dictionary.pas 2006-09-23 15:37:41 UTC (rev 98)
@@ -79,6 +79,7 @@
function Find(const S: WideString; var Index: integer): boolean;
procedure Clear;
procedure Sort;
+ procedure TrimTranslations; // removes empty translations
constructor Create;
destructor Destroy; override;
property Items[Index: integer]: TDictionaryItem read GetItems; default;
@@ -244,6 +245,7 @@
Clear;
for i := 0 to TDictionaryItems(Source).Count - 1 do
Add(TDictionaryItems(Source).Items[i].Original).Translations.Assign(TDictionaryItems(Source).Items[i].Translations);
+ TrimTranslations;
end
else
begin
@@ -422,6 +424,7 @@
// TODO: merge duplicate items
Inc(i);
end;
+ TrimTranslations;
end;
procedure TDictionaryItems.SaveToFile(const Filename: WideString);
@@ -429,6 +432,7 @@
AFile: TTntStringlist;
i: integer;
begin
+ TrimTranslations;
AFile := TTNtStringlist.Create;
try
for i := 0 to Count - 1 do
@@ -455,4 +459,16 @@
FItems.Sort(OriginalCompare);
end;
+procedure TDictionaryItems.TrimTranslations;
+var i, j:integer;
+begin
+ for i := 0 to Count - 1 do
+ for j := Items[i].Translations.Count - 1 downto 0 do
+ if Items[i].Translations[j] = '' then
+ begin
+ Items[i].Translations.Delete(j);
+ Modified := true;
+ end;
+end;
+
end.
Modified: translator/trunk/src/MainFrm.dfm
===================================================================
--- translator/trunk/src/MainFrm.dfm 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/MainFrm.dfm 2006-09-23 15:37:41 UTC (rev 98)
@@ -273,13 +273,6 @@
CaptionW = 'Next untranslated'
HintW = 'Go to next untranslated item'
end
- object N2: TSpTBXSeparatorItem
- end
- object Font1: TSpTBXItem
- Action = acFont
- CaptionW = 'Font...'
- HintW = 'Change application font'
- end
object N4: TSpTBXSeparatorItem
end
object Unsort1: TSpTBXItem
@@ -844,6 +837,7 @@
Align = alTop
BevelOuter = bvNone
BorderWidth = 2
+ ParentBackground = False
TabOrder = 2
object pnlKeyDetails: TTntPanel
Left = 2
@@ -860,6 +854,7 @@
Font.Height = -19
Font.Name = 'MS Shell Dlg 2'
Font.Style = []
+ ParentBackground = False
ParentFont = False
TabOrder = 0
object lblViewDetails: TLabel
@@ -1057,13 +1052,6 @@
ShortCut = 16465
OnExecute = acShowQuotesExecute
end
- object acFont: TTntAction
- Category = 'Edit'
- Caption = 'Font...'
- Hint = 'Change application font'
- ShortCut = 24646
- OnExecute = acFontExecute
- end
object acRestoreSort: TTntAction
Category = 'Actions'
Caption = 'Restore original sort'
@@ -1427,7 +1415,7 @@
Top = 192
Bitmap = {
494C010146004A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
- 0000000000003600000028000000400000003001000001002000000000000030
+ 0000000000003600000028000000400000002001000001002000000000000020
0100000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@@ -1436,134 +1424,6 @@
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000063630000636300009CCE00009C
CE0000848400009CCE0000848400009CCE0000848400009CCE00008484000000
0000000000000000000000000000000000000000000000000000000000000000
@@ -3861,12 +3721,8 @@
000000000000000000000000000000000000000000000000000000000000009C
9C00009C9C00009C9C00009C9C00009C9C000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
- 2800000040000000300100000100010000000000800900000000000000000000
- 000000000000000000000000FFFFFF0000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 00000000000000000000000000000000001FFFFF00000000000FF9FF00000000
+ 2800000040000000200100000100010000000000000900000000000000000000
+ 000000000000000000000000FFFFFF00001FFFFF00000000000FF9FF00000000
0007F6CF000000000003F6B7000000000001F6B7000000000000F8B700000000
001FFE8F000000000018FE3F00000000001CFF7F00000000003AFE3F00000000
0007FEBF00000000001FFC9F0000000003F8FDDF0000000003FCFDDF00000000
@@ -4077,7 +3933,7 @@
Top = 192
Bitmap = {
494C01010B000E0004000C000F00FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
- 0000000000003600000028000000300000003C0000000100200000000000002D
+ 0000000000003600000028000000300000002D0000000100200000000000C021
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@@ -4090,96 +3946,6 @@
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000C6C6C600848400000084
0000848400000084000084840000008400008484000000000000000000000000
000000000000C6C6C60084840000008400008484000000840000848400000084
@@ -4439,24 +4205,20 @@
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
- 28000000300000003C0000000100010000000000E00100000000000000000000
- 000000000000000000000000FFFFFF0000000000000000000000000000000000
+ 28000000300000002D0000000100010000000000680100000000000000000000
+ 000000000000000000000000FFFFFF00FFFFFFFFF0000000003003FFF0000000
+ 001001FFF0000000000000F0F0000000000000E030000000000000C030000000
+ 0000008010000000000000801000000000000080100000000000008010000000
+ 0000008030000000000000C070000000000000E0F0000000800800FFF0000000
+ C01C01FFF0000000FFFFFFFFFFFF000000300300300300000010010010010000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000FFFFFFFFF0000000003003FFF0000000001001FFF0000000
- 000000F0F0000000000000E030000000000000C0300000000000008010000000
- 0000008010000000000000801000000000000080100000000000008030000000
- 000000C070000000000000E0F0000000800800FFF0000000C01C01FFF0000000
+ 000000000000000000000000000000008008008008000000C01C01C01C010000
FFFFFFFFFFFF0000003003003003000000100100100100000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
- 00000000000000008008008008000000C01C01C01C010000FFFFFFFFFFFF0000
- 0030030030030000001001001001000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 8008008008000000C01C01C01C01000000000000000000000000000000000000
- 000000000000}
+ 00000000000000008008008008000000C01C01C01C0100000000000000000000
+ 0000000000000000000000000000}
end
object alBookmarks: TTntActionList
Images = ilBookmarks
@@ -4647,15 +4409,4 @@
Left = 78
Top = 122
end
- object MainFontDlg: TFontDialog
- Font.Charset = DEFAULT_CHARSET
- Font.Color = clWindowText
- Font.Height = -11
- Font.Name = 'MS Shell Dlg 2'
- Font.Style = []
- Options = [fdAnsiOnly, fdNoSimulations, fdNoVectorFonts]
- OnApply = MainFontDlgApply
- Left = 38
- Top = 122
- end
end
Modified: translator/trunk/src/MainFrm.pas
===================================================================
--- translator/trunk/src/MainFrm.pas 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/MainFrm.pas 2006-09-23 15:37:41 UTC (rev 98)
@@ -87,7 +87,6 @@
acFocusListView: TTntAction;
acFocusOriginal: TTntAction;
acShowQuotes: TTntAction;
- acFont: TTntAction;
acRestoreSort: TTntAction;
acDictSave: TTntAction;
acDictLoad: TTntAction;
@@ -133,8 +132,6 @@
About2: TSpTBXSeparatorItem;
Previousuntranslated1: TSpTBXItem;
Nextuntranslated1: TSpTBXItem;
- N2: TSpTBXSeparatorItem;
- Font1: TSpTBXItem;
N4: TSpTBXSeparatorItem;
ShowQuotes1: TSpTBXItem;
Unsort1: TSpTBXItem;
@@ -284,7 +281,6 @@
TBXItem2: TSpTBXItem;
TBXSeparatorItem3: TSpTBXSeparatorItem;
TBXVisibilityToggleItem1: TSpTBXItem;
- MainFontDlg: TFontDialog;
acImport: TTntAction;
acExport: TTntAction;
TBXSeparatorItem4: TSpTBXSeparatorItem;
@@ -371,8 +367,6 @@
procedure acFocusOriginalExecute(Sender: TObject);
procedure acShowQuotesExecute(Sender: TObject);
procedure alMainUpdate(Action: TBasicAction; var Handled: boolean);
- procedure acFontExecute(Sender: TObject);
- procedure MainFontDlgApply(Sender: TObject; Wnd: HWND);
procedure lvTranslateStringsColumnClick(Sender: TObject;
Column: TListColumn);
procedure acRestoreSortExecute(Sender: TObject);
@@ -659,14 +653,16 @@
UpdateColumn(0, GlobalAppOptions.OriginalFile);
UpdateColumn(1, GlobalAppOptions.TranslationFile);
- lvTranslateStrings.Font := GlobalAppOptions.AppFont;
- reOriginal.Font := GlobalAppOptions.AppFont;
+ lvTranslateStrings.Font.Name := GlobalAppOptions.FontName;
+ lvTranslateStrings.Font.Size := GlobalAppOptions.FontSize;
+
+ reOriginal.Font := lvTranslateStrings.Font;
reOriginal.Color := GlobalAppOptions.ColorUntranslated;
reOriginal.DefAttributes.Assign(reOriginal.Font);
reOriginal.DefAttributes.Color := GlobalAppOptions.ColorFontUntranslated;
m := reTranslation.Modified;
try
- reTranslation.Font := GlobalAppOptions.AppFont;
+ reTranslation.Font := lvTranslateStrings.Font;
reTranslation.DefAttributes.Assign(reTranslation.Font);
finally
reTranslation.Modified := m;
@@ -715,7 +711,9 @@
GlobalAppOptions.ShowDetails := acViewDetails.Checked;
GlobalAppOptions.ShowToolTips := Application.ShowHint;
// GlobalAppOptions.ShowToolTipShortCuts := Application.HintShortCuts;
- GlobalAppOptions.AppFont.Assign(reOriginal.Font);
+ GlobalAppOptions.FontName := reOriginal.Font.Name;
+ GlobalAppOptions.FontSize := reOriginal.Font.Size;
+
if (frmComments <> nil) then
GlobalAppOptions.PinCommentWindow := frmComments.Pinned;
// find / replace dialog
@@ -2125,29 +2123,6 @@
// Handled := true;
end;
-procedure TfrmMain.acFontExecute(Sender: TObject);
-begin
- MainFontDlg.Font := GlobalAppOptions.AppFont;
- if MainFontDlg.Execute then
- MainFontDlgApply(Sender, MainFontDlg.Handle);
-end;
-
-procedure TfrmMain.MainFontDlgApply(Sender: TObject; Wnd: HWND);
-var
- tmp: boolean;
-begin
- tmp := reTranslation.Modified;
- try
- GlobalAppOptions.AppFont.Assign(MainFontDlg.Font);
- Font.CharSet := DEFAULT_CHARSET;
- lvTranslateStrings.Font := GlobalAppOptions.AppFont;
- reOriginal.Font := GlobalAppOptions.AppFont;
- reTranslation.Font := GlobalAppOptions.AppFont;
- finally
- reTranslation.Modified := tmp;
- end;
-end;
-
procedure TfrmMain.lvTranslateStringsColumnClick(Sender: TObject;
Column: TListColumn);
begin
Modified: translator/trunk/src/MsDictBuild/MSDictBuild.dpr
===================================================================
--- translator/trunk/src/MsDictBuild/MSDictBuild.dpr 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/MsDictBuild/MSDictBuild.dpr 2006-09-23 15:37:41 UTC (rev 98)
@@ -10,6 +10,7 @@
begin
Application.Initialize;
+ Application.Title := 'MS Dictionary Builder';
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.
Modified: translator/trunk/src/MsDictBuild/MSDictBuild.res
===================================================================
(Binary files differ)
Modified: translator/trunk/src/MsDictBuild/MainFrm.dfm
===================================================================
--- translator/trunk/src/MsDictBuild/MainFrm.dfm 2006-09-13 19:11:10 UTC (rev 97)
+++ translator/trunk/src/MsDictBuild/MainFrm.dfm 2006-09-23 15:37:41 UTC (rev 98)
@@ -1,9 +1,9 @@
object frmMain: TfrmMain
Left = 282
Top = 167
- Width = 532
- Height = 417
Caption = 'MS Dictionary Builder'
+ ClientHeight = 383
+ ClientWidth = 524
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Added: translator/trunk/src/MsTermBuild/MSTermBuild.exe.manifest
===================================================================
--- translator/trunk/src/MsTermBuild/MSTermBuild.exe.manifest (rev 0)
+++ translator/trunk/src/MsTermBuild/MSTermBuild.exe.manifest 2006-09-23 15:37:41 UTC (rev 98)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="MsTermBuild.initranslator.sourceforge.net" type="win32"/>
+ <description>MsDictBuild</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/>
+ </dependentAssembly>
+ </dependency>
+</assembly>
Added: translator/trunk/src/MsTermBuild/MainFrm.dfm
===================================================================
--- translator/trunk/src/MsTermBuild/MainFrm.dfm (rev 0)
+++ translator/trunk/src/MsTermBuild/MainFrm.dfm 2006-09-23 15:37:41 UTC (rev 98)
@@ -0,0 +1,165 @@
+object frmMain: TfrmMain
+ Left = 218
+ Top = 250
+ BorderStyle = bsDialog
+ Caption = 'MS Terminology Translations Builder'
+ ClientHeight = 258
+ ClientWidth = 577
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Shell Dlg 2'
+ Font.Style = []
+ OldCreateOrder = False
+ ShowHint = True
+ OnCloseQuery = FormCloseQuery
+ OnShow = FormShow
+ DesignSize = (
+ 577
+ 258)
+ PixelsPerInch = 96
+ TextHeight = 13
+ object TntLabel1: TTntLabel
+ Left = 22
+ Top = 26
+ Width = 73
+ Height = 13
+ Caption = '&Input filename:'
+ FocusControl = edInput
+ end
+ object TntLabel2: TTntLabel
+ Left = 22
+ Top = 135
+ Width = 81
+ Height = 13
+ Caption = '&Output filename:'
+ FocusControl = edOutput
+ end
+ object TntLabel3: TTntLabel
+ Left = 21
+ Top = 78
+ Width = 40
+ Height = 13
+ Caption = 'O&riginal:'
+ FocusControl = cbOriginal
+ end
+ object TntLabel4: TTntLabel
+ Left = 287
+ Top = 78
+ Width = 57
+ Height = 13
+ Caption = '&Translation:'
+ FocusControl = cbTranslation
+ end
+ object TntLabel5: TTntLabel
+ Left = 21
+ Top = 227
+ Width = 538
+ Height = 13
+ Cursor = crHandPoint
+ Caption =
+ 'Get Microsoft Terminology Translations.csv from http://www.micro' +
+ 'soft.com/globaldev/tools/MILSGlossary.mspx '
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -11
+ Font.Name = 'MS Shell Dlg 2'
+ Font.Style = [fsUnderline]
+ ParentFont = False
+ ShowAccelChar = False
+ OnClick = TntLabel5Click
+ end
+ object edInput: TTntEdit
+ Left = 21
+ Top = 42
+ Width = 444
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ TabOrder = 0
+ OnChange = edInputChange
+ end
+ object btnInput: TTntButton
+ Left = 478
+ Top = 42
+ Width = 75
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = '&Browse...'
+ TabOrder = 1
+ OnClick = btnInputClick
+ end
+ object edOutput: TTntEdit
+ Left = 21
+ Top = 151
+ Width = 444
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ TabOrder = 4
+ OnChange = edOutputChange
+ end
+ object btnOutput: TTntButton
+ Left = 478
+ Top = 151
+ Width = 75
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'Bro&wse...'
+ TabOrder = 5
+ OnClick = btnOutputClick
+ end
+ object cbOriginal: TTntComboBox
+ Left = 21
+ Top = 95
+ Width = 253
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 2
+ end
+ object cbTranslation: TTntComboBox
+ Left = 287
+ Top = 95
+ Width = 264
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 3
+ end
+ object btnCreate: TTntButton
+ Left = 366
+ Top = 193
+ Width = 187
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = '&Create dictionary'
+ Default = True
+ TabOrder = 7
+ OnClick = btnCreateClick
+ end
+ object chkOverwrite: TTntCheckBox
+ Left = 21
+ Top = 192
+ Width = 239
+ Height = 17
+ Caption = 'Over&write output file'
+ TabOrder = 6
+ end
+ object dlgInput: TTntOpenDialog
+ DefaultExt = '.csv'
+ FileName = 'Microsoft Terminology.csv'
+ Filter = 'Microsoft Terminology Files|*.csv|All files|*.*'
+ InitialDir = '.'
+ Options = [ofFileMustExist, ofEnableSizing]
+ Left = 455
+ Top = 50
+ end
+ object dlgOutput: TTntSaveDialog
+ DefaultExt = 'dct'
+ Filter = 'Dictionary files|*.dct|All files|*.*'
+ InitialDir = '.'
+ Options = [ofEnableSizing]
+ Left = 455
+ Top = 116
+ end
+end
Added: translator/trunk/src/MsTermBuild/MainFrm.pas
===================================================================
--- translator/trunk/src/MsTermBuild/MainFrm.pas (rev 0)
+++ translator/trunk/src/MsTermBuild/MainFrm.pas 2006-09-23 15:37:41 UTC (rev 98)
@@ -0,0 +1,287 @@
+unit MainFrm;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
+ Dialogs, StdCtrls, TntClasses, TntSysUtils, TntStdCtrls, TntDialogs;
+
+type
+ TfrmMain = class(TForm)
+ TntLabel1: TTntLabel;
+ edInput: TTntEdit;
+ btnInput: TTntButton;
+ TntLabel2: TTntLabel;
+ edOutput: TTntEdit;
+ btnOutput: TTntButton;
+ TntLabel3: TTntLabel;
+ cbOriginal: TTntComboBox;
+ TntLabel4: TTntLabel;
+ cbTranslation: TTntComboBox;
+ btnCreate: TTntButton;
+ dlgInput: TTntOpenDialog;
+ dlgOutput: TTntSaveDialog;
+ chkOverwrite: TTntCheckBox;
+ TntLabel5: TTntLabel;
+ procedure edInputChange(Sender: TObject);
+ procedure btnCreateClick(Sender: TObject);
+ procedure btnInputClick(Sender: TObject);
+ procedure btnOutputClick(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+ procedure TntLabel5Click(Sender: TObject);
+ procedure edOutputChange(Sender: TObject);
+ private
+ { Private declarations }
+ procedure LoadSettings;
+ procedure SaveSettings;
+ procedure LoadLanguages(const Filename: WideString; Original, Translation: TTntStrings);
+ function Validate: boolean;
+ procedure ConvertFile(const Input, Output: WideString; OrigIndex,
+ TransIndex: integer; OverwriteOutput: boolean);
+ public
+ { Public declarations }
+ end;
+
+var
+ frmMain: TfrmMain;
+
+implementation
+uses
+ TntWideStrUtils, IniFiles, TntWindows;
+
+{$R *.dfm}
+
+procedure TfrmMain.edInputChange(Sender: TObject);
+var i, j: integer;
+
+ function Max(Value1, Value2: integer): integer;
+ begin
+ Result := Value1;
+ if Value2 > Value1 then
+ Result := Value2;
+ end;
+begin
+ if FileExists(edInput.Text) then
+ begin
+ if edOutput.Text = '' then
+ edOutput.Text := ChangeFileExt(edINput.Text, '.dct');
+ i := cbOriginal.ItemIndex;
+ j := cbTranslation.ItemIndex;
+ LoadLanguages(edInput.Text, cbOriginal.Items, cbTranslation.Items);
+ cbOriginal.ItemIndex := Max(i, 0);
+ cbTranslation.ItemIndex := Max(j, 0);
+ end;
+ edInput.Hint := edInput.Text;
+end;
+
+procedure TfrmMain.btnOutputClick(Sender: TObject);
+begin
+ dlgOutput.Filename := edOutput.Text;
+ if dlgOutput.Execute then
+ edOutput.Text := dlgOutput.Filename;
+end;
+
+procedure TfrmMain.btnInputClick(Sender: TObject);
+begin
+ dlgInput.Filename := edInput.Text;
+ if dlgInput.Execute then
+ begin
+ edInput.Text := dlgInput.Filename;
+ edInputChange(Sender);
+ end;
+end;
+
+procedure SplitString(const S: WideString; Strings: TTntStrings; Delimiter: WideChar);
+var
+ i, j: integer;
+ tmp: WideString;
+begin
+ j := 1;
+ Strings.Clear;
+ for i := 0 to Length(S) do
+ begin
+ if S[i] = Delimiter then
+ begin
+ tmp := Copy(S, j, i - j);
+ Strings.Add(tmp);
+ j := i + 1;
+ end;
+ end;
+end;
+
+procedure TfrmMain.LoadLanguages(const Filename: WideString; Original,
+ Translation: TTntStrings);
+const
+ cMarker: PWideChar = 'English - United States'; // this is the start of the first item
+var
+ S, T: TTntStringlist;
+ i: integer;
+begin
+ Original.BeginUpdate;
+ S := TTntStringlist.Create;
+ T := TTntStringlist.Create;
+ try
+ S.LoadFromFile(Filename);
+ for i := 0 to S.Count - 1 do
+ if Pos(cMarker, S[i]) = 1 then
+ begin
+ T.Text := Tnt_WideStringReplace(S[i], #9, #13#10, [rfReplaceAll]);
+// SplitString(S[i], T, #9);
+ Original.Assign(T);
+ Translation.Assign(T);
+ Exit;
+ end;
+ finally
+ Original.EndUpdate;
+ S.Free;
+ T.Free;
+ end;
+end;
+
+function TfrmMain.Validate: boolean;
+var S: WideString;
+begin
+ Result := true;
+ S := '';
+ if not FileExists(edInput.Text) then
+ begin
+ Result := false;
+ S := 'The specified input file was not found!';
+ edInput.SetFocus;
+ end
+ else if cbOriginal.ItemIndex < 0 then
+ begin
+ Result := false;
+ S := 'Please select an original language!';
+ cbOriginal.SetFocus;
+ end
+ else if cbTranslation.ItemIndex < 0 then
+ begin
+ Result := false;
+ S := 'Please select a translation language!';
+ cbTranslation.SetFocus;
+ end
+ else if cbTranslation.ItemIndex = cbOriginal.ItemIndex then
+ begin
+ Result := false;
+ S := 'Please specify different languages for original and translation!';
+ cbOriginal.SetFocus;
+ end
+ else if edOutput.Text = '' then
+ begin
+ Result := false;
+ S := 'Please specify an output filename!';
+ edOutput.SetFocus;
+ end;
+
+ if not Result then
+ WideMessageDlg(S, mtError, [mbOK], 0);
+end;
+
+procedure TfrmMain.ConvertFile(const Input, Output: WideString; OrigIndex, TransIndex: integer; OverwriteOutput: boolean);
+const
+ cMarker: PWideChar = 'English - United States'; // this is the start of the first item
+var
+ I, T, O: TTntStringlist;
+ j: integer;
+ MarkerFound: boolean;
+begin
+ if (OrigIndex < 0) or (TransIndex < 0) then
+ raise Exception.CreateFmt('OrigIndex (%d) or TransIndex (%d) is invalid', [OrigIndex, TransIndex]);
+ I := TTntStringlist.Create;
+ T := TTntStringlist.Create;
+ O := TTntStringlist.Create;
+ MarkerFound := false;
+ try
+ T.Delimiter := #9;
+ I.LoadFromFile(Input);
+ if not OverwriteOutput and FileExists(Output) then
+ O.LoadFromFile(Output);
+ for j := 0 to I.Count - 1 do
+ begin
+ if MarkerFound then
+ begin
+ T.Text := Tnt_WideStringReplace(I[j], #9, #13#10, [rfReplaceAll]);
+
+ // SplitString(I[j], T, #9);
+ if (OrigIndex < T.Count) and (TransIndex < T.Count) then
+ O.Add(WideFormat('%s="%s"', [WideDequotedStr(T[OrigIndex], '"'), WideDequotedStr(T[TransIndex], '"')]));
+ end;
+ if Pos(cMarker, I[j]) = 1 then
+ MarkerFound := true;
+ end;
+ O.SaveToFile(Output);
+ finally
+ I.Free;
+ T.Free;
+ O.Free;
+ end;
+end;
+
+procedure TfrmMain.btnCreateClick(Sender: TObject);
+begin
+ Screen.Cursor := crHourGlass;
+ try
+ if Validate then
+ begin
+ ConvertFile(ExpandUNCFilename(edInput.Text), ExpandUNCFilename(edOutput.Text), cbOriginal.ItemIndex, cbTranslation.ItemIndex, chkOverwrite.Checked);
+ WideShowMessage('Conversion done!');
+ end;
+ finally
+ Screen.Cursor := crDefault;
+ end;
+end;
+
+procedure TfrmMain.LoadSettings;
+begin
+ with TIniFile.Create(ChangeFileExt(Application.Exename, '.ini')) do
+ try
+ edInput.Text := ReadString('Settings', 'Input', '');
+ edOutput.Text := ReadString('Settings', 'Output', '');
+ cbOriginal.ItemIndex := ReadInteger('Settings', 'OriginalIndex', 0);
+ cbTranslation.ItemIndex := ReadInteger('Settings', 'TranslationIndex', 0);
+ chkOverwrite.Checked := ReadBool('Settings', 'Overwrite', true);
+ finally
+ Free;
+ end;
+end;
+
+procedure TfrmMain.SaveSettings;
+begin
+ with TIniFile.Create(ChangeFileExt(Application.Exename, '.ini')) do
+ try
+ WriteString('Settings', 'Input', edInput.Text);
+ WriteString('Settings', 'Output', edOutput.Text);
+ WriteInteger('Settings', 'OriginalIndex', cbOriginal.ItemIndex);
+ WriteInteger('Settings', 'TranslationIndex', cbTranslation.ItemIndex);
+ WriteBool('Settings', 'Overwrite', chkOverwrite.Checked);
+ finally
+ Free;
+ end;
+
+end;
+
+procedure TfrmMain.FormShow(Sender: TObject);
+begin
+ OnShow := nil;
+ LoadSettings;
+end;
+
+procedure TfrmMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+begin
+ SaveSettings;
+end;
+
+procedure TfrmMain.TntLabel5Click(Sender: TObject);
+begin
+ Tnt_ShellExecuteW(Handle, 'open', 'http://www.microsoft.com/globaldev/tools/MILSGlossary.mspx', nil, nil, SW_SHOWNORMAL);
+end;
+
+procedure TfrmMain.edOutputChange(Sender: TObject);
+begin
+ edOutput.Hint := edOutput.Text;
+end;
+
+end.
+
Added: translator/trunk/src/MsTermBuild/MsTermBuild.dof
===================================================================
--- translator/trunk/src/MsTermBuild/MsTermBuild.dof (rev 0)
+++ translator/trunk/src/MsTermBuild/MsTermBuild.dof 2006-09-23 15:37:41 UTC (rev 98)
@@ -0,0 +1,45 @@
+[Compiler]
+UnsafeType=0
+UnsafeCode=0
+UnsafeCast=0
+[Linker]
+MapFile=3
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=0
+RemoteSymbols=0
+MinStackSize=16384
+MaxStackSize=1048576
+ImageBase=4194304
+ExeDescription=
+[Directories]
+OutputDir=..\..\bin
+UnitOutputDir=..\..\dcu
+[Version Info]
+IncludeVerInfo=1
+AutoIncBuild=0
+MajorVer=1
+MinorVer=8
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+[Version Info Keys]
+CompanyName=Peter Th\xF6rnqvist
+FileDescription=MsTermBuild
+FileVersion=1.8.0.0
+InternalName=MsDictBuild.exe
+LegalCopyright=Copyright (c) 2003-2004 by Peter Th\xF6rnqvist; all rights reserved
+LegalTrademarks=
+OriginalFilename=MsTermBuild.exe
+ProductName=MsTermBuild
+ProductVersion=1.8.0.0
+Webpage=http://initranslator.sourceforge.net
+License=Mozilla Public License 1.1
+Comments=Latest version at http://initranslator.sourceforge.net
+Compile Date=
Added: translator/trunk/src/MsTermBuild/MsTermBuild.dpr
===================================================================
--- translator/trunk/src/MsTermBuild/MsTermBuild.dpr (rev 0)
+++ translator/trunk/src/MsTermBuild/MsTermBuild.dpr 2006-09-23 15:37:41 UTC (rev 98)
@@ -0,0 +1,18 @@
+program MsTermBuild;
+
+
+
+uses
+ Forms,
+ MainFrm in 'MainFrm.pas' {frmMain};
+
+{$R 'manifest.res' 'manifest.rc'}
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.Title := 'MS Terminology Translations Builder';
+ Application.CreateForm(TfrmMain, frmMain...
[truncated message content] |