More fix up for navigation2.conf

This commit is contained in:
Brian Read 2024-07-26 16:31:20 +01:00
parent 55b85496d4
commit 473cb57a47
2 changed files with 14 additions and 7 deletions

View File

@ -123,7 +123,7 @@ foreach my $lang (@langs)
close LEX; close LEX;
} }
#Extract the prefix for this module #Extract the prefix for this module
my @keys = values @panel_lex; # Get all values from the hash my @keys = values @panel_lex; # Get all values from the array
my $i = 0; # Initialize the index my $i = 0; # Initialize the index
my $found = 0; # Flag to check if the prefix was found my $found = 0; # Flag to check if the prefix was found
@ -131,12 +131,13 @@ foreach my $lang (@langs)
while ($i < @keys) { # Loop until we run out of entries while ($i < @keys) { # Loop until we run out of entries
my $extracted_value = $keys[$i] || ""; # The current entry my $extracted_value = $keys[$i] || ""; # The current entry
#print("Extracted val: ".$extracted_value."\n");
# Extract prefix from the second value (up to and including the first underscore) # Extract prefix from the second value (up to and including the first underscore)
my ($prefix) = $extracted_value =~ /^'(.*?_)/; # Match everything up to and including the first underscore #my ($prefix) = $second_value =~ /^'(.*?_)/; # Match everything up to and including the first underscore
($prefix) = $extracted_value =~ /^'(.*?_)/; # Match everything up to and including the first underscore
if (defined $prefix) { if (defined $prefix) {
#print("Prefix: " . $prefix . "\n");
$found = 1; # Set found flag to true $found = 1; # Set found flag to true
last; # Exit the loop if prefix is found last; # Exit the loop if prefix is found
} else { } else {
@ -147,8 +148,11 @@ foreach my $lang (@langs)
} }
if (!$found) { if (!$found) {
print(STDERR "No valid prefix found in any entries: ".$file2." (".$lang.")\n") if DEBUG; print(STDERR "No valid prefix found in any entries: ".$file2." (".$lang.")\n"); # if DEBUG;
$prefix = "xx_"; # Probably never match!!
} }
print("Prefix: ".$prefix."".$file2." (".$lang.")\n");
my %Lexicon = (); my %Lexicon = ();
push(@panel_lex, @gen_lex); push(@panel_lex, @gen_lex);
@ -202,11 +206,11 @@ foreach my $lang (@langs)
sub localise { sub localise {
my ($lexicon, $string) = @_; my ($lexicon, $string) = @_;
# print("Looking up:".$string."\n"); #print("Looking up:".$string."\n");
$string = "" unless defined $string; $string = "" unless defined $string;
my $lc_string = lc($string); my $lc_string = lc($string);
my $res = $lexicon->{$lc_string} || $string; my $res = $lexicon->{$lc_string} || $string;
# print("Returning:".$res."\n"); #print("Returning:".$res."\n");
return $res; return $res;
} }

View File

@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2
%define name smeserver-manager %define name smeserver-manager
Name: %{name} Name: %{name}
%define version 11.0.0 %define version 11.0.0
%define release 9 %define release 10
Version: %{version} Version: %{version}
Release: %{release}%{?dist} Release: %{release}%{?dist}
License: GPL License: GPL
@ -108,6 +108,9 @@ true
%defattr(-,root,root) %defattr(-,root,root)
%changelog %changelog
* Fri Jul 26 2024 Brian Read <brianr@koozali.org> 11.0.0-10.sme
- fix navigation2.conf to more correctly translate menus [SME: 12714]
* Thu May 09 2024 Brian Read <brianr@koozali.org> 11.0.0-9.sme * Thu May 09 2024 Brian Read <brianr@koozali.org> 11.0.0-9.sme
- Add mojo logo to footer [SME: 12679] - Add mojo logo to footer [SME: 12679]
- Fix default for HeaderWeight to avoid noise in logs if no Nav header in file - Fix default for HeaderWeight to avoid noise in logs if no Nav header in file