[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/manipulate_indices.c (setup_
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/manipulate_indices.c (setup_collator): warn if the collation_locale is not found. |
Date: |
Wed, 14 Feb 2024 10:42:50 -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 9602b17782 * tp/Texinfo/XS/main/manipulate_indices.c (setup_collator):
warn if the collation_locale is not found.
9602b17782 is described below
commit 9602b177821cbde49e2745c8bf3fa2d0e687f550
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Feb 14 16:42:46 2024 +0100
* tp/Texinfo/XS/main/manipulate_indices.c (setup_collator): warn if
the collation_locale is not found.
---
ChangeLog | 5 +++++
tp/Texinfo/XS/main/manipulate_indices.c | 11 ++++++++---
.../index_collation_test.2 | 1 +
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7a4fe078c1..f83d88fc7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-02-14 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/manipulate_indices.c (setup_collator): warn if
+ the collation_locale is not found.
+
2024-02-14 Patrice Dumas <pertusus@free.fr>
* tp/tests/other/index_collation_test.texi: modify test file to have
diff --git a/tp/Texinfo/XS/main/manipulate_indices.c
b/tp/Texinfo/XS/main/manipulate_indices.c
index 4566f60944..c9ea4f2a7c 100644
--- a/tp/Texinfo/XS/main/manipulate_indices.c
+++ b/tp/Texinfo/XS/main/manipulate_indices.c
@@ -576,7 +576,8 @@ setup_index_entries_sort_strings (ERROR_MESSAGE_LIST
*error_messages,
static INDEX_COLLATOR *
setup_collator (int use_unicode_collation, const char *collation_language,
- const char *collation_locale)
+ const char *collation_locale,
+ ERROR_MESSAGE_LIST *error_messages, OPTIONS *options)
{
INDEX_COLLATOR *result = (INDEX_COLLATOR *) malloc (sizeof (INDEX_COLLATOR));
memset (result, 0, sizeof (INDEX_COLLATOR));
@@ -601,13 +602,17 @@ setup_collator (int use_unicode_collation, const char
*collation_language,
{
result->locale
= newlocale (LC_COLLATE_MASK, collation_locale, 0);
- /* TODO warn if locale is not found? */
if (result->locale)
{
result->type = ctn_locale_collation;
result->language = strdup (collation_locale);
return result;
}
+ else
+ {
+ message_list_document_warn (error_messages, options,
+ "collation locale not found: %s", collation_locale);
+ }
}
#endif
#endif
@@ -705,7 +710,7 @@ setup_sort_sortable_strings_collator (DOCUMENT *document,
error_messages, options, 0);
*collator = setup_collator (use_unicode_collation, collation_language,
- collation_locale);
+ collation_locale, error_messages, options);
index_sortable_index_entries = setup_sortable_index_entries (*collator,
indices_sort_strings);
diff --git
a/tp/tests/other/res_parser/index_collation_test_collation_locale_en/index_collation_test.2
b/tp/tests/other/res_parser/index_collation_test_collation_locale_en/index_collation_test.2
index e69de29bb2..16d22aa516 100644
---
a/tp/tests/other/res_parser/index_collation_test_collation_locale_en/index_collation_test.2
+++
b/tp/tests/other/res_parser/index_collation_test_collation_locale_en/index_collation_test.2
@@ -0,0 +1 @@
+texi2any: warning: collation locale not found: en.utf-8
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/manipulate_indices.c (setup_collator): warn if the collation_locale is not found.,
Patrice Dumas <=