]> git.donarmstrong.com Git - lilypond.git/blobdiff - lilypond-texi2html.init
Doc-es: Spanish texidoc string for the table of scripts
[lilypond.git] / lilypond-texi2html.init
index 7e319e9c0ceacf9a12614953808fb55162c0fc56..cb57e6b7a0ceff5276f47cca288a7ff466412d0f 100644 (file)
@@ -76,13 +76,15 @@ $LY_LANGUAGES->{'fr'} = {
     'Back to Documentation Index' => 'Retour à l\'accueil de la documentation',
 };
 $LY_LANGUAGES->{'es'} = {
-    'Back to Documentation Index' => '',
+    'Back to Documentation Index' => 'Volver al índice de la documentación',
 };
 $LY_LANGUAGES->{'de'} = {
-    'Back to Documentation Index' => '',
+    'Back to Documentation Index' => 'Zur Dokumentationsübersicht',
+};
+$LY_LANGUAGES->{'ja'} = {
+    'Back to Documentation Index' => 'ドキュメント インデックスに戻る',
 };
 
-print $LY_LANGUAGES->{'fr'}->{'Back to Documentation Index'};
 
 sub ly_get_string () {
     my $lang = $Texi2HTML::THISDOC{current_lang};
@@ -128,6 +130,7 @@ $Texi2HTML::Config::print_page_head      = \&lilypond_print_page_head;
 $Texi2HTML::Config::foot_line_and_ref  = \&makeinfo_like_foot_line_and_ref;
 $Texi2HTML::Config::foot_lines         = \&makeinfo_like_foot_lines;
 $Texi2HTML::Config::paragraph          = \&makeinfo_like_paragraph;
+$Texi2HTML::Config::init_out             = \&lilypond_init_out;
 
 
 
@@ -562,6 +565,26 @@ sub lilypond_external_href($$$)
 my $page_toc_depth = 2;
 my @default_toc = [];
 
+
+# Initialize the toc_depth to 1 if the command-line option -D=short_toc is given
+sub lilypond_init_toc_depth ()
+{
+  if (exists($main::value{'short_toc'}) and not exists($main::value{'bigpage'})) {
+    $page_toc_depth = 1;
+  }
+}
+# We can't use a command-handler, because texinfo variables are not yet 
+# available at that stage:
+# push @Texi2HTML::Config::command_handler_init, \&lilypond_init_toc_depth;
+
+# Initialize the toc_depth to 1 if the command-line option -D=short_toc is given
+sub lilypond_init_out()
+{
+  my $rval = t2h_default_init_out();
+  lilypond_init_toc_depth ();
+  return $rval;
+}
+
 # recursively generate the TOC entries for the element and its children (which
 # are only shown up to maxlevel. All ancestors of the current element are also
 # shown with their immediate children, irrespective of their level.
@@ -706,6 +729,9 @@ sub lilypond_print_element_header
 sub lilypond_toc_body($)
 {
     my $elements_list = shift;
+    # Workaround: Initialize the toc-depth here, because init_out is called
+    # only later in texi2html 1.83
+    lilypond_init_toc_depth ();
     # Generate a default TOC for pages without THIS_ELEMENT
     @default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
     return T2H_GPL_toc_body($elements_list);