From a9edf899b774e2f361a44ba6c0453087eebf579b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 5 Feb 2022 14:10:37 -0800 Subject: [PATCH] Fix es translation problems --- packages/editor/lang/es.json | 6 ++-- packages/editor/src/compiled-lang/es.json | 6 ++-- packages/editor/src/index.tsx | 34 +++++++++++-------- packages/editor/webpack.common.js | 2 +- packages/webapp/lang/es.json | 4 +-- packages/webapp/src/app.tsx | 7 ++-- packages/webapp/src/compiled-lang/es.json | 2 +- .../components/registration-page/index.tsx | 9 +++-- 8 files changed, 40 insertions(+), 30 deletions(-) diff --git a/packages/editor/lang/es.json b/packages/editor/lang/es.json index 36749b18..df4a128a 100644 --- a/packages/editor/lang/es.json +++ b/packages/editor/lang/es.json @@ -3,12 +3,12 @@ "defaultMessage": "¡Este espacio de edición muestra algunas de las capacidades del editor de mapas mentales!" }, "editor.try-welcome-description": { - "defaultMessage": "Regístrese para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita." + "defaultMessage": "Registrate para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita." }, "login.signup": { - "defaultMessage": "Inscribirse" + "defaultMessage": "Crear cuenta" }, "action.share": { - "defaultMessage": "Cuota" + "defaultMessage": "Compartir" } } \ No newline at end of file diff --git a/packages/editor/src/compiled-lang/es.json b/packages/editor/src/compiled-lang/es.json index 556d91da..19ff2e8a 100644 --- a/packages/editor/src/compiled-lang/es.json +++ b/packages/editor/src/compiled-lang/es.json @@ -2,7 +2,7 @@ "action.share": [ { "type": 0, - "value": "Cuota" + "value": "Compartir" } ], "editor.try-welcome": [ @@ -14,13 +14,13 @@ "editor.try-welcome-description": [ { "type": 0, - "value": "Regístrese para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita." + "value": "Registrate para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita." } ], "login.signup": [ { "type": 0, - "value": "Inscribirse" + "value": "Crear cuenta" } ] } \ No newline at end of file diff --git a/packages/editor/src/index.tsx b/packages/editor/src/index.tsx index a6e4917c..adb37dd4 100644 --- a/packages/editor/src/index.tsx +++ b/packages/editor/src/index.tsx @@ -11,6 +11,11 @@ import { DesignerOptionsBuilder, Designer } from '@wisemapping/mindplot'; +import FR from './compiled-lang/fr.json'; +import ES from './compiled-lang/es.json'; +import EN from './compiled-lang/en.json'; +import DE from './compiled-lang/de.json'; + declare global { var memoryPersistence: boolean; @@ -42,18 +47,18 @@ export type EditorPropsType = { function loadLocaleData(locale: string) { switch (locale) { - case 'fr': - return import('./compiled-lang/fr.json'); - case 'en': - return import('./compiled-lang/en.json'); - case 'es': - return import('./compiled-lang/es.json'); - case 'de': - return import('./compiled-lang/de.json'); - default: - return import('./compiled-lang/en.json') + case 'fr': + return FR; + case 'en': + return EN; + case 'es': + return ES; + case 'de': + return DE; + default: + return EN; } - } +} const initMindplot = () => { // Change page title ... @@ -71,8 +76,7 @@ const initMindplot = () => { }); } else { persistence = new LocalStorageManager( - `/c/restful/maps/{id}/${global.historyId ? `${global.historyId}/` : ''}document/xml${ - !global.isAuth ? '-pub' : '' + `/c/restful/maps/{id}/${global.historyId ? `${global.historyId}/` : ''}document/xml${!global.isAuth ? '-pub' : '' }`, true ); @@ -117,10 +121,10 @@ export default function Editor({ }: EditorPropsType): React.ReactElement { const [localeTranslation, setLocaleTranslation] = React.useState(null); React.useEffect(() => { - if(localeTranslation && !global.designer) { + if (localeTranslation && !global.designer) { initCallback(); } - }, [localeTranslation]); + }, [localeTranslation]); React.useEffect(() => { const loadAndSetLocale = async () => { setLocaleTranslation(await loadLocaleData(locale)); diff --git a/packages/editor/webpack.common.js b/packages/editor/webpack.common.js index 00c3147d..5bb9056a 100644 --- a/packages/editor/webpack.common.js +++ b/packages/editor/webpack.common.js @@ -28,7 +28,7 @@ module.exports = { exclude: '/node_modules/' }, { - test: /\.(png|jpe?g|gif|svg)$/, + test: /\.(png|jpe?g|gif|svg|json)$/, type: 'asset/inline', }, { diff --git a/packages/webapp/lang/es.json b/packages/webapp/lang/es.json index 4f1e3452..8b340089 100644 --- a/packages/webapp/lang/es.json +++ b/packages/webapp/lang/es.json @@ -283,7 +283,7 @@ "defaultMessage": "Iniciar sesión" }, "login.signup": { - "defaultMessage": "Inscribirse" + "defaultMessage": "Crear cuenta" }, "login.title": { "defaultMessage": "Bienvenido" @@ -370,7 +370,7 @@ "defaultMessage": "Cambia la contraseña" }, "menu.signout": { - "defaultMessage": "Desconectar" + "defaultMessage": "Cerrar sesión" }, "publish.button": { "defaultMessage": "Aceptar" diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 929438bf..84d57ebc 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -57,16 +57,17 @@ const App = (): ReactElement => { component={LoginPage} /> + path="/c/registration" component={RegistationPage} - + /> + component={ForgotPasswordPage} + /> { error={error} /> - { AppConfig.isRecaptcha2Enabled() && + {AppConfig.isRecaptcha2Enabled() &&
setCaptcha(el)} @@ -157,8 +157,13 @@ const RegistrationForm = () => { }; const RegistationPage = (): React.ReactElement => { + const intl = useIntl(); + useEffect(() => { - document.title = 'Registration | WiseMapping'; + document.title = intl.formatMessage({ + id: 'registration.title', + defaultMessage: 'Registration | WiseMapping', + }); }); return (