Bugzilla – Attachment 165478 Details for
Bug 33237
If TranslateNotices is off, use the default language includes in slips
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33237: Add display of which language default language is expected
Bug-33237-Add-display-of-which-language-default-la.patch (text/plain), 5.53 KB, created by
Martin Renvoize (ashimema)
on 2024-04-24 15:45:30 UTC
(
hide
)
Description:
Bug 33237: Add display of which language default language is expected
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-24 15:45:30 UTC
Size:
5.53 KB
patch
obsolete
>From 4421f141745661b3bce8c1b293c346ae76dbe8fd Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 24 Apr 2024 14:44:05 +0100 >Subject: [PATCH] Bug 33237: Add display of which language default language is > expected > >This patch adds the display of 'Default language' to the 'Default' >language in the notices editor tool. > >This is so that librarians know which language they are expected to be >writing the notice in so we can remain consistent in both template and >include language used. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/tools/letter.tt | 10 ++++++- > tools/letter.pl | 29 +++++++++---------- > 2 files changed, 23 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index afe2778d853..6796fca4180 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -320,7 +320,7 @@ > <input type="hidden" name="add" value="1" /> > [% END %] > >- <fieldset class="rows"> >+ <fieldset class="rows page-section"> > <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" /> > [% IF independant_branch %] > <input type="hidden" name="branchcode" value="[% independant_branch | html %]" /> >@@ -483,6 +483,9 @@ > [% WRAPPER tab_panels %] > [% FOREACH lang IN letters.keys %] > [% WRAPPER tab_panel tabname="lang_${lang}" %] >+ [% IF lang == 'default' %] >+ <p><span class="label">Default language:</span> [% default_language | html %]</p> >+ [% END %] > [% PROCESS message_templates %] > [% END # /WRAPPER tab_panel %] > [% END # /FOREACH lang %] >@@ -490,9 +493,14 @@ > [% END # /WRAPPER tabs#tabs %] > [% ELSE %] > <div style="clear:both"></div> >+ <div class="page-section"> > [% FOREACH lang IN letters.keys %] >+ [% IF lang == 'default' %] >+ <p><span class="label">Default language:</span> [% default_language | html %]</p> >+ [% END %] > [% PROCESS message_templates %] > [% END # /FOREACH lang %] >+ </div> > [% END # /IF TranslateNotices %] > > <input type="hidden" id="redirect" name="redirect" value="" /> >diff --git a/tools/letter.pl b/tools/letter.pl >index 0ecab147b0e..2564da115d4 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -162,33 +162,32 @@ sub add_form { > my $templates = { map { $_ => { message_transport_type => $_ } } sort @$message_transport_types }; > my %letters = ( default => { templates => $templates } ); > >+ my $translated_languages = C4::Languages::getTranslatedLanguages( >+ 'opac', >+ C4::Context->preference('template') >+ ); > if ( C4::Context->preference('TranslateNotices') ) { >- my $translated_languages = >- C4::Languages::getTranslatedLanguages( 'opac', >- C4::Context->preference('template') ); > for my $language (@$translated_languages) { >- for my $sublanguage( @{ $language->{sublanguages_loop} } ) { >+ for my $sublanguage ( @{ $language->{sublanguages_loop} } ) { > if ( $language->{plural} ) { > $letters{ $sublanguage->{rfc4646_subtag} } = { >- description => $sublanguage->{native_description} >- . ' ' >- . $sublanguage->{region_description} . ' (' >- . $sublanguage->{rfc4646_subtag} . ')', >- templates => { %$templates }, >+ description => $sublanguage->{native_description} . ' ' >+ . $sublanguage->{region_description} . ' (' >+ . $sublanguage->{rfc4646_subtag} . ')', >+ templates => {%$templates}, > }; >- } >- else { >+ } else { > $letters{ $sublanguage->{rfc4646_subtag} } = { >- description => $sublanguage->{native_description} >- . ' (' >- . $sublanguage->{rfc4646_subtag} . ')', >- templates => { %$templates }, >+ description => $sublanguage->{native_description} . ' (' . $sublanguage->{rfc4646_subtag} . ')', >+ templates => {%$templates}, > }; > } > } > } > $template->param( languages => $translated_languages ); > } >+ my $default_language = @{ @{$translated_languages}[0]->{sublanguages_loop} }[0]->{native_description}; >+ $template->param( default_language => $default_language ); > if ($letters) { > $template->param( > modify => 1, >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33237
:
148281
|
148785
|
163952
|
163953
|
164521
|
165382
|
165383
|
165384
|
165404
|
165405
|
165406
|
165455
|
165456
|
165457
|
165458
|
165459
|
165460
|
165473
|
165474
|
165475
|
165476
|
165477
| 165478 |
165479
|
165480
|
166860