Bugzilla – Attachment 39310 Details for
Bug 12017
Move language description out of database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12017 - 7 - Remove function getFrameworkLanguages
Bug-12017---7---Remove-function-getFrameworkLangua.patch (text/plain), 3.33 KB, created by
Bernardo Gonzalez Kriegel
on 2015-05-19 18:11:05 UTC
(
hide
)
Description:
Bug 12017 - 7 - Remove function getFrameworkLanguages
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-05-19 18:11:05 UTC
Size:
3.33 KB
patch
obsolete
>From deadc6eb082f7dc1ff48ef0bf2a5ccfcf1551bc9 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Sun, 27 Apr 2014 17:18:52 -0300 >Subject: [PATCH] Bug 12017 - 7 - Remove function getFrameworkLanguages > >[ Note: From now on dependence on language descriptions >in database is about to be removed, also some code >cleaning.] > >This must be an old relic, not used anymore. > >To test: >1. Check use of getFrameworkLanguages >egrep -Rl getFrameworkLanguages * > >No result save for definition file >2. Apply the patch >3. check again, no results > >Reason for removing this function is that it's not >used and tries to send languages descriptions from database >--- > C4/Languages.pm | 43 +------------------------------------------ > 1 file changed, 1 insertion(+), 42 deletions(-) > >diff --git a/C4/Languages.pm b/C4/Languages.pm >index c0a2c34..8fe21e6 100644 >--- a/C4/Languages.pm >+++ b/C4/Languages.pm >@@ -34,7 +34,6 @@ eval { > import Memoize::Memcached qw(memoize_memcached); > > memoize_memcached('getTranslatedLanguages', memcached => C4::Context->memcached); >- memoize_memcached('getFrameworkLanguages' , memcached => C4::Context->memcached); > memoize_memcached('getAllLanguages', memcached => C4::Context->memcached); > } > }; >@@ -44,12 +43,11 @@ BEGIN { > require Exporter; > @ISA = qw(Exporter); > @EXPORT = qw( >- &getFrameworkLanguages > &getTranslatedLanguages > &getLanguages > &getAllLanguages > ); >- @EXPORT_OK = qw(getSearchLanguages getLanguages_iso getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage); >+ @EXPORT_OK = qw(getSearchLanguages getLanguages_iso getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage); > $DEBUG = 0; > } > >@@ -67,45 +65,6 @@ use C4::Languages; > > =head1 FUNCTIONS > >-=head2 getFrameworkLanguages >- >-Returns a reference to an array of hashes: >- >- my $languages = getFrameworkLanguages(); >- for my $language(@$languages) { >- print "$language->{language_code}\n"; # language code in iso 639-2 >- print "$language->{language_name}\n"; # language name in native script >- print "$language->{language_locale_name}\n"; # language name in current locale >- } >- >-=cut >- >-sub getFrameworkLanguages { >- # get a hash with all language codes, names, and locale names >- my $all_languages = getAllLanguages(); >- my @languages; >- >- # find the available directory names >- my $dir=C4::Context->config('intranetdir')."/installer/data/"; >- opendir (MYDIR,$dir); >- my @listdir= grep { !/^\.|CVS/ && -d "$dir/$_"} readdir(MYDIR); >- closedir MYDIR; >- >- # pull out all data for the dir names that exist >- for my $dirname (@listdir) { >- for my $language_set (@$all_languages) { >- >- if ($dirname eq $language_set->{language_code}) { >- push @languages, { >- 'language_code'=>$dirname, >- 'language_description'=>$language_set->{language_description}, >- 'native_descrition'=>$language_set->{language_native_description} } >- } >- } >- } >- return \@languages; >-} >- > =head2 getSearchLanguages > > Get selection of languages codes and iso639_2. >-- >1.7.9.5
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 12017
:
26691
|
26694
|
26735
|
26736
|
26770
|
27687
|
27688
|
27689
|
27690
|
27691
|
27692
|
27693
|
27694
|
27695
|
27696
|
29898
|
29899
|
29900
|
29901
|
29902
|
29903
|
29904
|
29905
|
29906
|
29907
|
33337
|
33338
|
33339
|
33340
|
33341
|
33342
|
33343
|
33344
|
33345
|
33346
|
39304
|
39305
|
39306
|
39307
|
39308
|
39309
|
39310
|
39311
|
39312
|
39313
|
39644
|
39655
|
39656
|
39657
|
39658
|
39659
|
39660
|
39661
|
39662
|
39663
|
39664
|
39665
|
40285
|
40286
|
40287
|
40288
|
40289
|
40290
|
40291
|
40292
|
40293
|
40294
|
40295