diff --git a/messages/renderer/en.json b/messages/renderer/en.json index 298ce0ec9..b8a5ca4ed 100644 --- a/messages/renderer/en.json +++ b/messages/renderer/en.json @@ -56,6 +56,15 @@ "renderer.components.MapFilter.Toolbar.exportButton": { "message": "Export data" }, + "renderer.components.MapFilter.Toolbar.mapTabLabel": { + "message": "Map" + }, + "renderer.components.MapFilter.Toolbar.mediaTabLabel": { + "message": "Media" + }, + "renderer.components.MapFilter.Toolbar.reportTabLabel": { + "message": "Report" + }, "renderer.components.SyncView.Searching.searchingHint": { "description": "Hint on sync screen when searching on wifi for devices", "message": "Make sure devices are turned on and connected to the same wifi network" diff --git a/messages/renderer/es.json b/messages/renderer/es.json index bb1566b77..c9c857074 100644 --- a/messages/renderer/es.json +++ b/messages/renderer/es.json @@ -19,7 +19,7 @@ }, "renderer.components.MapFilter.Loading.loading": { "description": "Displayed whilst observations and presets load", - "message": "" + "message": "Cargando…" }, "renderer.components.MapFilter.MapExportDialog.cancel": { "description": "cancel button", @@ -54,67 +54,76 @@ "message": "Título de este mapa" }, "renderer.components.MapFilter.Toolbar.exportButton": { - "message": "" + "message": "Exportar" + }, + "renderer.components.MapFilter.Toolbar.mapTabLabel": { + "message": "Mapa" + }, + "renderer.components.MapFilter.Toolbar.mediaTabLabel": { + "message": "Fotos" + }, + "renderer.components.MapFilter.Toolbar.reportTabLabel": { + "message": "Informe" }, "renderer.components.SyncView.Searching.searchingHint": { "description": "Hint on sync screen when searching on wifi for devices", - "message": "" + "message": "Asegurar que los equipos están encendidos y conectados a la misma red de wifi" }, "renderer.components.SyncView.Searching.searchingTitle": { "description": "Title on sync screen when searching for devices", - "message": "" + "message": "Buscando…" }, "renderer.components.SyncView.SyncAppBar.newSyncfile": { "description": "Button to create a new sync file", - "message": "" + "message": "Crear nuevo archivo de sincronización" }, "renderer.components.SyncView.SyncAppBar.selectSyncfile": { "description": "Button to sync from an existing sync file", - "message": "" + "message": "Sincronizar con archivo" }, "renderer.components.SyncView.SyncAppBar.subtitle": { - "message": "" + "message": "por wifi" }, "renderer.components.SyncView.SyncAppBar.title": { "description": "Title of sync screen", - "message": "" + "message": "Equipo disponibles" }, "renderer.components.SyncView.SyncButton.complete": { "description": "Button when sync is complete", - "message": "" + "message": "Completo" }, "renderer.components.SyncView.SyncButton.retry": { "description": "Button to retry sync after error", - "message": "" + "message": "Reintentar" }, "renderer.components.SyncView.SyncButton.starting": { "description": "Displayed when sync is starting", - "message": "" + "message": "Iniciando…" }, "renderer.components.SyncView.SyncButton.sync": { "description": "Button to sync a device", - "message": "" + "message": "Sincronizar" }, "renderer.components.SyncView.SyncTarget.database": { "description": "Prompt of how many database objects have synced", - "message": "" + "message": "Datos: {sofar} / {total}" }, "renderer.components.SyncView.SyncTarget.errorMsg": { "description": "Message shown when there is an error while syncing", - "message": "" + "message": "Error de sicronización" }, "renderer.components.SyncView.SyncTarget.lastSync": { "description": "Shown before last sync time, e.g. 'Last synchronized: 2 hours ago'", - "message": "" + "message": "Ultima sincronización" }, "renderer.components.SyncView.SyncTarget.media": { "description": "Prompt for how many media items have synced", - "message": "" + "message": "Fotos: {sofar} / {total}" }, "renderer.components.dialogs.LatLon.button-submit": { - "message": "" + "message": "Ir" }, "renderer.components.dialogs.LatLon.dialog-enter-latlon-coordinates": { - "message": "" + "message": "Ingresar coordenadas" } } diff --git a/messages/renderer/pt.json b/messages/renderer/pt.json index 4d54f0756..f5112231d 100644 --- a/messages/renderer/pt.json +++ b/messages/renderer/pt.json @@ -56,6 +56,15 @@ "renderer.components.MapFilter.Toolbar.exportButton": { "message": "" }, + "renderer.components.MapFilter.Toolbar.mapTabLabel": { + "message": "" + }, + "renderer.components.MapFilter.Toolbar.mediaTabLabel": { + "message": "" + }, + "renderer.components.MapFilter.Toolbar.reportTabLabel": { + "message": "" + }, "renderer.components.SyncView.Searching.searchingHint": { "description": "Hint on sync screen when searching on wifi for devices", "message": "" diff --git a/package.json b/package.json index 0c50a8f43..f543b0036 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "clean": "rimraf \"dist/\"", "pack": "electron-builder --dir", "dist": "electron-builder --publish=onTag", - "build": "webpack", + "build": "npm run build:translations && webpack", + "build:translations": "bin/build-translations.js", "lint": "standard", "test": "npm run lint && npm run test-integration", "test-integration": "tape test", diff --git a/src/renderer/app.js b/src/renderer/app.js index 38e1e4fce..31b6b504a 100644 --- a/src/renderer/app.js +++ b/src/renderer/app.js @@ -9,11 +9,29 @@ import Home from './components/HomeNew' const locale = navigator.language.slice(0, 2) +const mdMsgs = { + en: require('../../translations/en.json'), + es: require('../../translations/es.json'), + pt: require('../../translations/pt.json') +} + +const mfMsgs = { + en: require('react-mapfilter/translations/en.json'), + es: require('react-mapfilter/translations/es.json'), + pt: require('react-mapfilter/translations/pt.json') +} + +const allMsgs = { + en: { ...mdMsgs.en, ...mfMsgs.en }, + es: { ...mdMsgs.es, ...mfMsgs.es }, + pt: { ...mdMsgs.pt, ...mfMsgs.pt } +} + const App = () => ( - + @@ -22,7 +40,7 @@ const App = () => ( ReactDOM.render(, document.getElementById('root')) -let localStorage = window.localStorage +const localStorage = window.localStorage window.testMode = function () { console.log('Test mode, clearing cache') localStorage.removeItem('lastView') diff --git a/src/renderer/components/MapFilter/Toolbar.js b/src/renderer/components/MapFilter/Toolbar.js index 37a4c4352..5501704d8 100644 --- a/src/renderer/components/MapFilter/Toolbar.js +++ b/src/renderer/components/MapFilter/Toolbar.js @@ -15,7 +15,10 @@ import clsx from 'clsx' import MapExportDialog from './MapExportDialog' const m = defineMessages({ - exportButton: 'Export data' + exportButton: 'Export data', + mapTabLabel: 'Map', + mediaTabLabel: 'Media', + reportTabLabel: 'Report' }) const TabItem = ({ selected, ...props }) => { @@ -58,7 +61,7 @@ const MapFilterToolbar = ({ onClick={handleChange('map')} > - Map + {t(m.mapTabLabel)} - Media + {t(m.mediaTabLabel)} - Report + {t(m.reportTabLabel)} diff --git a/translations/en.json b/translations/en.json index b37da5906..c87604846 100644 --- a/translations/en.json +++ b/translations/en.json @@ -14,6 +14,9 @@ "renderer.components.MapFilter.MapExportDialog.title": "Export a map to share online", "renderer.components.MapFilter.MapExportDialog.titleLabel": "Map Title", "renderer.components.MapFilter.Toolbar.exportButton": "Export data", + "renderer.components.MapFilter.Toolbar.mapTabLabel": "Map", + "renderer.components.MapFilter.Toolbar.mediaTabLabel": "Media", + "renderer.components.MapFilter.Toolbar.reportTabLabel": "Report", "renderer.components.SyncView.Searching.searchingHint": "Make sure devices are turned on and connected to the same wifi network", "renderer.components.SyncView.Searching.searchingTitle": "Searching…", "renderer.components.SyncView.SyncAppBar.newSyncfile": "Create new syncfile…", diff --git a/translations/es.json b/translations/es.json index d38402bbc..38be66aa5 100644 --- a/translations/es.json +++ b/translations/es.json @@ -4,7 +4,7 @@ "renderer.components.HomeNew.sync": "Síncronizar", "renderer.components.MapEditor.feedback-contribute-button": "", "renderer.components.MapFilter.FilterPanel.filterHeader": "Filtrar datos…", - "renderer.components.MapFilter.Loading.loading": "", + "renderer.components.MapFilter.Loading.loading": "Cargando…", "renderer.components.MapFilter.MapExportDialog.cancel": "Cancelar", "renderer.components.MapFilter.MapExportDialog.descriptionLabel": "Descripción de este mapa", "renderer.components.MapFilter.MapExportDialog.save": "Guardar", @@ -13,21 +13,24 @@ "renderer.components.MapFilter.MapExportDialog.termsLabel": "", "renderer.components.MapFilter.MapExportDialog.title": "Exportar un mapa para compartir en el internet", "renderer.components.MapFilter.MapExportDialog.titleLabel": "Título de este mapa", - "renderer.components.MapFilter.Toolbar.exportButton": "", - "renderer.components.SyncView.Searching.searchingHint": "", - "renderer.components.SyncView.Searching.searchingTitle": "", - "renderer.components.SyncView.SyncAppBar.newSyncfile": "", - "renderer.components.SyncView.SyncAppBar.selectSyncfile": "", - "renderer.components.SyncView.SyncAppBar.subtitle": "", - "renderer.components.SyncView.SyncAppBar.title": "", - "renderer.components.SyncView.SyncButton.complete": "", - "renderer.components.SyncView.SyncButton.retry": "", - "renderer.components.SyncView.SyncButton.starting": "", - "renderer.components.SyncView.SyncButton.sync": "", - "renderer.components.SyncView.SyncTarget.database": "", - "renderer.components.SyncView.SyncTarget.errorMsg": "", - "renderer.components.SyncView.SyncTarget.lastSync": "", - "renderer.components.SyncView.SyncTarget.media": "", - "renderer.components.dialogs.LatLon.button-submit": "", - "renderer.components.dialogs.LatLon.dialog-enter-latlon-coordinates": "" + "renderer.components.MapFilter.Toolbar.exportButton": "Exportar", + "renderer.components.MapFilter.Toolbar.mapTabLabel": "Mapa", + "renderer.components.MapFilter.Toolbar.mediaTabLabel": "Fotos", + "renderer.components.MapFilter.Toolbar.reportTabLabel": "Informe", + "renderer.components.SyncView.Searching.searchingHint": "Asegurar que los equipos están encendidos y conectados a la misma red de wifi", + "renderer.components.SyncView.Searching.searchingTitle": "Buscando…", + "renderer.components.SyncView.SyncAppBar.newSyncfile": "Crear nuevo archivo de sincronización", + "renderer.components.SyncView.SyncAppBar.selectSyncfile": "Sincronizar con archivo", + "renderer.components.SyncView.SyncAppBar.subtitle": "por wifi", + "renderer.components.SyncView.SyncAppBar.title": "Equipo disponibles", + "renderer.components.SyncView.SyncButton.complete": "Completo", + "renderer.components.SyncView.SyncButton.retry": "Reintentar", + "renderer.components.SyncView.SyncButton.starting": "Iniciando…", + "renderer.components.SyncView.SyncButton.sync": "Sincronizar", + "renderer.components.SyncView.SyncTarget.database": "Datos: {sofar} / {total}", + "renderer.components.SyncView.SyncTarget.errorMsg": "Error de sicronización", + "renderer.components.SyncView.SyncTarget.lastSync": "Ultima sincronización", + "renderer.components.SyncView.SyncTarget.media": "Fotos: {sofar} / {total}", + "renderer.components.dialogs.LatLon.button-submit": "Ir", + "renderer.components.dialogs.LatLon.dialog-enter-latlon-coordinates": "Ingresar coordenadas" } \ No newline at end of file diff --git a/translations/pt.json b/translations/pt.json index 664493a45..b96786600 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -14,6 +14,9 @@ "renderer.components.MapFilter.MapExportDialog.title": "", "renderer.components.MapFilter.MapExportDialog.titleLabel": "", "renderer.components.MapFilter.Toolbar.exportButton": "", + "renderer.components.MapFilter.Toolbar.mapTabLabel": "", + "renderer.components.MapFilter.Toolbar.mediaTabLabel": "", + "renderer.components.MapFilter.Toolbar.reportTabLabel": "", "renderer.components.SyncView.Searching.searchingHint": "", "renderer.components.SyncView.Searching.searchingTitle": "", "renderer.components.SyncView.SyncAppBar.newSyncfile": "",