diff options
author | Yorhel <git@yorhel.nl> | 2016-01-16 09:49:06 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2016-01-16 09:50:20 +0100 |
commit | ca1a9c48c24a436babd30ad9e315db2781364879 (patch) | |
tree | 76061fd02d94e55e71b11d5115d8327df53119cb /util | |
parent | 0f9b6a13621adfe7d7410bfecab86ab2ee85877c (diff) |
L10N: Remove all translations
TODO: Intern strings again to simplify the code.
The immediate effect of this commit is that starting the util/vndb.pl
script and generating the JS file is much faster now and that vndb.pl
uses less memory. Translations have already been disabled on the main
VNDB for a week now.
Diffstat (limited to 'util')
-rwxr-xr-x | util/vndb.pl | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/util/vndb.pl b/util/vndb.pl index 99f15367..fb01e132 100755 --- a/util/vndb.pl +++ b/util/vndb.pl @@ -68,36 +68,8 @@ sub reqinit { # check authentication cookies $self->authInit; - # Determine language - my $cookie = $self->reqCookie('l10n'); - $cookie = '' if !$cookie || !grep $_ eq $cookie, VNDB::L10N::languages; - my $handle = VNDB::L10N->get_handle(); # falls back to English - my $browser = $handle->language_tag(); - my $rmcookie = 0; - - # when logged in, the setting is kept in the DB even if it's the same as what - # the browser requests. This is to ensure a user gets the same language even - # when switching PCs - if($self->authInfo->{id}) { - my $db = $self->authPref('l10n'); - if($db && !grep $_ eq $db, VNDB::L10N::languages) { - $self->authPref(l10n => undef); - $db = ''; - } - $rmcookie = 1 if $cookie; - if(!$db && $cookie && $cookie ne $browser) { - $self->authPref(l10n => $cookie); - $db = $cookie; - } - $handle = VNDB::L10N->get_handle($db) if $db && $db ne $browser; - } - - else { - $rmcookie = 1 if $cookie && $cookie eq $browser; - $handle = VNDB::L10N->get_handle($cookie) if $cookie && $browser ne $cookie; - } - $self->resCookie(l10n => undef) if $rmcookie; - $self->{l10n} = $handle; + # Set language to English + $self->{l10n} = VNDB::L10N->get_handle('en'); # load some stats (used for about all pageviews, anyway) $self->{stats} = $self->dbStats; |