[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/Utils.pm (definition_categor
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/Utils.pm (definition_category_tree), tp/Texinfo/XS/main/convert_utils.c (definition_category_tree): set translation using the documentlanguage extra information from the tree element if there are no options available. |
Date: |
Fri, 02 Feb 2024 17:57:55 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 8e299255a2 * tp/Texinfo/Convert/Utils.pm (definition_category_tree),
tp/Texinfo/XS/main/convert_utils.c (definition_category_tree): set translation
using the documentlanguage extra information from the tree element if there are
no options available.
8e299255a2 is described below
commit 8e299255a2c7ebb75ebd568772df006c8b778103
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Feb 2 23:57:48 2024 +0100
* tp/Texinfo/Convert/Utils.pm (definition_category_tree),
tp/Texinfo/XS/main/convert_utils.c (definition_category_tree):
set translation using the documentlanguage extra information from the
tree element if there are no options available.
---
ChangeLog | 9 ++++-
tp/Texinfo/Convert/Utils.pm | 35 +++++++++--------
tp/Texinfo/XS/main/convert_utils.c | 44 +++++++++++++++-------
.../translation_in_parser_in_translation.pl | 2 +-
tp/t/results/languages/documentlanguage_option.pl | 2 +-
.../results/languages/multiple_documentlanguage.pl | 4 +-
tp/t/results/languages/multiple_in_preamble.pl | 2 +-
tp/t/results/languages/multiple_lang_chapters.pl | 2 +-
.../languages/multiple_lang_chapters_latex.pl | 2 +-
.../languages/multiple_lang_chapters_texi2html.pl | 2 +-
tp/t/results/languages/simple_documentlanguage.pl | 2 +-
tp/t/results/languages/unknown_region.pl | 2 +-
12 files changed, 68 insertions(+), 40 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e3f143bc44..53d2996532 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,15 @@
+2024-02-02 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/Utils.pm (definition_category_tree),
+ tp/Texinfo/XS/main/convert_utils.c (definition_category_tree):
+ set translation using the documentlanguage extra information from the
+ tree element if there are no options available.
+
2024-02-02 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/Text.pm (_convert),
tp/Texinfo/XS/main/convert_to_text.c (convert_to_text_internal):
- translated untranslated type using the documentlanguage extra
+ translate untranslated type using the documentlanguage extra
information from the tree element if there is no converter
available.
diff --git a/tp/Texinfo/Convert/Utils.pm b/tp/Texinfo/Convert/Utils.pm
index dab04a176a..59e3282606 100644
--- a/tp/Texinfo/Convert/Utils.pm
+++ b/tp/Texinfo/Convert/Utils.pm
@@ -180,35 +180,40 @@ sub definition_category_tree($$)
or $def_command eq 'deftypeop'
or $def_command eq 'defmethod'
or $def_command eq 'deftypemethod') {
+ my $substrings = {'category' => $arg_category, 'class' => $arg_class};
if ($self) {
# TRANSLATORS: association of a method or operation name with a class
# in descriptions of object-oriented programming methods or operations.
- return $self->cdt('{category} on @code{{class}}',
- {'category' => $arg_category,
- 'class' => $arg_class});
+ return $self->cdt('{category} on @code{{class}}', $substrings);
} else {
- my $result = {};
- $result->{'contents'}
- = [$arg_category, {'text' => ' on ', 'parent' => $result},
- $arg_class_code];
- return $result;
+ return Texinfo::Translations::gdt(undef, '{category} on @code{{class}}',
+ $current->{'extra'}->{'documentlanguage'},
+ $substrings);
+ #my $result = {};
+ #$result->{'contents'}
+ # = [$arg_category, {'text' => ' on ', 'parent' => $result},
+ # $arg_class_code];
+ #return $result;
}
} elsif ($def_command eq 'defivar'
or $def_command eq 'deftypeivar'
or $def_command eq 'defcv'
or $def_command eq 'deftypecv') {
+ my $substrings = {'category' => $arg_category, 'class' => $arg_class};
if ($self) {
# TRANSLATORS: association of a variable or instance variable with
# a class in descriptions of object-oriented programming variables
# or instance variable.
- return $self->cdt('{category} of @code{{class}}', { 'category' =>
$arg_category,
- 'class' => $arg_class });
+ return $self->cdt('{category} of @code{{class}}', $substrings);
} else {
- my $result = {};
- $result->{'contents'}
- = [$arg_category, {'text' => ' of ', 'parent' => $result},
- $arg_class_code];
- return $result;
+ return Texinfo::Translations::gdt(undef, '{category} of @code{{class}}',
+ $current->{'extra'}->{'documentlanguage'},
+ $substrings);
+ #my $result = {};
+ #$result->{'contents'}
+ # = [$arg_category, {'text' => ' of ', 'parent' => $result},
+ # $arg_class_code];
+ #return $result;
}
}
}
diff --git a/tp/Texinfo/XS/main/convert_utils.c
b/tp/Texinfo/XS/main/convert_utils.c
index 35a28a0303..cfab2f7a95 100644
--- a/tp/Texinfo/XS/main/convert_utils.c
+++ b/tp/Texinfo/XS/main/convert_utils.c
@@ -497,7 +497,9 @@ definition_category_tree (OPTIONS * options, const ELEMENT
*current)
ELEMENT *result = 0;
ELEMENT *arg_category = 0;
ELEMENT *arg_class = 0;
+ /*
ELEMENT *arg_class_code;
+ */
ELEMENT *class_copy;
char *def_command;
@@ -534,6 +536,7 @@ definition_category_tree (OPTIONS * options, const ELEMENT
*current)
class_copy = copy_tree (arg_class);
+ /*
if (!options)
{
ELEMENT *brace_command_arg = new_element (ET_brace_command_arg);
@@ -542,6 +545,7 @@ definition_category_tree (OPTIONS * options, const ELEMENT
*current)
add_to_element_contents (brace_command_arg, class_copy);
add_to_element_args (arg_class_code, brace_command_arg);
}
+ */
def_command = lookup_extra_string (current, "def_command");
@@ -552,14 +556,14 @@ definition_category_tree (OPTIONS * options, const
ELEMENT *current)
|| !strcmp(def_command, "deftypemethod"))
{
ELEMENT *category_copy = copy_tree (arg_category);
+ NAMED_STRING_ELEMENT_LIST *substrings
+ = new_named_string_element_list ();
+ add_element_to_named_string_element_list (substrings,
+ "category", category_copy);
+ add_element_to_named_string_element_list (substrings,
+ "class", class_copy);
if (options)
{
- NAMED_STRING_ELEMENT_LIST *substrings
- = new_named_string_element_list ();
- add_element_to_named_string_element_list (substrings,
- "category",
category_copy);
- add_element_to_named_string_element_list (substrings,
- "class",
class_copy);
/*
TRANSLATORS: association of a method or operation name with a class
in descriptions of object-oriented programming methods or operations.
@@ -567,31 +571,37 @@ definition_category_tree (OPTIONS * options, const
ELEMENT *current)
result = gdt_tree ("{category} on @code{{class}}", 0, options,
options->documentlanguage.string, substrings, 0);
- destroy_named_string_element_list (substrings);
}
else
{
+ const char *documentlanguage
+ = lookup_extra_string (current, "documentlanguage");
+ result = gdt_tree ("{category} on @code{{class}}", 0, 0,
+ documentlanguage, substrings, 0);
+ /*
result = new_element (ET_NONE);
ELEMENT *text_element = new_element (ET_NONE);
add_to_element_contents (result, category_copy);
text_append (&text_element->text, " on ");
add_to_element_contents (result, text_element);
add_to_element_contents (result, arg_class_code);
+ */
}
+ destroy_named_string_element_list (substrings);
} else if (!strcmp(def_command, "defivar")
|| !strcmp(def_command, "deftypeivar")
|| !strcmp(def_command, "defcv")
|| !strcmp(def_command, "deftypecv"))
{
ELEMENT *category_copy = copy_tree (arg_category);
+ NAMED_STRING_ELEMENT_LIST *substrings
+ = new_named_string_element_list ();
+ add_element_to_named_string_element_list (substrings,
+ "category", category_copy);
+ add_element_to_named_string_element_list (substrings,
+ "class", class_copy);
if (options)
{
- NAMED_STRING_ELEMENT_LIST *substrings
- = new_named_string_element_list ();
- add_element_to_named_string_element_list (substrings,
- "category",
category_copy);
- add_element_to_named_string_element_list (substrings,
- "class",
class_copy);
/*
TRANSLATORS: association of a method or operation name with a class
in descriptions of object-oriented programming methods or operations.
@@ -599,17 +609,23 @@ definition_category_tree (OPTIONS * options, const
ELEMENT *current)
result = gdt_tree ("{category} of @code{{class}}", 0, options,
options->documentlanguage.string, substrings, 0);
- destroy_named_string_element_list (substrings);
}
else
{
+ const char *documentlanguage
+ = lookup_extra_string (current, "documentlanguage");
+ result = gdt_tree ("{category} of @code{{class}}", 0, 0,
+ documentlanguage, substrings, 0);
+ /*
result = new_element (ET_NONE);
ELEMENT *text_element = new_element (ET_NONE);
add_to_element_contents (result, category_copy);
text_append (&text_element->text, " of ");
add_to_element_contents (result, text_element);
add_to_element_contents (result, arg_class_code);
+ */
}
+ destroy_named_string_element_list (substrings);
}
return result;
}
diff --git
a/tp/t/results/init_files_tests/translation_in_parser_in_translation.pl
b/tp/t/results/init_files_tests/translation_in_parser_in_translation.pl
index ec92d0e6a8..cb440fbce5 100644
--- a/tp/t/results/init_files_tests/translation_in_parser_in_translation.pl
+++ b/tp/t/results/init_files_tests/translation_in_parser_in_translation.pl
@@ -400,7 +400,7 @@ top
1 Chap
******
-da on db: dc dd de
+da de db: dc dd de
DOC
';
diff --git a/tp/t/results/languages/documentlanguage_option.pl
b/tp/t/results/languages/documentlanguage_option.pl
index 514aa4c2c3..385660c725 100644
--- a/tp/t/results/languages/documentlanguage_option.pl
+++ b/tp/t/results/languages/documentlanguage_option.pl
@@ -736,7 +736,7 @@ top section
chapter.
-Me\'thode on class: data-type name arguments
+Me\'thode de class: data-type name arguments
Some text.
diff --git a/tp/t/results/languages/multiple_documentlanguage.pl
b/tp/t/results/languages/multiple_documentlanguage.pl
index 41f70fcdcb..78421b5db8 100644
--- a/tp/t/results/languages/multiple_documentlanguage.pl
+++ b/tp/t/results/languages/multiple_documentlanguage.pl
@@ -1009,13 +1009,13 @@ top
1 Chap
******
-Variable d\'instance of fr: BBB CCC
+Variable d\'instance de fr: BBB CCC
error-->
-Primjerak varijable of hr: BBB CCC
+Primjerak varijable od hr: BBB CCC
error-->
diff --git a/tp/t/results/languages/multiple_in_preamble.pl
b/tp/t/results/languages/multiple_in_preamble.pl
index df0a12efe5..5c90bb9fa7 100644
--- a/tp/t/results/languages/multiple_in_preamble.pl
+++ b/tp/t/results/languages/multiple_in_preamble.pl
@@ -902,7 +902,7 @@ top section
1 chap
******
-Primjerak varijable of hr: BBB CCC
+Primjerak varijable od hr: BBB CCC
error-->
diff --git a/tp/t/results/languages/multiple_lang_chapters.pl
b/tp/t/results/languages/multiple_lang_chapters.pl
index 9cc7a4573b..812248a7b0 100644
--- a/tp/t/results/languages/multiple_lang_chapters.pl
+++ b/tp/t/results/languages/multiple_lang_chapters.pl
@@ -1778,7 +1778,7 @@ Instance Variable of AAA: BBB CCC
3 fr_FR
*******
-Variable d\'instance of AAA: BBB CCC
+Variable d\'instance de AAA: BBB CCC
4 de
****
diff --git a/tp/t/results/languages/multiple_lang_chapters_latex.pl
b/tp/t/results/languages/multiple_lang_chapters_latex.pl
index 44fc96af52..99033fb0d8 100644
--- a/tp/t/results/languages/multiple_lang_chapters_latex.pl
+++ b/tp/t/results/languages/multiple_lang_chapters_latex.pl
@@ -1778,7 +1778,7 @@ Instance Variable of AAA: BBB CCC
3 fr_FR
*******
-Variable d\'instance of AAA: BBB CCC
+Variable d\'instance de AAA: BBB CCC
4 de
****
diff --git a/tp/t/results/languages/multiple_lang_chapters_texi2html.pl
b/tp/t/results/languages/multiple_lang_chapters_texi2html.pl
index 4b4882a5b5..33f3577565 100644
--- a/tp/t/results/languages/multiple_lang_chapters_texi2html.pl
+++ b/tp/t/results/languages/multiple_lang_chapters_texi2html.pl
@@ -1746,7 +1746,7 @@ Instance Variable of AAA: BBB CCC
3 fr_FR
*******
-Variable d\'instance of AAA: BBB CCC
+Variable d\'instance de AAA: BBB CCC
4 de
****
diff --git a/tp/t/results/languages/simple_documentlanguage.pl
b/tp/t/results/languages/simple_documentlanguage.pl
index 4fe780ea31..b95f316665 100644
--- a/tp/t/results/languages/simple_documentlanguage.pl
+++ b/tp/t/results/languages/simple_documentlanguage.pl
@@ -303,7 +303,7 @@ $result_texis{'simple_documentlanguage'} =
'@documentlanguage fr
$result_texts{'simple_documentlanguage'} = '
-Variable d\'instance of AAA: BBB CCC
+Variable d\'instance de AAA: BBB CCC
';
$result_nodes{'simple_documentlanguage'} = [
diff --git a/tp/t/results/languages/unknown_region.pl
b/tp/t/results/languages/unknown_region.pl
index 20318a51ab..7f0f895695 100644
--- a/tp/t/results/languages/unknown_region.pl
+++ b/tp/t/results/languages/unknown_region.pl
@@ -303,7 +303,7 @@ $result_texis{'unknown_region'} = '@documentlanguage
fr_NOWHERE
$result_texts{'unknown_region'} = '
-Variable d\'instance of AAA: BBB CCC
+Variable d\'instance de AAA: BBB CCC
';
$result_nodes{'unknown_region'} = [
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/Utils.pm (definition_category_tree), tp/Texinfo/XS/main/convert_utils.c (definition_category_tree): set translation using the documentlanguage extra information from the tree element if there are no options available.,
Patrice Dumas <=