Verified Commit fc9da640 authored by Luc Didry's avatar Luc Didry

[i18n] Use ISO::639_1

This commit is dedicated to Schoumi, who is supporting me on Tipeee.
Many thanks :-)
parent f7d5094c
Pipeline #59309 passed with stages
in 5 minutes and 55 seconds
......@@ -11,6 +11,7 @@ Revision history for Lutim
- Add X-Content-Type-Options, X-XSS-Protection, X-Frame-Options headers
- Remove @framasky as default tweet_card_via setting
- Add a message saying how many images there is in the gallery
- Use ISO::639_1 for languages' native names
0.10.4 2018-05-07
- Fix bug in cache system that would allow someone to view an image with an incorrect decryption key
......
......@@ -23,6 +23,7 @@ requires 'Image::ExifTool';
requires 'Data::Entropy';
requires 'List::MoreUtils', '> 0.33';
requires 'Archive::Zip';
requires 'ISO::639_1';
feature 'postgresql', 'PostgreSQL support' => sub {
requires 'Mojo::Pg';
......
......@@ -1343,6 +1343,13 @@ DISTRIBUTIONS
re 0
strict 0
warnings 0
ISO-639_1-0.01
pathname: L/LD/LDIDRY/ISO-639_1-0.01.tar.gz
provides:
ISO::639_1 0.01
requirements:
Module::Build::Tiny 0.035
perl 5.008001
Image-ExifTool-10.80
pathname: E/EX/EXIFTOOL/Image-ExifTool-10.80.tar.gz
provides:
......
......@@ -6,6 +6,8 @@ use Mojo::File;
use Crypt::CBC;
use Data::Entropy qw(entropy_source);
use DateTime;
use Mojo::Util qw(decode);
use ISO::639_1;
sub register {
my ($self, $app) = @_;
......@@ -37,17 +39,18 @@ sub register {
}
}
$app->helper(render_file => \&_render_file);
$app->helper(ip => \&_ip);
$app->helper(provisioning => \&_provisioning);
$app->helper(shortener => \&_shortener);
$app->helper(stop_upload => \&_stop_upload);
$app->helper(max_delay => \&_max_delay);
$app->helper(default_delay => \&_default_delay);
$app->helper(is_selected => \&_is_selected);
$app->helper(crypt => \&_crypt);
$app->helper(decrypt => \&_decrypt);
$app->helper(delete_image => \&_delete_image);
$app->helper(render_file => \&_render_file);
$app->helper(ip => \&_ip);
$app->helper(provisioning => \&_provisioning);
$app->helper(shortener => \&_shortener);
$app->helper(stop_upload => \&_stop_upload);
$app->helper(max_delay => \&_max_delay);
$app->helper(default_delay => \&_default_delay);
$app->helper(is_selected => \&_is_selected);
$app->helper(crypt => \&_crypt);
$app->helper(decrypt => \&_decrypt);
$app->helper(delete_image => \&_delete_image);
$app->helper(iso639_native_name => \&_iso639_native_name);
}
sub _pg {
......@@ -313,4 +316,9 @@ sub _delete_image {
$img->disable();
}
sub _iso639_native_name {
my $c = shift;
return ucfirst(decode 'UTF-8', get_iso639_1(shift)->{nativeName});
}
1;
......@@ -44,7 +44,7 @@ msgstr ""
msgid ": Error while trying to get the counter."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:79
#: themes/default/templates/partial/navbar.html.ep:69
msgid "About"
msgstr ""
......@@ -160,7 +160,7 @@ msgstr ""
msgid "For more details, see the <a href=\"https://framagit.org/luc/lutim\">homepage of the project</a>."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:82
#: themes/default/templates/partial/navbar.html.ep:72
msgid "Fork me!"
msgstr ""
......@@ -208,15 +208,15 @@ msgstr ""
msgid "Image not found."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:71
#: themes/default/templates/partial/navbar.html.ep:61
msgid "Informations"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:35
#: themes/default/templates/partial/navbar.html.ep:25
msgid "Install webapp"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:31
#: themes/default/templates/partial/navbar.html.ep:21
msgid "Instance's statistics"
msgstr ""
......@@ -236,7 +236,7 @@ msgstr ""
msgid "Keep EXIF tags"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:42
#: themes/default/templates/partial/navbar.html.ep:32
msgid "Language"
msgstr ""
......@@ -244,7 +244,7 @@ msgstr ""
msgid "Let's go!"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:76
#: themes/default/templates/partial/navbar.html.ep:66
msgid "License:"
msgstr ""
......@@ -268,7 +268,7 @@ msgstr ""
msgid "Markdown syntax"
msgstr ""
#: themes/default/templates/myfiles.html.ep:2 themes/default/templates/partial/navbar.html.ep:28
#: themes/default/templates/myfiles.html.ep:2 themes/default/templates/partial/navbar.html.ep:18
msgid "My images"
msgstr ""
......@@ -322,19 +322,19 @@ msgstr ""
msgid "Something went wrong when creating the zip file. Try again later or contact the administrator (%1)."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:54
#: themes/default/templates/partial/navbar.html.ep:44
msgid "Support the author"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:62
#: themes/default/templates/partial/navbar.html.ep:52
msgid "Support the author on Liberapay"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:59
#: themes/default/templates/partial/navbar.html.ep:49
msgid "Support the author on Tipeee"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:65
#: themes/default/templates/partial/navbar.html.ep:55
msgid "Support the author with bitcoins"
msgstr ""
......@@ -409,7 +409,7 @@ msgstr ""
msgid "Toggle fullscreen"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:18
#: themes/default/templates/partial/navbar.html.ep:8
msgid "Toggle navigation"
msgstr ""
......@@ -430,7 +430,7 @@ msgstr ""
msgid "Unable to find the image %1."
msgstr ""
#: lib/Lutim/Controller.pm:572 lib/Lutim/Controller.pm:617 lib/Lutim/Controller.pm:656 lib/Lutim/Controller.pm:699 lib/Lutim/Controller.pm:711 lib/Lutim/Controller.pm:722 lib/Lutim/Controller.pm:749 lib/Lutim/Plugin/Helpers.pm:84
#: lib/Lutim/Controller.pm:572 lib/Lutim/Controller.pm:617 lib/Lutim/Controller.pm:656 lib/Lutim/Controller.pm:699 lib/Lutim/Controller.pm:711 lib/Lutim/Controller.pm:722 lib/Lutim/Controller.pm:749 lib/Lutim/Plugin/Helpers.pm:87
msgid "Unable to find the image: it has been deleted."
msgstr ""
......@@ -455,7 +455,7 @@ msgid "Uploaded files by days"
msgstr ""
#. ($c->app->config('contact')
#: lib/Lutim/Plugin/Helpers.pm:217
#: lib/Lutim/Plugin/Helpers.pm:220
msgid "Uploading is currently disabled, please try later or contact the administrator (%1)."
msgstr ""
......
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
% my $l = {
% ar => 'العربية',
% de => 'Deutsch',
% en => 'English',
% es => 'Español',
% fr => 'Français',
% fr_FR => 'Français (France)',
% oc => 'Occitan',
% ru => 'Русский',
% };
% my $lang = $self->languages;
% $lang =~ s/-(.*)/_\U$1/;
<nav class="navbar navbar-default">
......@@ -44,7 +34,7 @@
<ul class="dropdown-menu" role="menu">
% for my $i (@{$self->available_langs}) {
<li<%== ($i eq $lang) ? ' class="active"' : '' %>>
<a href="<%= url_for('lang', l => $i) %>" class="set-lang"><%= $l->{$i} %></a>
<a href="<%= url_for('lang', l => $i) %>" class="set-lang"><%= iso639_native_name($i) %></a>
</li>
% }
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment