Skip to content

Commit 1d7af3d

Browse files
committed
Merge branch 'main' into classificatie
2 parents a0c9549 + c6f96b2 commit 1d7af3d

File tree

6 files changed

+209
-128
lines changed

6 files changed

+209
-128
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# AI Act Questions
2-
3-
AI Act questions based on AI Act defintions and the definition of High Impact Algorithm in the Algorithm Registery guidance by the Dutch Ministry of the Interior (https://algoritmes.pleio.nl/attachment/entity/f1a35292-7ea6-4e47-93fa-b3358e9ab2e0).
4-
5-
The questions are developed in collaboration with the Muncipality of Amsterdam.
6-
7-
The templates are available in JSON format and can be easily customized to fit the specific needs of an organization.
8-
91
# How it works
102

113
The JSON schema's use the [React JSON Schema Form (RJSF) library](https://github.com/rjsf-team/react-jsonschema-form), this library is built on top of: [Json schema's](https://json-schema.org/) which should make it easy to implement the schema's in your own tech stack.

src/App.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ export default function App() {
1919
const [activeForm, setActiveForm] = useState<RJSFSchema | null>(null);
2020
let formsMenu = [{ id: 0, title: t("no forms") }];
2121

22+
const params = new URLSearchParams(window.location.search);
23+
const lang = params.get("lang");
24+
25+
useEffect(() => {
26+
if (lang) {
27+
i18n.changeLanguage(lang);
28+
}
29+
}, [i18n]);
30+
2231
if (forms[i18n.language] && forms[i18n.language].length > 0) {
2332
formsMenu = (forms[i18n.language] as RJSFSchema[]).map((item, index) => {
2433
return { id: index, title: item.JSONSchema.title ?? t("no forms title") };
@@ -63,7 +72,7 @@ export default function App() {
6372
}, []);
6473

6574
return (
66-
<Container className="vh-100">
75+
<Container fluid className="vh-100 mx-0">
6776
<Row className="justify-content-center align-items-center h-100">
6877
<Col xs={12} className="">
6978
{activeForm ? (
@@ -80,6 +89,7 @@ export default function App() {
8089
<Intro
8190
forms={formsMenu}
8291
onStart={(id: number) => onFormActivate(id)}
92+
activeLanguage={lang ? true : false}
8393
/>
8494
)}
8595
</Col>

src/components/Intro.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import LanguageSwitcher from "./LanguageSwitcher";
55
export default function ({
66
forms,
77
onStart,
8+
activeLanguage = false,
89
}: {
910
forms: { id: number; title: string }[];
1011
onStart: (index: number) => void;
12+
activeLanguage?: boolean;
1113
}) {
1214
const { t } = useTranslation();
1315

@@ -16,28 +18,29 @@ export default function ({
1618
<Card.Body className="d-flex flex-column justify-content-between">
1719
<div className="d-flex flex-row justify-content-between align-items-top mb-2">
1820
<Card.Title>{t("cardTitle")}</Card.Title>
19-
<LanguageSwitcher />
21+
{!activeLanguage && <LanguageSwitcher />}
2022
</div>
2123

2224
<div className="mb-4">
2325
<p>{t("description1")}</p>
24-
<p>{t("description2")}
26+
<p>
27+
{t("description2")}
2528
<a
2629
href="https://eur-lex.europa.eu/eli/reg/2024/1689/oj"
2730
target="_blank"
2831
>
2932
{t("source1")}
3033
</a>
31-
{t("description2_1")}
34+
{t("description2_1")}
3235
<i>{t("description2_2")} </i>
33-
{t("description2_3")}
36+
{t("description2_3")}
3437
<a
3538
href="https://algoritmes.pleio.nl/attachment/entity/f1a35292-7ea6-4e47-93fa-b3358e9ab2e0"
3639
target="_blank"
3740
>
3841
{t("source2")}
3942
</a>
40-
{t("description2_4")}
43+
{t("description2_4")}
4144
</p>
4245
<p>
4346
{t("feedback")}{" "}

src/i18n/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import i18next from "i18next";
22
import { initReactI18next } from "react-i18next";
33
import enTranslation from "./en/translation.json";
44
import nlTranslation from "./nl/translation.json";
5-
import LanguageDetector from "i18next-browser-languagedetector";
65

76
i18next
8-
.use(LanguageDetector) // Add the language detector
7+
// currently not using the language detector, since we are using url params.
8+
//.use(LanguageDetector)
99
.use(initReactI18next)
1010
.init({
1111
fallbackLng: "en", // Default language if detection fails

0 commit comments

Comments
 (0)