Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fiat Tux
Hat softwares
Lutim
Commits
0d1ca8aa
Verified
Commit
0d1ca8aa
authored
Jun 24, 2018
by
Luc Didry
Committed by
Luc Didry
Jul 29, 2018
Browse files
[i18n] Use ISO::639_1
This commit is dedicated to Schoumi, who is supporting me on Tipeee. Many thanks :-)
parent
fbe3c3bc
Changes
6
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
0d1ca8aa
...
...
@@ -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
...
...
cpanfile
View file @
0d1ca8aa
...
...
@@ -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';
...
...
cpanfile.snapshot
View file @
0d1ca8aa
...
...
@@ -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:
...
...
lib/Lutim/Plugin/Helpers.pm
View file @
0d1ca8aa
...
...
@@ -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
;
themes/default/lib/Lutim/I18N/lutim.pot
View file @
0d1ca8aa
...
...
@@ -44,7 +44,7 @@ msgstr ""
msgid ": Error while trying to get the counter."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
7
9
#: themes/default/templates/partial/navbar.html.ep:
6
9
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:
8
2
#: themes/default/templates/partial/navbar.html.ep:
7
2
msgid "Fork me!"
msgstr ""
...
...
@@ -208,15 +208,15 @@ msgstr ""
msgid "Image not found."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
7
1
#: themes/default/templates/partial/navbar.html.ep:
6
1
msgid "Informations"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
3
5
#: themes/default/templates/partial/navbar.html.ep:
2
5
msgid "Install webapp"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
3
1
#: themes/default/templates/partial/navbar.html.ep:
2
1
msgid "Instance's statistics"
msgstr ""
...
...
@@ -236,7 +236,7 @@ msgstr ""
msgid "Keep EXIF tags"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
4
2
#: themes/default/templates/partial/navbar.html.ep:
3
2
msgid "Language"
msgstr ""
...
...
@@ -244,7 +244,7 @@ msgstr ""
msgid "Let's go!"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
7
6
#: themes/default/templates/partial/navbar.html.ep:
6
6
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:
2
8
#: themes/default/templates/myfiles.html.ep:2 themes/default/templates/partial/navbar.html.ep:
1
8
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:
5
4
#: themes/default/templates/partial/navbar.html.ep:
4
4
msgid "Support the author"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
6
2
#: themes/default/templates/partial/navbar.html.ep:
5
2
msgid "Support the author on Liberapay"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
5
9
#: themes/default/templates/partial/navbar.html.ep:
4
9
msgid "Support the author on Tipeee"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
6
5
#: themes/default/templates/partial/navbar.html.ep:
5
5
msgid "Support the author with bitcoins"
msgstr ""
...
...
@@ -409,7 +409,7 @@ msgstr ""
msgid "Toggle fullscreen"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
1
8
#: 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:8
4
#: 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:8
7
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:2
17
#: lib/Lutim/Plugin/Helpers.pm:2
20
msgid "Uploading is currently disabled, please try later or contact the administrator (%1)."
msgstr ""
...
...
themes/default/templates/partial/navbar.html.ep
View file @
0d1ca8aa
% # 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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment