From b2f669fb161ff4bdba9ba2528241312d037503e6 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Mon, 29 Jul 2019 11:56:31 -0700 Subject: [PATCH] LP1802593: Correct formatting of language code in Angularjs, KPAC EgWeb offers two different formats of the current locale: ctx.locale and ctx.eg_locale. This commit configures the lang attribute in AngularJS staff client, OPAC, and KPAC to use eg_locale, since it has the appropriate format (e.g. en-US, fr-CA). Also adds some tests for EgWeb's handling of language codes. Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/t/15-OpenILS-WWW.t | 5 ++++- Open-ILS/src/templates/base.tt2 | 2 +- Open-ILS/src/templates/kpac/parts/base.tt2 | 2 +- Open-ILS/src/templates/opac/parts/base.tt2 | 2 +- Open-ILS/src/templates/staff/base.tt2 | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/t/15-OpenILS-WWW.t b/Open-ILS/src/perlmods/t/15-OpenILS-WWW.t index d55e809519..f78a4fa4a8 100644 --- a/Open-ILS/src/perlmods/t/15-OpenILS-WWW.t +++ b/Open-ILS/src/perlmods/t/15-OpenILS-WWW.t @@ -1,6 +1,6 @@ #!perl -T -use Test::More tests => 9; +use Test::More tests => 11; use_ok( 'OpenILS::WWW::BadDebt' ); use_ok( 'OpenILS::WWW::EGWeb' ); @@ -11,3 +11,6 @@ use_ok( 'OpenILS::WWW::Redirect' ); use_ok( 'OpenILS::WWW::TemplateBatchBibUpdate' ); use_ok( 'OpenILS::WWW::Vandelay' ); use_ok( 'OpenILS::WWW::XMLRPCGateway' ); + +is( OpenILS::WWW::EGWeb::parse_eg_locale('hy_am'), 'hy-AM', 'correctly formatted Armenian language code' ); +is( OpenILS::WWW::EGWeb::parse_eg_locale(), 'en-US', 'correctly formatted default language code' ); diff --git a/Open-ILS/src/templates/base.tt2 b/Open-ILS/src/templates/base.tt2 index a6f4b8c8bb..ee988bb312 100644 --- a/Open-ILS/src/templates/base.tt2 +++ b/Open-ILS/src/templates/base.tt2 @@ -1,5 +1,5 @@ - + [% ctx.page_title %] diff --git a/Open-ILS/src/templates/kpac/parts/base.tt2 b/Open-ILS/src/templates/kpac/parts/base.tt2 index 94364c643b..4711c3f73a 100644 --- a/Open-ILS/src/templates/kpac/parts/base.tt2 +++ b/Open-ILS/src/templates/kpac/parts/base.tt2 @@ -1,5 +1,5 @@ - + diff --git a/Open-ILS/src/templates/opac/parts/base.tt2 b/Open-ILS/src/templates/opac/parts/base.tt2 index aa12e39ebe..b28f45ceb8 100644 --- a/Open-ILS/src/templates/opac/parts/base.tt2 +++ b/Open-ILS/src/templates/opac/parts/base.tt2 @@ -1,5 +1,5 @@ - + diff --git a/Open-ILS/src/templates/staff/base.tt2 b/Open-ILS/src/templates/staff/base.tt2 index 7ce42ae73f..78b393b37f 100644 --- a/Open-ILS/src/templates/staff/base.tt2 +++ b/Open-ILS/src/templates/staff/base.tt2 @@ -1,6 +1,6 @@ [%- PROCESS 'staff/config.tt2' %] - -- 2.43.2