[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Translations.pm (gdt_string_encoded)
From: |
Gavin D. Smith |
Subject: |
branch master updated: * tp/Texinfo/Translations.pm (gdt_string_encoded): Remove now unused function. |
Date: |
Tue, 23 Jan 2024 16:58:18 -0500 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new bba280d6fc * tp/Texinfo/Translations.pm (gdt_string_encoded): Remove
now unused function.
bba280d6fc is described below
commit bba280d6fc747fced67495bee8734ae8184b0ae2
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Jan 23 21:58:10 2024 +0000
* tp/Texinfo/Translations.pm (gdt_string_encoded): Remove now
unused function.
---
ChangeLog | 5 +++++
tp/Texinfo/Translations.pm | 41 -----------------------------------------
2 files changed, 5 insertions(+), 41 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b11bff2e10..f9a64e556b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-01-23 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * tp/Texinfo/Translations.pm (gdt_string_encoded): Remove now
+ unused function.
+
2024-01-23 Gavin Smith <gavinsmith0123@gmail.com>
* tp/Texinfo/Convert/Plaintext.pm (_text_heading): Return
diff --git a/tp/Texinfo/Translations.pm b/tp/Texinfo/Translations.pm
index e920381265..b450fcd854 100644
--- a/tp/Texinfo/Translations.pm
+++ b/tp/Texinfo/Translations.pm
@@ -329,7 +329,6 @@ sub gdt_string($$;$$$)
# $customization_information->translate_string) because
# $customization_information may not provide the method if it does not
# inherit from Texinfo::Translations, as is the case for Texinfo::Parser.
- # (Same is done in gdt_string_encoded.)
my $translate_string_method
= $customization_information->can('translate_string');
$translate_string_method = \&translate_string if (!$translate_string_method);
@@ -341,46 +340,6 @@ sub gdt_string($$;$$$)
$replaced_substrings);
}
-# Like gdt_string, but return an encoded string, and additionally return
-# the width of the result in screen columns, not counting the width of
-# substituted strings.
-sub gdt_string_encoded($$;$$$)
-{
- my ($customization_information, $string, $replaced_substrings,
- $translation_context, $lang) = @_;
-
- # see comment in gdt_string
- my $translate_string_method
- = $customization_information->can('translate_string');
- $translate_string_method = \&translate_string if (!$translate_string_method);
-
- my $translated_string = &$translate_string_method($customization_information,
- $string, $translation_context, $lang);
-
- my ($result, $result_counted) = ($translated_string, $translated_string);
- my $encoded;
- if ($customization_information->{'encoding_object'}) {
- $encoded = $customization_information->{'encoding_object'}
- ->encode($result);
- } else {
- $encoded = $result; # shouldn't happen
- }
-
- my $re;
- if (defined($replaced_substrings) and ref($replaced_substrings)) {
- $re = join '|', map { quotemeta $_ } keys %$replaced_substrings;
-
- # Replace placeholders
- $encoded =~
- s/\{($re)\}/defined $replaced_substrings->{$1} ?
$replaced_substrings->{$1} : "{$1}"/ge;
-
- # Strip out placeholders
- $result_counted =~ s/\{($re)\}//g;
- }
-
- return ($encoded, Texinfo::Convert::Unicode::string_width($result_counted));
-}
-
sub replace_substrings($$;$)
{
my $customization_information = shift;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Translations.pm (gdt_string_encoded): Remove now unused function.,
Gavin D. Smith <=