Fix es translation problems

This commit is contained in:
Paulo Gustavo Veiga 2022-02-05 14:10:37 -08:00
parent 29f3dac8b6
commit a9edf899b7
8 changed files with 40 additions and 30 deletions

View File

@ -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"
}
}

View File

@ -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"
}
]
}

View File

@ -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));

View File

@ -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',
},
{

View File

@ -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"

View File

@ -57,16 +57,17 @@ const App = (): ReactElement => {
component={LoginPage}
/>
<Route
path="/c/registration">
path="/c/registration"
component={RegistationPage}
</Route>
/>
<Route
path="/c/registration-success"
component={RegistrationSuccessPage}
/>
<Route
path="/c/forgot-password"
component={ForgotPasswordPage} />
component={ForgotPasswordPage}
/>
<Route
path="/c/forgot-password-success"
component={ForgotPasswordSuccessPage}

View File

@ -578,7 +578,7 @@
"login.signup": [
{
"type": 0,
"value": "Inscribirse"
"value": "Crear cuenta"
}
],
"login.title": [

View File

@ -125,7 +125,7 @@ const RegistrationForm = () => {
error={error}
/>
{ AppConfig.isRecaptcha2Enabled() &&
{AppConfig.isRecaptcha2Enabled() &&
<div style={{ width: '330px', padding: '5px 0px 5px 20px' }}>
<ReCAPTCHA
ref={el => 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 (