Bugzilla – Attachment 165455 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: If TranslateNotices is off, use the interface language includes in slips
Bug-33237-If-TranslateNotices-is-off-use-the-inter.patch (text/plain), 3.55 KB, created by
Martin Renvoize (ashimema)
on 2024-04-24 13:46:55 UTC
(
hide
)
Description:
Bug 33237: If TranslateNotices is off, use the interface language includes in slips
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-24 13:46:55 UTC
Size:
3.55 KB
patch
obsolete
>From f3c8858db355fece769fe964d113436d154cad02 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Mon, 27 Mar 2023 21:05:29 +0000 >Subject: [PATCH] Bug 33237: If TranslateNotices is off, use the interface > language includes in slips > >This patch set the language used in slips folloinw this logic: > --> uses patron's preferred language > --> if patron's preferred language is 'default', use the interface language > --> if there is no interface (for overdue_notices for example), use the first language in 'language' system preference > >To Test: >1. Install the other language (i used fr-CA here) > 1.1. > > gulp po:update fr-CA > > ./misc/translator/translate install fr-CA > > 1.2. In Administration > Global system preferences, search for language and check the added language > >2. Create a manual invoice in a patron's account and pay it > >3. From the Transactions tab, click 'Print' next to the payment line > --> On the printed slip, there's the word 'Payment' in English (OK) > >4. Switch interface to other language > >5. Redo step 3 > --> On the printed slip, the word 'Payment' is still in English (not ok) > >6. In Administration > Global system preferences, enable TranslateNotices > >7. Go to Tools > Notices and slips > ACCOUNT_CREDIT and copy the content of the letter into all the languages > >8. Redo step 3 (you should still be in the other language interface) > --> On the printed slip, the word 'Payment' is still in English (not ok) > >9. Edit the patron's account and change the preferred language to the other language > >10. Redo step 3 > --> On the printed slip, the word 'Payment' is in the other language (Paiement) (OK) > >11. Apply the patch > >12. Reset config > 12.1. Edit the patron's account and change back the preferred language to 'default' > 12.2. In Administration > Global system preferences, disable TranslateNotices > >13. Redo step 3 (you should still be in the other language interface) > --> On the printed slip, the word 'Payment' is in the other language (Paiement) > >14. Switch interface to the english language > >15. Redo step 3 > --> On the printed slip, the word 'Payment' is in English > >16. In Administration > Global system preferences, enable TranslateNotices > >17. Edit the patron's account and change the preferred language to the other language > >18. Redo step 3 > --> On the printed slip, the word 'Payment' is in the other language (Paiement) > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Letters.pm | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index af5af484b1a..a00701f3d25 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1671,7 +1671,18 @@ sub _process_tt { > my $loops = $params->{loops}; > my $objects = $params->{objects} || {}; > my $substitute = $params->{substitute} || {}; >- my $lang = defined($params->{lang}) && $params->{lang} ne 'default' ? $params->{lang} : 'en'; >+ my $lang = 'en'; >+ my $interface = C4::Context->interface; >+ if(defined($params->{lang}) && $params->{lang} ne 'default'){ >+ $lang = $params->{lang}; >+ } elsif($interface eq 'intranet' || $interface eq 'opac') { >+ #use interface language >+ $lang = C4::Languages::getlanguage(); >+ } else { >+ # Pick the first selected syspref language >+ my @languages = split /,/, C4::Context->preference('language'); >+ $lang = shift @languages; >+ } > my ($theme, $availablethemes); > > my $htdocs = C4::Context->config('intrahtdocs'); >-- >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