Bugzilla – Attachment 105276 Details for
Bug 25517
Koha.mo not found on package installations / Translations not working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25517: Look in all possible places for MO files
Bug-25517-Look-in-all-possible-places-for-MO-files.patch (text/plain), 1.72 KB, created by
Katrin Fischer
on 2020-05-22 19:14:19 UTC
(
hide
)
Description:
Bug 25517: Look in all possible places for MO files
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-05-22 19:14:19 UTC
Size:
1.72 KB
patch
obsolete
>From 43f4738f038c35c132339ca8a99b4349568f2e3b Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 22 May 2020 16:45:02 +0200 >Subject: [PATCH] Bug 25517: Look in all possible places for MO files > >On a 'dev' install, MO files will be installed in ><intranetdir>/misc/translator/po >On 'standard' and 'single' installs, they will be installed in ><intranetdir>/../../misc/translator/po > >This patch makes Koha::I18N try to use the "dev" directory first, and >fallback to the "standard" directory. >If none of these directories exist, it dies. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/I18N.pm | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/Koha/I18N.pm b/Koha/I18N.pm >index 72062239d8..ca0ceae0c9 100644 >--- a/Koha/I18N.pm >+++ b/Koha/I18N.pm >@@ -24,6 +24,7 @@ use C4::Languages; > use C4::Context; > > use Encode; >+use List::Util qw( first ); > use Locale::Messages qw(:locale_h LC_MESSAGES); > use POSIX qw( setlocale ); > use Koha::Cache::Memory::Lite; >@@ -176,7 +177,20 @@ sub N__np { > } > > sub _base_directory { >- return C4::Context->config('intranetdir') . '/misc/translator/po'; >+ # Directory structure is not the same for dev and standard installs >+ # Here we test the existence of several directories and use the first that exist >+ # FIXME There has to be a better solution >+ my @dirs = ( >+ C4::Context->config('intranetdir') . '/misc/translator/po', >+ C4::Context->config('intranetdir') . '/../../misc/translator/po', >+ ); >+ my $dir = first { -d } @dirs; >+ >+ unless ($dir) { >+ die "The PO directory has not been found. There is a problem in your Koha installation."; >+ } >+ >+ return $dir; > } > > sub _gettext { >-- >2.11.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 25517
:
105270
| 105276