Skip to content

Commit

Permalink
chore(webapp): updated translations
Browse files Browse the repository at this point in the history
refs #944
  • Loading branch information
marabesi committed Jun 22, 2024
1 parent affad5a commit 0bc6d77
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 32 deletions.
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"post:css": "postcss -c postcss.config.js src/css/tailwind.css -o src/css/index.css",
"analyze": "npm run build && source-map-explorer 'build/static/js/*.js'",
"debug": "export REACT_APP_DEBUG=true && npm run tailwind:css && react-scripts start",
"start": "npm run tailwind:css && react-scripts start",
"start": "export NODE_OPTIONS=--openssl-legacy-provider && npm run tailwind:css && react-scripts start",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"build": "export NODE_OPTIONS=--openssl-legacy-provider && npm run lint && npm run rebuild-sass && npm run tailwind:css && npm run docs:build && export NODE_ENV=production && react-scripts build",
Expand Down
35 changes: 20 additions & 15 deletions webapp/src/components/ui/interface/intro/Intro.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
import { mount } from 'enzyme';
import Intro from './Intro';
import IntlProvider from '../../../../third-party/wrappers/i18n/IntlProvider';

describe('Intro component', () => {

describe('default options', () => {
test('should not exit on esc', () => {
const wrapper = mount(
<Intro
initialStep={0}
steps={[]}
onExit={()=> {}}
/>
<IntlProvider locale="en">
<Intro
initialStep={0}
steps={[]}
onExit={()=> {}}
/>
</IntlProvider>
);

const options = wrapper.find('Steps').props('options');

expect(options.exitOnEsc).toBeFalsy();
});

test('should not exit on overlay click', () => {
const wrapper = mount(
<Intro
initialStep={0}
steps={[]}
onExit={()=> {}}
/>
<IntlProvider locale="en">
<Intro
initialStep={0}
steps={[]}
onExit={()=> {}}
/>
</IntlProvider>
);

const options = wrapper.find('Steps').props('options');

expect(options.exitOnOverlayClick).toBeFalsy();
});
});
});
});
17 changes: 10 additions & 7 deletions webapp/src/components/ui/interface/intro/Intro.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
import { Steps } from 'intro.js-react';
import { useIntl } from 'react-intl';
import config from '../../../../config';

import 'intro.js/introjs.css';
import './intro.scss';

export default function Intro(props) {
const { isDebug } = config;
const { messages }: any = useIntl();

return (
<Steps
{...props}
options={{
disableInteraction: true,
showStepNumbers: false,
exitOnEsc: isDebug ? true : false,
exitOnEsc: isDebug,
hidePrev: true,
exitOnOverlayClick: isDebug ? true : false,
exitOnOverlayClick: isDebug,
showButtons: true,
showBullets: false,
showProgress: true,
skipLabel: 'Sair',
nextLabel: 'Próximo',
prevLabel: 'Anterior',
doneLabel: 'Estou pronto!'
skipLabel: messages.intro.exit,
nextLabel: messages.intro.next,
prevLabel: messages.intro.previous,
doneLabel: messages.intro.ready
}}
/>
);
}
}
14 changes: 7 additions & 7 deletions webapp/src/pages/introduction/introduction-content.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,26 @@
},
{
"step": 4,
"button": "Que amigo?",
"button": "content.introduction.forth_step.which_friend",
"content": [
{
"line": "_{",
"line": "global.underscore_and_curly_braces_open",
"style": "p-2 text-blue-light"
},
{
"line": "Não temos credibilidade",
"line": "content.introduction.forth_step.no_credibility",
"style": "p-2 ml-4 text-blue-light"
},
{
"line": "pelo simples fato de não sermos bem vistos nessa área...",
"line": "content.introduction.forth_step.no_credibility_part_2",
"style": "p-2 ml-4 text-blue-light"
},
{
"line": "Ao contrário do meu amigo...",
"line": "content.introduction.forth_step.no_credibility_part_3",
"style": "p-2 ml-4 text-blue-light"
},
{
"line": "}",
"line": "global.curly_braces_close",
"style": "p-2 text-blue-light"
}
]
Expand All @@ -125,7 +125,7 @@
"style": "p-2 ml-4 text-blue-light"
},
{
"line": "}",
"line": "global.curly_braces_close",
"style": "p-2 text-blue-light"
}
]
Expand Down
18 changes: 18 additions & 0 deletions webapp/src/third-party/wrappers/i18n/locale/en.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
export default {
global: {
options: 'Options',
curly_braces_open: '{',
underscore_and_curly_braces_open: '_{',
curly_braces_close: '}',
underscore_and_braces_open: '_[',
braces_close: ']',
three_dots: '. . .',
},
menu: {
logout: 'logout'
Expand Down Expand Up @@ -90,6 +96,12 @@ export default {
survey: {
title: 'Survey'
},
intro: {
exit: 'Exit',
next: 'Next',
previous: 'Previous',
ready: 'I am ready!',
},
content: {
introduction: {
first_step: {
Expand All @@ -113,6 +125,12 @@ export default {
and_the_second: '_ and the second ...',
three_dots: '. . .',
i_am_a_bug: '_I am a bug!',
},
forth_step: {
which_friend: 'Which friend?',
no_credibility: 'We have no credibility',
no_credibility_part_2: 'for the simple fact that we are not well regarded in this area...',
no_credibility_part_3: 'Unlike my friend...',
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions webapp/src/third-party/wrappers/i18n/locale/es.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
export default {
global: {
options: 'Opciones',
curly_braces_open: '{',
underscore_and_curly_braces_open: '_{',
curly_braces_close: '}',
underscore_and_braces_open: '_[',
braces_close: ']',
three_dots: '. . .',
},
menu: {
logout: 'Salir'
Expand Down
12 changes: 12 additions & 0 deletions webapp/src/third-party/wrappers/i18n/locale/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ export default {
survey: {
title: 'Questionário'
},
intro: {
exit: 'Sair',
next: 'Próximo',
previous: 'Anterior',
ready: 'Estou pronto!',
},
content: {
introduction: {
first_step: {
Expand All @@ -119,6 +125,12 @@ export default {
and_the_second: '_ E o segundo ...',
three_dots: '. . .',
i_am_a_bug: '_Sou um bug!',
},
forth_step: {
which_friend: 'Que amigo?',
no_credibility: 'Não temos credibilidade',
no_credibility_part_2: 'pelo simples fato de não sermos bem vistos nessa área...',
no_credibility_part_3: 'Ao contrário do meu amigo...',
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions webapp/src/third-party/wrappers/i18n/locale/ro.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
export default {
global: {
options: 'Opțiuni'
options: 'Opțiuni',
curly_braces_open: '{',
underscore_and_curly_braces_open: '_{',
curly_braces_close: '}',
underscore_and_braces_open: '_[',
braces_close: ']',
three_dots: '. . .',
},
menu: {
logout: 'A iesi afara'
Expand Down Expand Up @@ -90,4 +96,4 @@ export default {
survey: {
title: 'Test'
}
};
};

0 comments on commit 0bc6d77

Please sign in to comment.