Browse Source

Merged revisions 11112-11113 via svnmerge from
svn+ssh://svn.freepascal.org/FPC/svn/fpc/trunk

........
r11112 | michael | 2008-05-28 22:14:20 +0200 (Wed, 28 May 2008) | 1 line

* Added support for a directory with .mo files, and support for HTML specification of charset
........
r11113 | michael | 2008-05-28 22:17:02 +0200 (Wed, 28 May 2008) | 1 line

Slovak translation from Dusan Halicky
........

git-svn-id: branches/fixes_2_2@11114 -

michael 17 years ago
parent
commit
cf7cecdefd
5 changed files with 215 additions and 4 deletions
  1. 1 0
      .gitattributes
  2. 19 3
      utils/fpdoc/dglobals.pp
  3. 7 1
      utils/fpdoc/dw_html.pp
  4. 3 0
      utils/fpdoc/fpdoc.pp
  5. 185 0
      utils/fpdoc/intl/dglobals.sk.po

+ 1 - 0
.gitattributes

@@ -9059,6 +9059,7 @@ utils/fpdoc/fpdoc.css -text
 utils/fpdoc/fpdoc.pp svneol=native#text/plain
 utils/fpdoc/intl/Makefile svneol=native#text/plain
 utils/fpdoc/intl/dglobals.de.po svneol=native#text/plain
+utils/fpdoc/intl/dglobals.sk.po svneol=native#text/plain
 utils/fpdoc/intl/dwriter.de.po svneol=native#text/plain
 utils/fpdoc/intl/fpdoc.de.po svneol=native#text/plain
 utils/fpdoc/intl/fpdocmk.de.po svneol=native#text/plain

+ 19 - 3
utils/fpdoc/dglobals.pp

@@ -27,7 +27,8 @@ uses Classes, DOM, PasTree, PParser;
 
 Var
   LEOL : Integer;
-
+  modir : string;
+  
 resourcestring
   // Output strings
   SDocPackageTitle           = 'Reference for package ''%s''';
@@ -132,6 +133,8 @@ resourcestring
   SUsageOption150  = '--package=name    Set the package name for which to create output';
   SUsageOption160  = '--show-private    Show private methods.';
   SUsageOption170  = '--warn-no-node    Warn if no documentation node was found.';
+  SUsageOption180  = '--mo-dir=dir      Set directory where language files reside to dir';
+  
   SUsageFormats        = 'The following output formats are supported by this fpdoc:';
   SUsageBackendHelp    = 'Specify an output format, combined with --help to get more help for this backend.';
   SUsageFormatSpecific = 'Output format "%s" supports the following options:';
@@ -1231,13 +1234,26 @@ end;
 { Global helpers }
 
 procedure TranslateDocStrings(const Lang: String);
+
+Const
+{$ifdef unix}
+  DefDir = '/usr/local/share/locale';
+{$else}  
+  DefDir = 'intl'
+{$endif}
+
 var
   mo: TMOFile;
+  dir : string;
 begin
+  dir:=modir;
+  If Dir='' then
+    Dir:=DefDir;
+  Dir:=IncludeTrailingPathDelimiter(Dir);
 {$IFDEF Unix}
-  mo := TMOFile.Create(Format('/usr/local/share/locale/%s/LC_MESSAGES/dglobals.mo', [Lang]));
+  mo := TMOFile.Create(Format(Dir+'%s/LC_MESSAGES/dglobals.mo', [Lang]));
 {$ELSE}
-  mo := TMOFile.Create(Format('intl/dglobals.%s.mo', [Lang]));
+  mo := TMOFile.Create(Format(Dir+'dglobals.%s.mo', [Lang]));
 {$ENDIF}
   try
     TranslateResourceStrings(mo);

+ 7 - 1
utils/fpdoc/dw_html.pp

@@ -84,6 +84,7 @@ type
   private
     FOnTest: TNotifyEvent;
     FPackage: TPasPackage;
+    FCharSet : String;
     function GetPageCount: Integer;
     procedure SetOnTest(const AValue: TNotifyEvent);
   protected
@@ -244,6 +245,7 @@ type
     Property IncludeDateInFooter : Boolean Read FIDF Write FIDF;
     Property DateFormat : String Read FDateFormat Write FDateFormat;
     property OnTest: TNotifyEvent read FOnTest write SetOnTest;
+    Property CharSet : String Read FCharSet Write FCharSet;
     Function InterPretOption(Const Cmd,Arg : String) : boolean; override;
     Procedure WriteDoc; override;
     class procedure Usage(List: TStrings); override;
@@ -564,6 +566,7 @@ var
   i: Integer;
 begin
   inherited ;
+  Charset:='iso-8859-1';
   CreateAllocator;
   FPackage := APackage;
   OutputNodeStack := TList.Create;
@@ -608,7 +611,8 @@ begin
   El := Doc.CreateElement('meta');
   HeadEl.AppendChild(El);
   El['http-equiv'] := 'Content-Type';
-  El['content'] := 'text/html; charset=iso-8859-1';
+  
+  El['content'] := Format('text/html; charset=%s',[charset]);
   TitleElement := Doc.CreateElement('title');
   HeadEl.AppendChild(TitleElement);
   El := Doc.CreateElement('link');
@@ -2988,6 +2992,8 @@ begin
     SearchPage := Arg
   else if Cmd = '--footer' then
     FooterFile := Arg
+  else if Cmd = '--charset' then
+    CharSet := Arg
   else if Cmd = '--footer-date' then
     begin
     FIDF:=True;

+ 3 - 0
utils/fpdoc/fpdoc.pp

@@ -69,6 +69,7 @@ begin
   Writeln(SUsageOption150);
   Writeln(SUsageOption160);
   Writeln(SUsageOption170);
+  Writeln(SUsageOption180);
   L:=TStringList.Create;
   Try
     If (Backend='') then
@@ -204,6 +205,8 @@ begin
       OSTarget := Arg
     else if Cmd = '--cputarget' then
       CPUTarget := Arg
+    else if Cmd = '--mo-dir' then
+      modir := Arg
     else
       begin
       BackendOptions.Add(Cmd);

+ 185 - 0
utils/fpdoc/intl/dglobals.sk.po

@@ -0,0 +1,185 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: FPDOC Slovak Translation\n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: \n"
+"Last-Translator: Dusan Halicky <[email protected]>\n"
+"Language-Team:  <[email protected]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Slovak\n"
+"X-Poedit-Country: SLOVAKIA\n"
+
+#: dglobals:sdocpackagetitle
+msgid "Reference for package '%s'"
+msgstr "Referencia pre balíček '%s'"
+
+#: dglobals:sdocprograms
+msgid "Programs"
+msgstr "Programy"
+
+#: dglobals:sdocunits
+msgid "Units"
+msgstr "Unity"
+
+#: dglobals:sdocunittitle
+msgid "Reference for unit '%s'"
+msgstr "Referencie pre Unit '%s'"
+
+#: dglobals:sdocinterfacesection
+msgid "Interface section"
+msgstr "Sekcia Interface"
+
+#: dglobals:sdocimplementationsection
+msgid "Implementation section"
+msgstr "Sekcia Implementation"
+
+#: dglobals:sdocusedunits
+msgid "Used units"
+msgstr "Použité Unity"
+
+#: dglobals:sdocusedunitsbyunitxy
+msgid "Used units by unit '%s'"
+msgstr "Unity použité unitou '%s'"
+
+#: dglobals:sdocconststypesvars
+msgid "Constants, types and variables"
+msgstr "Konštanty, typy a premenné"
+
+#: dglobals:sdocresstrings
+msgid "Resource strings"
+msgstr "Resource retazec"
+
+#: dglobals:sdoctypes
+msgid "Types"
+msgstr "Typy"
+
+#: dglobals:sdocconstants
+msgid "Constants"
+msgstr "Konštanty"
+
+#: dglobals:sdocclasses
+msgid "Classes"
+msgstr "Triedy"
+
+#: dglobals:sdocproceduresandfunctions
+msgid "Procedures and functions"
+msgstr "Procedúry a funkcie"
+
+#: dglobals:sdocvariables
+msgid "Variables"
+msgstr "Premenné"
+
+#: dglobals:sdocunitoverview
+msgid "Overview of unit '%s'"
+msgstr "Prehľad unity '%s'"
+
+#: dglobals:sdocoverview
+msgid "Overview"
+msgstr "Prehľad"
+
+#: dglobals:sdocsearch
+msgid "Search"
+msgstr "Hľadať"
+
+#: dglobals:sdocdeclaration
+msgid "Declaration"
+msgstr "Deklarácia"
+
+#: dglobals:sdocdescription
+msgid "Description"
+msgstr "Popis"
+
+#: dglobals:sdocerrors
+msgid "Errors"
+msgstr "Chyby"
+
+#: dglobals:sdocseealso
+msgid "See also"
+msgstr "Pozri tiež"
+
+#: dglobals:sdocexample
+msgid "Example"
+msgstr "Príklad"
+
+#: dglobals:sdocarguments
+msgid "Arguments"
+msgstr "Argumenty"
+
+#: dglobals:sdocfunctionresult
+msgid "Function result"
+msgstr "Návratová hodnota funkcie"
+
+#: dglobals:sdocremark
+msgid "Remark:   "
+msgstr "Poznámka:   "
+
+#: dglobals:sdocmethodoverview
+msgid "Method overview"
+msgstr "Prehľad metódy"
+
+#: dglobals:sdocpropertyoverview
+msgid "Property overview"
+msgstr "Prehľad property"
+
+#: dglobals:sdocpage
+msgid "Page"
+msgstr "Stránka"
+
+#: dglobals:sdocmethod
+msgid "Method"
+msgstr "Metóda"
+
+#: dglobals:sdocproperty
+msgid "Property"
+msgstr "Property"
+
+#: dglobals:sdocaccess
+msgid "Access"
+msgstr "Prístup"
+
+#: dglobals:sdocinheritance
+msgid "Inheritance"
+msgstr "Dedičnosť"
+
+#: dglobals:sdocproperties
+msgid "Properties"
+msgstr "Properties"
+
+#: dglobals:sdocmethods
+msgid "Methods"
+msgstr "Metódy"
+
+#: dglobals:sdocevents
+msgid "Events"
+msgstr "Udalosti"
+
+#: dglobals:sdocbyname
+msgid "by Name"
+msgstr "poľa Mena"
+
+#: dglobals:sdocvalue
+msgid "Value"
+msgstr "Hodnota"
+
+#: dglobals:sdocexplanation
+msgid "Explanation"
+msgstr "Vysvetlenie"
+
+#: dglobals:sdocvaluesforenum
+msgid "Enumeration values for type %s"
+msgstr "Vymenovanie hodnôt pre typ %s"
+
+#: dglobals.sdocup
+msgid "Up"
+msgstr "Hore"
+
+#: dglobals.sdocnext
+msgid "Next"
+msgstr "Ďalší"
+
+#: dglobals.sdocprevious
+msgid "Previous"
+msgstr "Predchádzajúci"
+