aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--META.yml45
-rw-r--r--lib/CatDap/Controller/register.pm31
-rw-r--r--lib/CatDap/I18N/.tx/config8
-rwxr-xr-x[-rw-r--r--]lib/CatDap/I18N/ro.po0
-rw-r--r--root/template/layout2
5 files changed, 51 insertions, 35 deletions
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..d6f2695
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,45 @@
+---
+abstract: 'Catalyst based application'
+author:
+ - 'Buchan Milne'
+build_requires:
+ ExtUtils::MakeMaker: 6.42
+ Test::More: 0.88
+configure_requires:
+ ExtUtils::MakeMaker: 6.42
+distribution_type: module
+generated_by: 'Module::Install version 0.95'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: CatDap
+no_index:
+ directory:
+ - inc
+ - t
+requires:
+ Catalyst::Action::RenderView: 0
+ Catalyst::Model::LDAP::FromAuthentication: 0
+ Catalyst::Plugin::Authentication: 0
+ Catalyst::Plugin::Authentication::Store::LDAP: 0
+ Catalyst::Plugin::Captcha: 0
+ Catalyst::Plugin::ConfigLoader: 0
+ Catalyst::Plugin::I18N: 0
+ Catalyst::Plugin::Session::State::Cookie: 0
+ Catalyst::Plugin::Session::Store::File: 0
+ Catalyst::Plugin::Static::Simple: 0
+ Catalyst::Runtime: 5.80022
+ Catalyst::View::Email: 0
+ Catalyst::View::TT: 0
+ Config::General: 0
+ Crypt::CBC: 0
+ Crypt::Blowfish: 0
+ Data::UUID: 0
+ Email::Valid: 0
+ FCGI: 0
+ Moose: 0
+ namespace::autoclean: 0
+resources:
+ license: http://dev.perl.org/licenses/
+version: 0.01
diff --git a/lib/CatDap/Controller/register.pm b/lib/CatDap/Controller/register.pm
index 889aabe..c53881d 100644
--- a/lib/CatDap/Controller/register.pm
+++ b/lib/CatDap/Controller/register.pm
@@ -25,7 +25,8 @@ Catalyst Controller.
sub index :Path :Args(0) : Form {
my ( $self, $c ) = @_;
- my $lang = choose_language($c);
+ my $langs = join ',',@{$c->languages};
+ $c->log->debug("Languages: $langs, default: " . $c->language . ", saving: " . ${$c->languages}[0]);
#my $form = Catalyst::Controller::HTML::FormFu->form();
#$c->response->body('Matched CatDap::Controller::register in register.');
@@ -113,8 +114,8 @@ sub check : Local {
my $ug = Data::UUID->new;
my $password = $ug->create_str();
my $cn = $c->request->params->{gn} . " " . $c->request->params->{sn};
- my $lang = choose_language($c);
$c->log->info("Creating account for user $username");
+ $c->log->debug("Preferred language: " . ${$c->languages}[0]);
$mesg = $c->model('Proxy')->add($dn,
attr => [
objectclass => [ 'inetOrgPerson' ],
@@ -124,7 +125,7 @@ sub check : Local {
mail => $email,
pwdReset => 'TRUE',
userPassword => $password,
- preferredLanguage => $lang,
+ preferredLanguage => ${$c->languages}[0],
]
);
if ($mesg->code) {
@@ -162,29 +163,7 @@ sub captcha : Local {
return $c->create_captcha();
}
-sub choose_language : Private {
- my $c = shift;
- my $langs = join ',',@{$c->languages};
- # FIXME heuristic for correcting languages, we may want a different strategy
- # in future in conjunction with server-side constraints with slapo-constraint.
- # E.g. we could have a languages container with mapping from browser locale
- # codes (preferredLanguage, which is multi-valued), to a single value
- # (e.g. mageiaselectedLanguage, or similar). Then use a uri-based constraint on
- # with mageiaSelectedLanguage as the attribute
- # Also to be considered, pushing all the languages to preferredLanguage, but
- # then do we use ordering?
- my $lang = ${$c->languages}[0];
- if ($lang !~ /^\w\w\w?(-\w+)?$/) {
- $lang = 'en';
- }
- # Partial list of lang-variant locales where localisation is different
- if ($lang !~ /^(en-gb|en-us|pt-br|no-\w+|zh-\w+)$/) {
- $lang =~ s/^(\w+)-\w+$/$1/;
- }
- $c->log->debug("Browser languages: $langs,using preferred language: $lang");
- $c->log->debug("Selected language $lang not default " . $c->language) if $lang ne $c->language;
- return $lang;
-}
+
=head1 AUTHOR
diff --git a/lib/CatDap/I18N/.tx/config b/lib/CatDap/I18N/.tx/config
deleted file mode 100644
index 73fe3eb..0000000
--- a/lib/CatDap/I18N/.tx/config
+++ /dev/null
@@ -1,8 +0,0 @@
-[main]
-host = https://www.transifex.com
-
-[mageia.identity-catdap]
-file_filter = <lang>.po
-source_file = messages.pot
-source_lang = en
-type = PO
diff --git a/lib/CatDap/I18N/ro.po b/lib/CatDap/I18N/ro.po
index 460abc8..460abc8 100644..100755
--- a/lib/CatDap/I18N/ro.po
+++ b/lib/CatDap/I18N/ro.po
diff --git a/root/template/layout b/root/template/layout
index d92b0c7..201e4e9 100644
--- a/root/template/layout
+++ b/root/template/layout
@@ -1,6 +1,6 @@
<div id="doc" class="yui-t7">
<div id="bd" role="main">
- <div class="yui-g">
+ <div class="vnav">
<ul id="nav">
[% FOREACH subpage IN subpages %]
<li><a href="[% c.uri_for(subpage.page) %]">[% l(subpage.title) %]</a></li>