Skip to content

Commit

Permalink
Merge pull request #8 from OpenUpSA/feature/update-available-languages
Browse files Browse the repository at this point in the history
xh (isiXhosa), en (English), and af (Afrikaans) added, zu (isiZulu) d…
  • Loading branch information
paulmwatson authored Sep 2, 2024
2 parents 6e519e3 + f6a079b commit 2d894c9
Show file tree
Hide file tree
Showing 17 changed files with 227 additions and 30 deletions.
2 changes: 1 addition & 1 deletion i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { notFound } from "next/navigation";
import { getRequestConfig } from "next-intl/server";

// Can be imported from a shared config
export const locales = ["en", "zu"];
export const locales = ["en", "xh", "af"];

export default getRequestConfig(async ({ locale }) => {
// Validate that the incoming `locale` parameter is valid
Expand Down
156 changes: 156 additions & 0 deletions messages/af.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"metadata": {
"title": "Green Connection's Gaslit! (Afrikaans)",
"description": "by Green Connection and OpenUp (Afrikaans)"
},
"home": {
"get-started": "How does it work?",
"credit": "A news game created by"
},
"how-does-it-work": {
"title": "Before you get started",
"sub-title": "How does it work?",
"get-started": "Get started",
"intro": "This game features <strong>8 scenarios</strong> that will put you in the drivers seat behind some of South Africa’s most pivotal energy sector decisions from the past 20 years.",
"your-role": {
"heading": "What's your role?",
"content": "In each of the 8 scenarios, you will be asked to act as the CEO of PetroSA for the period in question."
},
"what-is-petro-sa": {
"heading": "Who or what is PetroSA?",
"content": "PetroSA is one of the key state owned companies in South Africa’s energy sector, and was formed in 2002 as a result of the merger of several older organisations which looked after oil and gas supplies. Its parent organisation is the Central Energy Fund (CEF), and it reports to the Department of Energy. PetroSA’s role today includes offshore prospecting for natural gas, importing diesel and managing gas to liquid (GTL) refineries."
},
"scenario-steps": {
"heading": "Scenario steps",
"content": "Each scenario will guide you through 4 steps to get you up to speed, present you with a dilemma and a set of decisions, and then give you the information about what really happened!"
},
"step-1": {
"label": "Step 1",
"heading": "The set-up",
"content": "Read the briefing and check out the investigation board to understand the factors at play in each scenario."
},
"step-2": {
"label": "Step 2",
"heading": "The dilemma",
"content": "You will be presented with a dilemma from the past that will test your moral and ethical boundaries."
},
"step-3": {
"label": "Step 3",
"heading": "The choices",
"content": "Assess your options and make the choice that feels right to you!"
},
"step-4": {
"label": "Step 4",
"heading": "The real story",
"content": "See how your answer compares to the decision that was actually taken and get more information about what went down. You might be surprised!"
},
"end-line": "Ready to get started? Good luck!"
},
"debrief": {
"title": "What now?",
"sub-title": "The debrief",
"intro": "So you’re done playing... what next?",
"references": "References"
},
"references": {
"title": "Want to learn more?",
"sub-title": "References",
"back": "Back"
},
"global": {
"title": "Green Connection's",
"title-name": "Gaslit! (af)",
"sub-title": "The game of greed and gas at PetroSA",
"scenarios": [
{
"format": "normal",
"slug": "getting-started",
"title": "Getting started!",
"setup": "Congratulations! You have just been appointment as CEO of the newly formed SOE, PetroSA. One of your first tasks is to secure a supply of oil for the Strategic Fuel Fund (SFF - aka “the strategic reserve”).",
"dilema": "You have found a potential source for this oil. A politically linked company has a deal via Glencore for getting oil out of sanctioned Iraq, but needs cash up front to do the job.",
"options": [
{
"text": "Refuse the deal and insist on a transparent tender process in line with procurement regulations",
"goto": "incorrect"
},
{
"text": "Refuse the deal and report the issue to parliamentary oversight committees",
"goto": "correct"
},
{
"text": "Hand over the cash!",
"goto": "incorrect"
}
],
"answers": {
"correct": {
"title": "You handed over the cash, well done!",
"description": "PetroSA seemingly handed over several early payments to Imvume Management, a company which was later accused by an independent inquiry of illicit dealing under the oil-for-food programme in Iraq - and it did so, apparently, with the government&apos;s blessing. At least R11m of the money paid from PetroSA was alleged to have ended up going back to the ANC to fund its 2004 election campaign. Here&apos;s the real kicker - most of the Iraqi oil never actually came to SA, and you ended up buying from Russia instead! Start as you mean to go on."
},
"incorrect": {
"title": "Are you sure you are cut out for this business?",
"description": "PetroSA seemingly handed over several early payments to Imvume Management, a company which was later accused by an independent inquiry of illicit dealing under the oil-for-food programme in Iraq - and it did so, apparently, with the government&apos;s blessing. At least R11m of the money paid from PetroSA was alleged to have ended up going back to the ANC to fund its 2004 election campaign. Here&apos;s the real kicker - most of the Iraqi oil never actually came to SA, and you ended up buying from Russia instead! Start as you mean to go on."
}
}
},
{
"format": "normal",
"slug": "lorem-ipsum-doler",
"title": "Lorem ipsum doler",
"setup": "Lorem ipsum doler sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"dilema": "Ipsum doler sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"options": [
{
"text": "Lorem ipsum 1",
"goto": "incorrect"
},
{
"text": "Doler sit amet 2",
"goto": "incorrect"
},
{
"text": "Sit amet lorem 3",
"goto": "correct"
}
],
"answers": {
"correct": {
"title": "Lorem dipsum, well done!",
"description": "Ipsum doler sit amet adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
},
"incorrect": {
"title": "Are you sure you are cut out for this business?",
"description": "Ipsum doler sit amet adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Start as you mean to go on."
}
}
},
{
"format": "no-correct-incorrect",
"slug": "lorem-ipsum-doler-2",
"title": "Lorem ipsum doler 2",
"setup": "Lorem ipsum doler sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"dilema": "Ipsum doler sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"options": [
{
"text": "Lorem ipsum 1",
"goto": "answer"
},
{
"text": "Doler sit amet 2",
"goto": "answer"
},
{
"text": "Sit amet lorem 3",
"goto": "answer"
}
],
"answers": {
"answer": {
"title": "Lorem dipsum!",
"description": "Ipsum doler sit amet adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
}
}
}
]
}
}
81 changes: 60 additions & 21 deletions messages/zu.json → messages/xh.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,69 @@
{
"metadata": {
"title": "Amafutha Namanzi E-Green Connection",
"description": "by Green Connection and OpenUp"
"title": "Green Connection's Gaslit! (isiXhosa)",
"description": "by Green Connection and OpenUp (isiXhosa)"
},
"home": {
"get-started": "How does it work?",
"credit": "A news game created by"
},
"how-does-it-work": {
"sub-title": "Introduction page sub-title",
"get-started": "Qalisa",
"intro": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
"title": "Before you get started",
"sub-title": "How does it work?",
"get-started": "Get started",
"intro": "This game features <strong>8 scenarios</strong> that will put you in the drivers seat behind some of South Africa’s most pivotal energy sector decisions from the past 20 years.",
"your-role": {
"heading": "What's your role?",
"content": "In each of the 8 scenarios, you will be asked to act as the CEO of PetroSA for the period in question."
},
"what-is-petro-sa": {
"heading": "Who or what is PetroSA?",
"content": "PetroSA is one of the key state owned companies in South Africa’s energy sector, and was formed in 2002 as a result of the merger of several older organisations which looked after oil and gas supplies. Its parent organisation is the Central Energy Fund (CEF), and it reports to the Department of Energy. PetroSA’s role today includes offshore prospecting for natural gas, importing diesel and managing gas to liquid (GTL) refineries."
},
"scenario-steps": {
"heading": "Scenario steps",
"content": "Each scenario will guide you through 4 steps to get you up to speed, present you with a dilemma and a set of decisions, and then give you the information about what really happened!"
},
"step-1": {
"label": "Step 1",
"heading": "The set-up",
"content": "Read the briefing and check out the investigation board to understand the factors at play in each scenario."
},
"step-2": {
"label": "Step 2",
"heading": "The dilemma",
"content": "You will be presented with a dilemma from the past that will test your moral and ethical boundaries."
},
"step-3": {
"label": "Step 3",
"heading": "The choices",
"content": "Assess your options and make the choice that feels right to you!"
},
"step-4": {
"label": "Step 4",
"heading": "The real story",
"content": "See how your answer compares to the decision that was actually taken and get more information about what went down. You might be surprised!"
},
"end-line": "Ready to get started? Good luck!"
},
"results": {
"sub-title": "Imiphumela",
"score": "Uqedele izimo. Uthole okungu-{totalScore} kokungu-{score}.",
"start-over": "Qala futhi"
"debrief": {
"title": "What now?",
"sub-title": "The debrief",
"intro": "So you’re done playing... what next?",
"references": "References"
},
"references": {
"title": "Want to learn more?",
"sub-title": "References",
"back": "Back"
},
"global": {
"title": "Amafutha Namanzi E-Green Connection",
"title-name": "Gaslit!",
"sub-title": "Ezombusazwe, amakhemikhali e-petrochemicals kanye nezivumelwano ze-dog",
"title": "Green Connection's",
"title-name": "Gaslit! (xh)",
"sub-title": "The game of greed and gas at PetroSA",
"scenarios": [
{
"format": "normal",
"slug": "getting-started",
"title": "Getting started!",
"setup": "Congratulations! You have just been appointment as CEO of the newly formed SOE, PetroSA. One of your first tasks is to secure a supply of oil for the Strategic Fuel Fund (SFF - aka “the strategic reserve”).",
Expand Down Expand Up @@ -53,6 +94,7 @@
}
},
{
"format": "normal",
"slug": "lorem-ipsum-doler",
"title": "Lorem ipsum doler",
"setup": "Lorem ipsum doler sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
Expand Down Expand Up @@ -83,32 +125,29 @@
}
},
{
"format": "no-correct-incorrect",
"slug": "lorem-ipsum-doler-2",
"title": "Lorem ipsum doler 2",
"setup": "Lorem ipsum doler sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"dilema": "Ipsum doler sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"options": [
{
"text": "Lorem ipsum 1",
"goto": "correct"
"goto": "answer"
},
{
"text": "Doler sit amet 2",
"goto": "incorrect"
"goto": "answer"
},
{
"text": "Sit amet lorem 3",
"goto": "incorrect"
"goto": "answer"
}
],
"answers": {
"correct": {
"title": "Lorem dipsum, well done!",
"answer": {
"title": "Lorem dipsum!",
"description": "Ipsum doler sit amet adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
},
"incorrect": {
"title": "Are you sure you are cut out for this business?",
"description": "Ipsum doler sit amet adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Start as you mean to go on."
}
}
}
Expand Down
18 changes: 10 additions & 8 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import createMiddleware from "next-intl/middleware";
import { NextRequest } from "next/server";
import { locales } from "i18n";

export default createMiddleware({
// A list of all locales that are supported
locales: locales,

// Used when no locale matches
defaultLocale: locales[0],
});
export default async function middleware(request: NextRequest) {
const handleI18nRouting = createMiddleware({
locales: locales,
defaultLocale: locales[0],
});
const response = handleI18nRouting(request);
return response;
}

export const config = {
matcher: ["/", "/(zu|en)/:path*"],
matcher: ["/", "/(en|xh|af)/:path*"],
};
Binary file added public/images/af/home/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/af/how-does-it-work/step-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/af/how-does-it-work/step-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/af/how-does-it-work/step-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/af/how-does-it-work/step-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/af/how-does-it-work/your-role.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/xh/home/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/xh/how-does-it-work/step-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/xh/how-does-it-work/step-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/xh/how-does-it-work/step-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/xh/how-does-it-work/step-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/xh/how-does-it-work/your-role.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/zu/home/main.png
Binary file not shown.

0 comments on commit 2d894c9

Please sign in to comment.