kopia lustrzana https://github.com/OpenDroneMap/WebODM
PoC translation for both JSX components and Django
rodzic
b075f24baa
commit
11ee54245d
|
@ -84,7 +84,8 @@ module.exports = {
|
||||||
"PluginsAPI": "PluginsAPI",
|
"PluginsAPI": "PluginsAPI",
|
||||||
"leaflet": "leaflet",
|
"leaflet": "leaflet",
|
||||||
"ReactDOM": "ReactDOM",
|
"ReactDOM": "ReactDOM",
|
||||||
"React": "React"
|
"React": "React",
|
||||||
|
"gettext": "gettext"
|
||||||
},
|
},
|
||||||
|
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
|
|
|
@ -24,6 +24,7 @@ if (!window.PluginsAPI){
|
||||||
'leaflet': { loader: 'globals-loader', exports: 'L' },
|
'leaflet': { loader: 'globals-loader', exports: 'L' },
|
||||||
'ReactDOM': { loader: 'globals-loader', exports: 'ReactDOM' },
|
'ReactDOM': { loader: 'globals-loader', exports: 'ReactDOM' },
|
||||||
'React': { loader: 'globals-loader', exports: 'React' },
|
'React': { loader: 'globals-loader', exports: 'React' },
|
||||||
|
'gettext': { loader: 'globals-loader', exports: 'gettext' },
|
||||||
'SystemJS': { loader: 'globals-loader', exports: 'SystemJS' }
|
'SystemJS': { loader: 'globals-loader', exports: 'SystemJS' }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
<script src="{% static 'app/js/vendor/es6-shim.min.js' %}"></script>
|
<script src="{% static 'app/js/vendor/es6-shim.min.js' %}"></script>
|
||||||
<script src="{% static 'app/js/vendor/jquery-1.11.2.min.js' %}"></script>
|
<script src="{% static 'app/js/vendor/jquery-1.11.2.min.js' %}"></script>
|
||||||
<script src="{% static 'app/js/vendor/system.js' %}"></script>
|
<script src="{% static 'app/js/vendor/system.js' %}"></script>
|
||||||
|
<script src="{% url 'javascript-catalog' %}"></script>
|
||||||
|
|
||||||
{% block headers-before-bundle %}{% endblock %}
|
{% block headers-before-bundle %}{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
|
from django.views.i18n import JavaScriptCatalog
|
||||||
|
|
||||||
from .views import app as app_views, public as public_views
|
from .views import app as app_views, public as public_views
|
||||||
from .plugins.views import app_view_handler
|
from .plugins.views import app_view_handler
|
||||||
|
@ -36,7 +37,10 @@ urlpatterns = [
|
||||||
|
|
||||||
url(r'^api/', include("app.api.urls")),
|
url(r'^api/', include("app.api.urls")),
|
||||||
|
|
||||||
url(r'^plugins/(?P<plugin_name>[^/.]+)/(.*)$', app_view_handler)
|
url(r'^plugins/(?P<plugin_name>[^/.]+)/(.*)$', app_view_handler),
|
||||||
|
|
||||||
|
# TODO: add caching: https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#note-on-performance
|
||||||
|
url(r'^jsi18n/', JavaScriptCatalog.as_view(packages=['app']), name='javascript-catalog'),
|
||||||
]
|
]
|
||||||
|
|
||||||
handler404 = app_views.handler404
|
handler404 = app_views.handler404
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2019-04-20 20:31+0000\n"
|
"POT-Creation-Date: 2020-12-14 18:40+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -68,43 +68,43 @@ msgid ""
|
||||||
"a> is optional, but can increase georeferencing accuracy"
|
"a> is optional, but can increase georeferencing accuracy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:197
|
#: app/templates/app/logged_in_base.html:15
|
||||||
msgid "Hello"
|
msgid "Hello"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:201
|
#: app/templates/app/logged_in_base.html:19
|
||||||
msgid "Logout"
|
msgid "Logout"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:224
|
#: app/templates/app/logged_in_base.html:33
|
||||||
msgid "Dashboard"
|
msgid "Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:273
|
#: app/templates/app/logged_in_base.html:79
|
||||||
msgid "Administration"
|
msgid "Administration"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:276
|
#: app/templates/app/logged_in_base.html:84
|
||||||
msgid "Accounts"
|
msgid "Accounts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:279
|
#: app/templates/app/logged_in_base.html:87
|
||||||
msgid "Groups"
|
msgid "Groups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:282
|
#: app/templates/app/logged_in_base.html:92
|
||||||
msgid "Brand"
|
msgid "Brand"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:285
|
#: app/templates/app/logged_in_base.html:95
|
||||||
msgid "Theme"
|
msgid "Theme"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:288
|
#: app/templates/app/logged_in_base.html:98
|
||||||
msgid "Plugins"
|
msgid "Plugins"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:291
|
#: app/templates/app/logged_in_base.html:101
|
||||||
msgid "Application"
|
msgid "Application"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -121,38 +121,42 @@ msgid "API Version"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:23
|
#: app/templates/app/processing_node.html:23
|
||||||
msgid "ODM Version"
|
msgid "Engine"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:27
|
#: app/templates/app/processing_node.html:27
|
||||||
msgid "Queue Count"
|
msgid "Engine Version"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:31
|
#: app/templates/app/processing_node.html:31
|
||||||
msgid "Max Images Limit"
|
msgid "Queue Count"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:35
|
#: app/templates/app/processing_node.html:35
|
||||||
msgid "Label"
|
msgid "Max Images Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:39
|
#: app/templates/app/processing_node.html:39
|
||||||
msgid "Last Refreshed"
|
msgid "Label"
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:40
|
|
||||||
msgid "ago"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:43
|
#: app/templates/app/processing_node.html:43
|
||||||
|
msgid "Last Refreshed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: app/templates/app/processing_node.html:44
|
||||||
|
msgid "ago"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: app/templates/app/processing_node.html:47
|
||||||
msgid "Options (JSON)"
|
msgid "Options (JSON)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:49
|
#: app/templates/app/processing_node.html:53
|
||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:50
|
#: app/templates/app/processing_node.html:54
|
||||||
msgid "Delete"
|
msgid "Delete"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -164,14 +168,18 @@ msgstr ""
|
||||||
msgid "Create Account"
|
msgid "Create Account"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/views/app.py:33
|
#: app/views/app.py:44
|
||||||
msgid "First Project"
|
msgid "First Project"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/views/app.py:43 app/views/public.py:25
|
#: app/views/app.py:54 app/views/public.py:26
|
||||||
msgid "Map"
|
msgid "Map"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/views/app.py:70
|
#: app/views/app.py:81
|
||||||
msgid "3D Model Display"
|
msgid "3D Model Display"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: plugins/cesium-ion/api_views.py:170
|
||||||
|
msgid "No matching enum type."
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2019-04-20 20:32+0000\n"
|
"POT-Creation-Date: 2020-12-14 18:40+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -20,7 +20,3 @@ msgstr ""
|
||||||
#: plugins/lightning/public/Dashboard.jsx:38
|
#: plugins/lightning/public/Dashboard.jsx:38
|
||||||
msgid "Loading dashboard..."
|
msgid "Loading dashboard..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: plugins/lightning/public/Dashboard.jsx:150
|
|
||||||
msgid "Logout"
|
|
||||||
msgstr ""
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2019-04-20 20:31+0000\n"
|
"POT-Creation-Date: 2020-12-14 18:40+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -69,43 +69,43 @@ msgid ""
|
||||||
"a> is optional, but can increase georeferencing accuracy"
|
"a> is optional, but can increase georeferencing accuracy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:197
|
#: app/templates/app/logged_in_base.html:15
|
||||||
msgid "Hello"
|
msgid "Hello"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:201
|
#: app/templates/app/logged_in_base.html:19
|
||||||
msgid "Logout"
|
msgid "Logout"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:224
|
#: app/templates/app/logged_in_base.html:33
|
||||||
msgid "Dashboard"
|
msgid "Dashboard"
|
||||||
msgstr ""
|
msgstr "Pannello di Controllo"
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:273
|
#: app/templates/app/logged_in_base.html:79
|
||||||
msgid "Administration"
|
msgid "Administration"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:276
|
#: app/templates/app/logged_in_base.html:84
|
||||||
msgid "Accounts"
|
msgid "Accounts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:279
|
#: app/templates/app/logged_in_base.html:87
|
||||||
msgid "Groups"
|
msgid "Groups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:282
|
#: app/templates/app/logged_in_base.html:92
|
||||||
msgid "Brand"
|
msgid "Brand"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:285
|
#: app/templates/app/logged_in_base.html:95
|
||||||
msgid "Theme"
|
msgid "Theme"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:288
|
#: app/templates/app/logged_in_base.html:98
|
||||||
msgid "Plugins"
|
msgid "Plugins"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/logged_in_base.html:291
|
#: app/templates/app/logged_in_base.html:101
|
||||||
msgid "Application"
|
msgid "Application"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -122,38 +122,42 @@ msgid "API Version"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:23
|
#: app/templates/app/processing_node.html:23
|
||||||
msgid "ODM Version"
|
msgid "Engine"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:27
|
#: app/templates/app/processing_node.html:27
|
||||||
msgid "Queue Count"
|
msgid "Engine Version"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:31
|
#: app/templates/app/processing_node.html:31
|
||||||
msgid "Max Images Limit"
|
msgid "Queue Count"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:35
|
#: app/templates/app/processing_node.html:35
|
||||||
msgid "Label"
|
msgid "Max Images Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:39
|
#: app/templates/app/processing_node.html:39
|
||||||
msgid "Last Refreshed"
|
msgid "Label"
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:40
|
|
||||||
msgid "ago"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:43
|
#: app/templates/app/processing_node.html:43
|
||||||
|
msgid "Last Refreshed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: app/templates/app/processing_node.html:44
|
||||||
|
msgid "ago"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: app/templates/app/processing_node.html:47
|
||||||
msgid "Options (JSON)"
|
msgid "Options (JSON)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:49
|
#: app/templates/app/processing_node.html:53
|
||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/templates/app/processing_node.html:50
|
#: app/templates/app/processing_node.html:54
|
||||||
msgid "Delete"
|
msgid "Delete"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -165,14 +169,18 @@ msgstr ""
|
||||||
msgid "Create Account"
|
msgid "Create Account"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/views/app.py:33
|
#: app/views/app.py:44
|
||||||
msgid "First Project"
|
msgid "First Project"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/views/app.py:43 app/views/public.py:25
|
#: app/views/app.py:54 app/views/public.py:26
|
||||||
msgid "Map"
|
msgid "Map"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: app/views/app.py:70
|
#: app/views/app.py:81
|
||||||
msgid "3D Model Display"
|
msgid "3D Model Display"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: plugins/cesium-ion/api_views.py:170
|
||||||
|
msgid "No matching enum type."
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2019-04-20 20:32+0000\n"
|
"POT-Creation-Date: 2020-12-14 18:40+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -20,8 +20,4 @@ msgstr ""
|
||||||
|
|
||||||
#: plugins/lightning/public/Dashboard.jsx:38
|
#: plugins/lightning/public/Dashboard.jsx:38
|
||||||
msgid "Loading dashboard..."
|
msgid "Loading dashboard..."
|
||||||
msgstr ""
|
msgstr "Caricando il pannello di controllo..."
|
||||||
|
|
||||||
#: plugins/lightning/public/Dashboard.jsx:150
|
|
||||||
msgid "Logout"
|
|
||||||
msgstr ""
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Login from './Login';
|
import Login from './Login';
|
||||||
import Dashboard from './Dashboard';
|
import Dashboard from './Dashboard';
|
||||||
import $ from 'jquery';
|
|
||||||
|
|
||||||
export default class LightningPanel extends React.Component {
|
export default class LightningPanel extends React.Component {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
|
27
translate.sh
27
translate.sh
|
@ -1,6 +1,21 @@
|
||||||
for lang in it
|
#!/bin/bash
|
||||||
do
|
|
||||||
django-admin makemessages --keep-pot --locale=$lang --ignore=app/templates/app/admin/* --ignore=app/templates/app/registration/*
|
LOCALES="it"
|
||||||
django-admin makemessages --keep-pot --locale=$lang -d djangojs --extension jsx
|
|
||||||
done
|
if [[ "$1" == "extract" ]]; then
|
||||||
django-admin compilemessages
|
echo "Extracting .po files from Django/React"
|
||||||
|
locale_param=""
|
||||||
|
for lang in $LOCALES
|
||||||
|
do
|
||||||
|
locale_param="--locale=$lang $locale_param"
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p locale
|
||||||
|
django-admin makemessages --keep-pot $locale_param --ignore=build --ignore=app/templates/app/admin/* --ignore=app/templates/app/registration/*
|
||||||
|
django-admin makemessages --keep-pot $locale_param -d djangojs --extension jsx --ignore=build
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$1" == "build" ]]; then
|
||||||
|
echo "Building .po files into .mo"
|
||||||
|
django-admin compilemessages
|
||||||
|
fi
|
||||||
|
|
|
@ -188,6 +188,9 @@ USE_I18N = True
|
||||||
USE_L10N = True
|
USE_L10N = True
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
|
LOCALE_PATHS = [
|
||||||
|
os.path.join(BASE_DIR, 'locale')
|
||||||
|
]
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
||||||
|
|
Ładowanie…
Reference in New Issue