Spaces:
Running
Running
Tai Truong
commited on
Commit
·
402282a
1
Parent(s):
3fbe7c9
translate to norsk
Browse files
src/frontend/src/i18n/locales/en/translation.json
CHANGED
@@ -56,6 +56,36 @@
|
|
56 |
"loginError": "Invalid email or password",
|
57 |
"loginSuccess": "Login successful"
|
58 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
"flows": {
|
60 |
"newFlow": "New Flow",
|
61 |
"myFlows": "My Flows",
|
|
|
56 |
"loginError": "Invalid email or password",
|
57 |
"loginSuccess": "Login successful"
|
58 |
},
|
59 |
+
"login": {
|
60 |
+
"title": "OpenDigital.no",
|
61 |
+
"test_account": "Test account",
|
62 |
+
"test_credentials": "username: test / password: test12345",
|
63 |
+
"username": "Username",
|
64 |
+
"username_placeholder": "Username",
|
65 |
+
"username_required": "Please enter your username",
|
66 |
+
"password": "Password",
|
67 |
+
"password_placeholder": "Password",
|
68 |
+
"password_required": "Please enter your password",
|
69 |
+
"sign_in": "Sign in",
|
70 |
+
"dont_have_account": "Don't have an account?",
|
71 |
+
"sign_up": "Sign Up"
|
72 |
+
},
|
73 |
+
"signup": {
|
74 |
+
"title": "OpenDigital.no",
|
75 |
+
"username": "Username",
|
76 |
+
"username_placeholder": "Username",
|
77 |
+
"username_required": "Please enter your username",
|
78 |
+
"password": "Password",
|
79 |
+
"password_placeholder": "Password",
|
80 |
+
"password_required": "Please enter a password",
|
81 |
+
"confirm_password": "Confirm your password",
|
82 |
+
"confirm_password_placeholder": "Confirm your password",
|
83 |
+
"confirm_password_required": "Please confirm your password",
|
84 |
+
"passwords_not_match": "Passwords do not match",
|
85 |
+
"sign_up": "Sign up",
|
86 |
+
"have_account": "Already have an account?",
|
87 |
+
"sign_in": "Sign in"
|
88 |
+
},
|
89 |
"flows": {
|
90 |
"newFlow": "New Flow",
|
91 |
"myFlows": "My Flows",
|
src/frontend/src/i18n/locales/no/translation.json
CHANGED
@@ -56,6 +56,36 @@
|
|
56 |
"loginError": "Ugyldig e-post eller passord",
|
57 |
"loginSuccess": "Innlogging vellykket"
|
58 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
"flows": {
|
60 |
"newFlow": "Ny flyt",
|
61 |
"myFlows": "Mine flyter",
|
|
|
56 |
"loginError": "Ugyldig e-post eller passord",
|
57 |
"loginSuccess": "Innlogging vellykket"
|
58 |
},
|
59 |
+
"login": {
|
60 |
+
"title": "OpenDigital.no",
|
61 |
+
"test_account": "Testkonto",
|
62 |
+
"test_credentials": "brukernavn: test / passord: test12345",
|
63 |
+
"username": "Brukernavn",
|
64 |
+
"username_placeholder": "Brukernavn",
|
65 |
+
"username_required": "Vennligst skriv inn brukernavn",
|
66 |
+
"password": "Passord",
|
67 |
+
"password_placeholder": "Passord",
|
68 |
+
"password_required": "Vennligst skriv inn passord",
|
69 |
+
"sign_in": "Logg inn",
|
70 |
+
"dont_have_account": "Har du ikke konto?",
|
71 |
+
"sign_up": "Registrer deg"
|
72 |
+
},
|
73 |
+
"signup": {
|
74 |
+
"title": "OpenDigital.no",
|
75 |
+
"username": "Brukernavn",
|
76 |
+
"username_placeholder": "Brukernavn",
|
77 |
+
"username_required": "Vennligst skriv inn brukernavn",
|
78 |
+
"password": "Passord",
|
79 |
+
"password_placeholder": "Passord",
|
80 |
+
"password_required": "Vennligst skriv inn passord",
|
81 |
+
"confirm_password": "Bekreft passord",
|
82 |
+
"confirm_password_placeholder": "Bekreft passord",
|
83 |
+
"confirm_password_required": "Vennligst bekreft passordet",
|
84 |
+
"passwords_not_match": "Passordene stemmer ikke overens",
|
85 |
+
"sign_up": "Registrer deg",
|
86 |
+
"have_account": "Har du allerede en konto?",
|
87 |
+
"sign_in": "Logg inn"
|
88 |
+
},
|
89 |
"flows": {
|
90 |
"newFlow": "Ny flyt",
|
91 |
"myFlows": "Mine flyter",
|
src/frontend/src/pages/LoginPage/index.tsx
CHANGED
@@ -17,8 +17,10 @@ import {
|
|
17 |
loginInputStateType,
|
18 |
} from "../../types/components";
|
19 |
import logo from '@/assets/logo-short.png'
|
|
|
20 |
|
21 |
export default function LoginPage(): JSX.Element {
|
|
|
22 |
const [inputState, setInputState] =
|
23 |
useState<loginInputStateType>(CONTROL_LOGIN_STATE);
|
24 |
|
@@ -70,16 +72,16 @@ export default function LoginPage(): JSX.Element {
|
|
70 |
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
71 |
<img src={logo} alt="logo" />
|
72 |
<span className="mb-6 text-2xl font-semibold text-primary">
|
73 |
-
|
74 |
</span>
|
75 |
<div className="mb-3 w-full">
|
76 |
<div className="py-5">
|
77 |
-
<p>
|
78 |
-
<div>
|
79 |
</div>
|
80 |
<Form.Field name="username">
|
81 |
<Form.Label className="data-[invalid]:label-invalid">
|
82 |
-
|
83 |
</Form.Label>
|
84 |
|
85 |
<Form.Control asChild>
|
@@ -91,19 +93,19 @@ export default function LoginPage(): JSX.Element {
|
|
91 |
value={username}
|
92 |
className="w-full"
|
93 |
required
|
94 |
-
placeholder=
|
95 |
/>
|
96 |
</Form.Control>
|
97 |
|
98 |
<Form.Message match="valueMissing" className="field-invalid">
|
99 |
-
|
100 |
</Form.Message>
|
101 |
</Form.Field>
|
102 |
</div>
|
103 |
<div className="mb-3 w-full">
|
104 |
<Form.Field name="password">
|
105 |
<Form.Label className="data-[invalid]:label-invalid">
|
106 |
-
|
107 |
</Form.Label>
|
108 |
|
109 |
<InputComponent
|
@@ -114,26 +116,26 @@ export default function LoginPage(): JSX.Element {
|
|
114 |
isForm
|
115 |
password={true}
|
116 |
required
|
117 |
-
placeholder=
|
118 |
className="w-full"
|
119 |
/>
|
120 |
|
121 |
<Form.Message className="field-invalid" match="valueMissing">
|
122 |
-
|
123 |
</Form.Message>
|
124 |
</Form.Field>
|
125 |
</div>
|
126 |
<div className="w-full">
|
127 |
<Form.Submit asChild>
|
128 |
<Button className="mr-3 mt-6 w-full" type="submit">
|
129 |
-
|
130 |
</Button>
|
131 |
</Form.Submit>
|
132 |
</div>
|
133 |
<div className="w-full">
|
134 |
<CustomLink to="/signup">
|
135 |
<Button className="w-full" variant="outline" type="button">
|
136 |
-
|
137 |
</Button>
|
138 |
</CustomLink>
|
139 |
</div>
|
|
|
17 |
loginInputStateType,
|
18 |
} from "../../types/components";
|
19 |
import logo from '@/assets/logo-short.png'
|
20 |
+
import { useTranslation } from 'react-i18next';
|
21 |
|
22 |
export default function LoginPage(): JSX.Element {
|
23 |
+
const { t } = useTranslation();
|
24 |
const [inputState, setInputState] =
|
25 |
useState<loginInputStateType>(CONTROL_LOGIN_STATE);
|
26 |
|
|
|
72 |
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
73 |
<img src={logo} alt="logo" />
|
74 |
<span className="mb-6 text-2xl font-semibold text-primary">
|
75 |
+
{t('login.title')}
|
76 |
</span>
|
77 |
<div className="mb-3 w-full">
|
78 |
<div className="py-5">
|
79 |
+
<p>{t('login.test_account')}:</p>
|
80 |
+
<div>{t('login.test_credentials')}</div>
|
81 |
</div>
|
82 |
<Form.Field name="username">
|
83 |
<Form.Label className="data-[invalid]:label-invalid">
|
84 |
+
{t('login.username')} <span className="font-medium text-destructive">*</span>
|
85 |
</Form.Label>
|
86 |
|
87 |
<Form.Control asChild>
|
|
|
93 |
value={username}
|
94 |
className="w-full"
|
95 |
required
|
96 |
+
placeholder={t('login.username_placeholder')}
|
97 |
/>
|
98 |
</Form.Control>
|
99 |
|
100 |
<Form.Message match="valueMissing" className="field-invalid">
|
101 |
+
{t('login.username_required')}
|
102 |
</Form.Message>
|
103 |
</Form.Field>
|
104 |
</div>
|
105 |
<div className="mb-3 w-full">
|
106 |
<Form.Field name="password">
|
107 |
<Form.Label className="data-[invalid]:label-invalid">
|
108 |
+
{t('login.password')} <span className="font-medium text-destructive">*</span>
|
109 |
</Form.Label>
|
110 |
|
111 |
<InputComponent
|
|
|
116 |
isForm
|
117 |
password={true}
|
118 |
required
|
119 |
+
placeholder={t('login.password_placeholder')}
|
120 |
className="w-full"
|
121 |
/>
|
122 |
|
123 |
<Form.Message className="field-invalid" match="valueMissing">
|
124 |
+
{t('login.password_required')}
|
125 |
</Form.Message>
|
126 |
</Form.Field>
|
127 |
</div>
|
128 |
<div className="w-full">
|
129 |
<Form.Submit asChild>
|
130 |
<Button className="mr-3 mt-6 w-full" type="submit">
|
131 |
+
{t('login.sign_in')}
|
132 |
</Button>
|
133 |
</Form.Submit>
|
134 |
</div>
|
135 |
<div className="w-full">
|
136 |
<CustomLink to="/signup">
|
137 |
<Button className="w-full" variant="outline" type="button">
|
138 |
+
{t('login.dont_have_account')} <b>{t('login.sign_up')}</b>
|
139 |
</Button>
|
140 |
</CustomLink>
|
141 |
</div>
|
src/frontend/src/pages/SignUpPage/index.tsx
CHANGED
@@ -21,8 +21,10 @@ import {
|
|
21 |
signUpInputStateType,
|
22 |
} from "../../types/components";
|
23 |
import logo from '@/assets/logo-short.png'
|
|
|
24 |
|
25 |
export default function SignUp(): JSX.Element {
|
|
|
26 |
const [inputState, setInputState] =
|
27 |
useState<signUpInputStateType>(CONTROL_INPUT_STATE);
|
28 |
|
@@ -94,12 +96,12 @@ export default function SignUp(): JSX.Element {
|
|
94 |
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
95 |
<img src={logo} alt="logo" />
|
96 |
<span className="mb-6 text-2xl font-semibold text-primary">
|
97 |
-
|
98 |
</span>
|
99 |
<div className="mb-3 w-full">
|
100 |
<Form.Field name="username">
|
101 |
<Form.Label className="data-[invalid]:label-invalid">
|
102 |
-
|
103 |
</Form.Label>
|
104 |
|
105 |
<Form.Control asChild>
|
@@ -111,19 +113,19 @@ export default function SignUp(): JSX.Element {
|
|
111 |
value={username}
|
112 |
className="w-full"
|
113 |
required
|
114 |
-
placeholder=
|
115 |
/>
|
116 |
</Form.Control>
|
117 |
|
118 |
<Form.Message match="valueMissing" className="field-invalid">
|
119 |
-
|
120 |
</Form.Message>
|
121 |
</Form.Field>
|
122 |
</div>
|
123 |
<div className="mb-3 w-full">
|
124 |
<Form.Field name="password" serverInvalid={password != cnfPassword}>
|
125 |
<Form.Label className="data-[invalid]:label-invalid">
|
126 |
-
|
127 |
</Form.Label>
|
128 |
<InputComponent
|
129 |
onChange={(value) => {
|
@@ -133,17 +135,17 @@ export default function SignUp(): JSX.Element {
|
|
133 |
isForm
|
134 |
password={true}
|
135 |
required
|
136 |
-
placeholder=
|
137 |
className="w-full"
|
138 |
/>
|
139 |
|
140 |
<Form.Message className="field-invalid" match="valueMissing">
|
141 |
-
|
142 |
</Form.Message>
|
143 |
|
144 |
{password != cnfPassword && (
|
145 |
<Form.Message className="field-invalid">
|
146 |
-
|
147 |
</Form.Message>
|
148 |
)}
|
149 |
</Form.Field>
|
@@ -154,7 +156,7 @@ export default function SignUp(): JSX.Element {
|
|
154 |
serverInvalid={password != cnfPassword}
|
155 |
>
|
156 |
<Form.Label className="data-[invalid]:label-invalid">
|
157 |
-
|
158 |
<span className="font-medium text-destructive">*</span>
|
159 |
</Form.Label>
|
160 |
|
@@ -166,12 +168,12 @@ export default function SignUp(): JSX.Element {
|
|
166 |
isForm
|
167 |
password={true}
|
168 |
required
|
169 |
-
placeholder=
|
170 |
className="w-full"
|
171 |
/>
|
172 |
|
173 |
<Form.Message className="field-invalid" match="valueMissing">
|
174 |
-
|
175 |
</Form.Message>
|
176 |
</Form.Field>
|
177 |
</div>
|
@@ -185,14 +187,14 @@ export default function SignUp(): JSX.Element {
|
|
185 |
handleSignup();
|
186 |
}}
|
187 |
>
|
188 |
-
|
189 |
</Button>
|
190 |
</Form.Submit>
|
191 |
</div>
|
192 |
<div className="w-full">
|
193 |
<CustomLink to="/login">
|
194 |
<Button className="w-full" variant="outline">
|
195 |
-
|
196 |
</Button>
|
197 |
</CustomLink>
|
198 |
</div>
|
|
|
21 |
signUpInputStateType,
|
22 |
} from "../../types/components";
|
23 |
import logo from '@/assets/logo-short.png'
|
24 |
+
import { useTranslation } from 'react-i18next';
|
25 |
|
26 |
export default function SignUp(): JSX.Element {
|
27 |
+
const { t } = useTranslation();
|
28 |
const [inputState, setInputState] =
|
29 |
useState<signUpInputStateType>(CONTROL_INPUT_STATE);
|
30 |
|
|
|
96 |
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
97 |
<img src={logo} alt="logo" />
|
98 |
<span className="mb-6 text-2xl font-semibold text-primary">
|
99 |
+
{t('signup.title')}
|
100 |
</span>
|
101 |
<div className="mb-3 w-full">
|
102 |
<Form.Field name="username">
|
103 |
<Form.Label className="data-[invalid]:label-invalid">
|
104 |
+
{t('signup.username')} <span className="font-medium text-destructive">*</span>
|
105 |
</Form.Label>
|
106 |
|
107 |
<Form.Control asChild>
|
|
|
113 |
value={username}
|
114 |
className="w-full"
|
115 |
required
|
116 |
+
placeholder={t('signup.username_placeholder')}
|
117 |
/>
|
118 |
</Form.Control>
|
119 |
|
120 |
<Form.Message match="valueMissing" className="field-invalid">
|
121 |
+
{t('signup.username_required')}
|
122 |
</Form.Message>
|
123 |
</Form.Field>
|
124 |
</div>
|
125 |
<div className="mb-3 w-full">
|
126 |
<Form.Field name="password" serverInvalid={password != cnfPassword}>
|
127 |
<Form.Label className="data-[invalid]:label-invalid">
|
128 |
+
{t('signup.password')} <span className="font-medium text-destructive">*</span>
|
129 |
</Form.Label>
|
130 |
<InputComponent
|
131 |
onChange={(value) => {
|
|
|
135 |
isForm
|
136 |
password={true}
|
137 |
required
|
138 |
+
placeholder={t('signup.password_placeholder')}
|
139 |
className="w-full"
|
140 |
/>
|
141 |
|
142 |
<Form.Message className="field-invalid" match="valueMissing">
|
143 |
+
{t('signup.password_required')}
|
144 |
</Form.Message>
|
145 |
|
146 |
{password != cnfPassword && (
|
147 |
<Form.Message className="field-invalid">
|
148 |
+
{t('signup.passwords_not_match')}
|
149 |
</Form.Message>
|
150 |
)}
|
151 |
</Form.Field>
|
|
|
156 |
serverInvalid={password != cnfPassword}
|
157 |
>
|
158 |
<Form.Label className="data-[invalid]:label-invalid">
|
159 |
+
{t('signup.confirm_password')}{" "}
|
160 |
<span className="font-medium text-destructive">*</span>
|
161 |
</Form.Label>
|
162 |
|
|
|
168 |
isForm
|
169 |
password={true}
|
170 |
required
|
171 |
+
placeholder={t('signup.confirm_password_placeholder')}
|
172 |
className="w-full"
|
173 |
/>
|
174 |
|
175 |
<Form.Message className="field-invalid" match="valueMissing">
|
176 |
+
{t('signup.confirm_password_required')}
|
177 |
</Form.Message>
|
178 |
</Form.Field>
|
179 |
</div>
|
|
|
187 |
handleSignup();
|
188 |
}}
|
189 |
>
|
190 |
+
{t('signup.sign_up')}
|
191 |
</Button>
|
192 |
</Form.Submit>
|
193 |
</div>
|
194 |
<div className="w-full">
|
195 |
<CustomLink to="/login">
|
196 |
<Button className="w-full" variant="outline">
|
197 |
+
{t('signup.have_account')} <b>{t('signup.sign_in')}</b>
|
198 |
</Button>
|
199 |
</CustomLink>
|
200 |
</div>
|