From b075f24baa714a568dd8b5538fd12c26d9f1a998 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 14 Dec 2020 12:43:16 -0500 Subject: [PATCH] Merged i10n branch --- Dockerfile | 2 +- I10n.toml | 4 + locale/django.pot | 177 ++++++++++++++++++++++++ locale/djangojs.pot | 26 ++++ locale/it/LC_MESSAGES/django.po | 178 +++++++++++++++++++++++++ locale/it/LC_MESSAGES/djangojs.po | 27 ++++ plugins/lightning/public/Dashboard.jsx | 5 +- translate.sh | 6 + webpack.config.js | 3 +- 9 files changed, 424 insertions(+), 4 deletions(-) create mode 100644 I10n.toml create mode 100644 locale/django.pot create mode 100644 locale/djangojs.pot create mode 100644 locale/it/LC_MESSAGES/django.po create mode 100644 locale/it/LC_MESSAGES/djangojs.po create mode 100755 translate.sh diff --git a/Dockerfile b/Dockerfile index 265af96c..2aa1e077 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/I10n.toml b/I10n.toml new file mode 100644 index 00000000..5ccfbde5 --- /dev/null +++ b/I10n.toml @@ -0,0 +1,4 @@ +[[paths]] + l10n = "locale/{locale}/LC_MESSAGES/**" + reference = "locale/*.pot" + diff --git a/locale/django.pot b/locale/django.pot new file mode 100644 index 00000000..16624bba --- /dev/null +++ b/locale/django.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 GCP file 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 "" diff --git a/locale/djangojs.pot b/locale/djangojs.pot new file mode 100644 index 00000000..92b5fcc1 --- /dev/null +++ b/locale/djangojs.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/locale/it/LC_MESSAGES/django.po b/locale/it/LC_MESSAGES/django.po new file mode 100644 index 00000000..df64c743 --- /dev/null +++ b/locale/it/LC_MESSAGES/django.po @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 GCP file 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 "" diff --git a/locale/it/LC_MESSAGES/djangojs.po b/locale/it/LC_MESSAGES/djangojs.po new file mode 100644 index 00000000..26be9e28 --- /dev/null +++ b/locale/it/LC_MESSAGES/djangojs.po @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/plugins/lightning/public/Dashboard.jsx b/plugins/lightning/public/Dashboard.jsx index f8f1b9a5..8bf27f90 100644 --- a/plugins/lightning/public/Dashboard.jsx +++ b/plugins/lightning/public/Dashboard.jsx @@ -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 {

: ""} diff --git a/translate.sh b/translate.sh new file mode 100755 index 00000000..cb4c6b8a --- /dev/null +++ b/translate.sh @@ -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 diff --git a/webpack.config.js b/webpack.config.js index 2f0b5363..43fdf292 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -88,7 +88,8 @@ module.exports = { "SystemJS": "SystemJS", "THREE": "THREE", "React": "React", - "ReactDOM": "ReactDOM" + "ReactDOM": "ReactDOM", + "gettext": "gettext" }, watchOptions: {