#!perl -T
-use Test::More tests => 9;
+use Test::More tests => 11;
use_ok( 'OpenILS::WWW::BadDebt' );
use_ok( 'OpenILS::WWW::EGWeb' );
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' );
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.locale %]' xml:lang='[% ctx.locale %]'>
+<html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.eg_locale %]' xml:lang='[% ctx.eg_locale %]'>
<head>
<title>[% ctx.page_title %]</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.locale %]' xml:lang='[% ctx.locale %]'>
+<html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.eg_locale %]' xml:lang='[% ctx.eg_locale %]'>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/kpac/style.css[% ctx.cache_key %]" />
<!DOCTYPE html>
-<html lang='[% ctx.locale.replace('_', '-') %]'>
+<html lang='[% ctx.eg_locale %]'>
<head prefix="og: http://ogp.me/ns#">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!doctype html>
[%- PROCESS 'staff/config.tt2' %]
-<html lang="[% ctx.locale %]"
+<html lang="[% ctx.eg_locale %]"
[%- IF ctx.page_app %] ng-app="[% ctx.page_app %]"[% END -%]
[%- IF ctx.page_ctrl %] ng-controller="[% ctx.page_ctrl %]"[% END %]>
<head>