Merged i10n branch

pull/941/head
Piero Toffanin 2020-12-14 12:43:16 -05:00
rodzic 0abdb7e64d
commit b075f24baa
9 zmienionych plików z 424 dodań i 4 usunięć

Wyświetl plik

@ -18,7 +18,7 @@ RUN wget --no-check-certificate https://deb.nodesource.com/setup_12.x -O /tmp/no
RUN apt-get -qq update && apt-get -qq install -y nodejs
# Install Python3, GDAL, nginx, letsencrypt, psql
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel git g++ python3-dev libpq-dev binutils libproj-dev gdal-bin python3-gdal nginx certbot grass-core gettext-base cron postgresql-client-10
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel git g++ python3-dev libpq-dev binutils libproj-dev gdal-bin python3-gdal nginx certbot grass-core gettext-base cron postgresql-client-10 gettext
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
RUN ln -s /usr/bin/pip3 /usr/bin/pip && pip install -U pip

4
I10n.toml 100644
Wyświetl plik

@ -0,0 +1,4 @@
[[paths]]
l10n = "locale/{locale}/LC_MESSAGES/**"
reference = "locale/*.pot"

177
locale/django.pot 100644
Wyświetl plik

@ -0,0 +1,177 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-20 20:31+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: app/templates/app/dashboard.html:15 app/templates/app/dashboard.html:29
#: app/templates/app/welcome.html:227
msgid "Welcome! ☺"
msgstr ""
#: app/templates/app/dashboard.html:16
msgid "Add a Processing Node"
msgstr ""
#: app/templates/app/dashboard.html:19
#, python-format
msgid ""
" \n"
"\t\t\t\tTo get started, \"%(add_processing_node)s\". A processing node is a "
"computer running an instance of %(nodeodm_link)s or some other software that "
"implements this %(api_link)s.\n"
"\t\t\t"
msgstr ""
#: app/templates/app/dashboard.html:30
msgid "Select Images and GCP"
msgstr ""
#: app/templates/app/dashboard.html:32
#, python-format
msgid ""
" To create a map, press the \"%(upload_images)s\" button, or drag and drop "
"some images into a project. "
msgstr ""
#: app/templates/app/dashboard.html:36
msgid "You need at least 5 images"
msgstr ""
#: app/templates/app/dashboard.html:37
#, python-format
msgid "Images must overlap by 65%% or more"
msgstr ""
#: app/templates/app/dashboard.html:38
#, python-format
msgid "For great 3D, images must overlap by 83%%"
msgstr ""
#: app/templates/app/dashboard.html:39
msgid ""
"A <a href=\"https://github.com/OpenDroneMap/OpenDroneMap/wiki/Running-"
"OpenDroneMap#running-odm-with-ground-control\" target=\"_blank\">GCP file</"
"a> is optional, but can increase georeferencing accuracy"
msgstr ""
#: app/templates/app/logged_in_base.html:197
msgid "Hello"
msgstr ""
#: app/templates/app/logged_in_base.html:201
msgid "Logout"
msgstr ""
#: app/templates/app/logged_in_base.html:224
msgid "Dashboard"
msgstr ""
#: app/templates/app/logged_in_base.html:273
msgid "Administration"
msgstr ""
#: app/templates/app/logged_in_base.html:276
msgid "Accounts"
msgstr ""
#: app/templates/app/logged_in_base.html:279
msgid "Groups"
msgstr ""
#: app/templates/app/logged_in_base.html:282
msgid "Brand"
msgstr ""
#: app/templates/app/logged_in_base.html:285
msgid "Theme"
msgstr ""
#: app/templates/app/logged_in_base.html:288
msgid "Plugins"
msgstr ""
#: app/templates/app/logged_in_base.html:291
msgid "Application"
msgstr ""
#: app/templates/app/processing_node.html:11
msgid "Hostname"
msgstr ""
#: app/templates/app/processing_node.html:15
msgid "Port"
msgstr ""
#: app/templates/app/processing_node.html:19
msgid "API Version"
msgstr ""
#: app/templates/app/processing_node.html:23
msgid "ODM Version"
msgstr ""
#: app/templates/app/processing_node.html:27
msgid "Queue Count"
msgstr ""
#: app/templates/app/processing_node.html:31
msgid "Max Images Limit"
msgstr ""
#: app/templates/app/processing_node.html:35
msgid "Label"
msgstr ""
#: app/templates/app/processing_node.html:39
msgid "Last Refreshed"
msgstr ""
#: app/templates/app/processing_node.html:40
msgid "ago"
msgstr ""
#: app/templates/app/processing_node.html:43
msgid "Options (JSON)"
msgstr ""
#: app/templates/app/processing_node.html:49
msgid "Edit"
msgstr ""
#: app/templates/app/processing_node.html:50
msgid "Delete"
msgstr ""
#: app/templates/app/welcome.html:224
msgid "Uh oh! Could you please check the errors below?"
msgstr ""
#: app/templates/app/welcome.html:237
msgid "Create Account"
msgstr ""
#: app/views/app.py:33
msgid "First Project"
msgstr ""
#: app/views/app.py:43 app/views/public.py:25
msgid "Map"
msgstr ""
#: app/views/app.py:70
msgid "3D Model Display"
msgstr ""

Wyświetl plik

@ -0,0 +1,26 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-20 20:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: plugins/lightning/public/Dashboard.jsx:38
msgid "Loading dashboard..."
msgstr ""
#: plugins/lightning/public/Dashboard.jsx:150
msgid "Logout"
msgstr ""

Wyświetl plik

@ -0,0 +1,178 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-20 20:31+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: app/templates/app/dashboard.html:15 app/templates/app/dashboard.html:29
#: app/templates/app/welcome.html:227
msgid "Welcome! ☺"
msgstr ""
#: app/templates/app/dashboard.html:16
msgid "Add a Processing Node"
msgstr ""
#: app/templates/app/dashboard.html:19
#, python-format
msgid ""
" \n"
"\t\t\t\tTo get started, \"%(add_processing_node)s\". A processing node is a "
"computer running an instance of %(nodeodm_link)s or some other software that "
"implements this %(api_link)s.\n"
"\t\t\t"
msgstr ""
#: app/templates/app/dashboard.html:30
msgid "Select Images and GCP"
msgstr ""
#: app/templates/app/dashboard.html:32
#, python-format
msgid ""
" To create a map, press the \"%(upload_images)s\" button, or drag and drop "
"some images into a project. "
msgstr ""
#: app/templates/app/dashboard.html:36
msgid "You need at least 5 images"
msgstr ""
#: app/templates/app/dashboard.html:37
#, python-format
msgid "Images must overlap by 65%% or more"
msgstr ""
#: app/templates/app/dashboard.html:38
#, python-format
msgid "For great 3D, images must overlap by 83%%"
msgstr ""
#: app/templates/app/dashboard.html:39
msgid ""
"A <a href=\"https://github.com/OpenDroneMap/OpenDroneMap/wiki/Running-"
"OpenDroneMap#running-odm-with-ground-control\" target=\"_blank\">GCP file</"
"a> is optional, but can increase georeferencing accuracy"
msgstr ""
#: app/templates/app/logged_in_base.html:197
msgid "Hello"
msgstr ""
#: app/templates/app/logged_in_base.html:201
msgid "Logout"
msgstr ""
#: app/templates/app/logged_in_base.html:224
msgid "Dashboard"
msgstr ""
#: app/templates/app/logged_in_base.html:273
msgid "Administration"
msgstr ""
#: app/templates/app/logged_in_base.html:276
msgid "Accounts"
msgstr ""
#: app/templates/app/logged_in_base.html:279
msgid "Groups"
msgstr ""
#: app/templates/app/logged_in_base.html:282
msgid "Brand"
msgstr ""
#: app/templates/app/logged_in_base.html:285
msgid "Theme"
msgstr ""
#: app/templates/app/logged_in_base.html:288
msgid "Plugins"
msgstr ""
#: app/templates/app/logged_in_base.html:291
msgid "Application"
msgstr ""
#: app/templates/app/processing_node.html:11
msgid "Hostname"
msgstr ""
#: app/templates/app/processing_node.html:15
msgid "Port"
msgstr ""
#: app/templates/app/processing_node.html:19
msgid "API Version"
msgstr ""
#: app/templates/app/processing_node.html:23
msgid "ODM Version"
msgstr ""
#: app/templates/app/processing_node.html:27
msgid "Queue Count"
msgstr ""
#: app/templates/app/processing_node.html:31
msgid "Max Images Limit"
msgstr ""
#: app/templates/app/processing_node.html:35
msgid "Label"
msgstr ""
#: app/templates/app/processing_node.html:39
msgid "Last Refreshed"
msgstr ""
#: app/templates/app/processing_node.html:40
msgid "ago"
msgstr ""
#: app/templates/app/processing_node.html:43
msgid "Options (JSON)"
msgstr ""
#: app/templates/app/processing_node.html:49
msgid "Edit"
msgstr ""
#: app/templates/app/processing_node.html:50
msgid "Delete"
msgstr ""
#: app/templates/app/welcome.html:224
msgid "Uh oh! Could you please check the errors below?"
msgstr ""
#: app/templates/app/welcome.html:237
msgid "Create Account"
msgstr ""
#: app/views/app.py:33
msgid "First Project"
msgstr ""
#: app/views/app.py:43 app/views/public.py:25
msgid "Map"
msgstr ""
#: app/views/app.py:70
msgid "3D Model Display"
msgstr ""

Wyświetl plik

@ -0,0 +1,27 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-20 20:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: plugins/lightning/public/Dashboard.jsx:38
msgid "Loading dashboard..."
msgstr ""
#: plugins/lightning/public/Dashboard.jsx:150
msgid "Logout"
msgstr ""

Wyświetl plik

@ -3,6 +3,7 @@ import ErrorMessage from 'webodm/components/ErrorMessage';
import PropTypes from 'prop-types';
import './Dashboard.scss';
import $ from 'jquery';
import _ from 'gettext';
export default class Dashboard extends React.Component {
static defaultProps = {
@ -34,7 +35,7 @@ export default class Dashboard extends React.Component {
}
loadDashboard = () => {
this.setState({loading: true, loadingMessage: "Loading dashboard..."});
this.setState({loading: true, loadingMessage: _("Loading dashboard...")});
$.get(this.apiUrl('/r/user')).done(json => {
if (json.balance !== undefined){
@ -154,7 +155,7 @@ export default class Dashboard extends React.Component {
<div className="buttons text-right">
<hr/>
<button className="btn btn-sm btn-primary logout" onClick={this.handeLogout}>
<i className="fa fa-power-off"></i> Logout
<i className="fa fa-power-off"></i> {_("Logout")}
</button>
</div>
</div> : ""}

6
translate.sh 100755
Wyświetl plik

@ -0,0 +1,6 @@
for lang in it
do
django-admin makemessages --keep-pot --locale=$lang --ignore=app/templates/app/admin/* --ignore=app/templates/app/registration/*
django-admin makemessages --keep-pot --locale=$lang -d djangojs --extension jsx
done
django-admin compilemessages

Wyświetl plik

@ -88,7 +88,8 @@ module.exports = {
"SystemJS": "SystemJS",
"THREE": "THREE",
"React": "React",
"ReactDOM": "ReactDOM"
"ReactDOM": "ReactDOM",
"gettext": "gettext"
},
watchOptions: {