Skip to content
This repository was archived by the owner on Jul 14, 2024. It is now read-only.

Commit 64f123f

Browse files
authored
Merge pull request #22 from commoncode/feature/french-translation
translate ending captions in French
2 parents e9628eb + 5c14bf0 commit 64f123f

5 files changed

Lines changed: 118 additions & 63 deletions

File tree

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
import Caption from "../../Caption";
22

3-
const Argument = ({ x, y, language, isToggled }) => {
4-
let text = null;
3+
const Argument = ({x, y, language, isToggled}) => {
4+
let text = null;
55

6-
switch (language) {
7-
case "english":
8-
text = (
9-
<>
10-
This is too much! I told you this submarine was in a bad shape. It is
11-
as rusty as my love for you.{" "}
12-
<strong>This relationship is beyond repair!</strong> I'm done!
13-
</>
14-
);
15-
break;
16-
case "french":
17-
text = (
18-
<>
19-
Y'en a marre! J't'avais bien dit que ce sous-marin était dans un sale
20-
état. Il est aussi rouillé que mon amour pour toi. Notre couple est
21-
irréparable! J'en ai fini avec toi!
22-
</>
23-
);
24-
break;
25-
}
6+
switch (language) {
7+
case "english":
8+
text = (
9+
<>
10+
This is too much! I told you this submarine was in a bad shape. It is
11+
as rusty as my love for you.{" "}
12+
<strong>This relationship is beyond repair!</strong> I'm done!
13+
</>
14+
);
15+
break;
16+
case "french":
17+
text = (
18+
<>
19+
Y'en a marre! J't'avais bien dit que ce sous-marin était dans un sale
20+
état. Il est aussi rouillé que mon amour pour toi.{" "}
21+
<strong>J'en ai fini avec toi!</strong>
22+
</>
23+
);
24+
break;
25+
}
2626

27-
return (
28-
<Caption x={x} y={y} isToggled={isToggled} tail={"bottomRight"}>
29-
{text}
30-
</Caption>
31-
);
27+
return (
28+
<Caption x={x} y={y} isToggled={isToggled} tail={"bottomRight"}>
29+
{text}
30+
</Caption>
31+
);
3232
};
3333

3434
export default Argument;

components/core/EndingOverlay/EndingOverlay.tsx

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React, { useEffect } from 'react';
22
import styled from 'styled-components';
33

4+
import {Ending1, Ending2, Ending3} from './ending-captions';
5+
46
const OverlayModal = styled.div`
57
position: fixed;
68
top: 0;
@@ -17,25 +19,12 @@ const OverlayModal = styled.div`
1719
width: 100%;
1820
`;
1921

20-
const Column = styled.div`
21-
display: flex;
22-
flex-direction: column;
23-
align-items: center;
24-
justify-content: center;
25-
`;
26-
27-
const Text = styled.span`
28-
color: #020D18;
29-
font-size: 30px;
30-
font-weight: bold;
31-
`;
32-
33-
3422
type OverlayProps = {
3523
typeEnding: number;
24+
language: string;
3625
};
3726

38-
const Modal = ({ typeEnding }: OverlayProps) => {
27+
const Modal = ({typeEnding, language}: OverlayProps) => {
3928
useEffect(() => {
4029
document.body.style.overflow = 'hidden';
4130

@@ -49,37 +38,21 @@ const Modal = ({ typeEnding }: OverlayProps) => {
4938
{/* Up the hatch, love meter low */}
5039
{
5140
typeEnding === 1 && (
52-
<Column>
53-
<Text>Moustachio climbs up the hatch...</Text>
54-
<Text>and closes it behind him.</Text>
55-
<Text>Guess he really doesn't love you anymore</Text>
56-
<Text>You die.</Text>
57-
</Column>
41+
<Ending1 language={language}/>
5842
)
59-
6043
}
6144

6245
{/* Up the hatch, love meter high */}
6346
{
6447
typeEnding === 2 && (
65-
<Column>
66-
<Text>Moustachio climbs up the hatch and you scramble out after him</Text>
67-
<Text>Escaping certain death reminded him how much he loves you</Text>
68-
<Text>You both live happily ever after on a tropical deserted island</Text>
69-
<Text>Cute!</Text>
70-
</Column>
48+
<Ending2 language={language}/>
7149
)
7250
}
7351

7452
{/* Breaking the glass, bleeding out */}
7553
{
7654
typeEnding === 3 && (
77-
<Column>
78-
<Text>Punching the glass was a real dumb idea</Text>
79-
<Text>You slice your hand open and bleed to death</Text>
80-
<Text>Moustachio has to clean up the mess.</Text>
81-
<Text>So now you're dead and single.</Text>
82-
</Column>
55+
<Ending3 language={language}/>
8356
)
8457
}
8558
</OverlayModal>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import React from 'react'
2+
import styled from 'styled-components'
3+
4+
const Column = styled.div`
5+
display: flex;
6+
flex-direction: column;
7+
align-items: center;
8+
justify-content: center;
9+
`;
10+
11+
const Text = styled.span`
12+
color: #020D18;
13+
font-size: 30px;
14+
font-weight: bold;
15+
`;
16+
17+
export const Ending1 = ({language}) => {
18+
switch (language) {
19+
case "english":
20+
return (
21+
<Column>
22+
<Text>Moustachio climbs up the hatch...</Text>
23+
<Text>and closes it behind him.</Text>
24+
<Text>Guess he really doesn't love you anymore</Text>
25+
<Text>You die.</Text>
26+
</Column>
27+
)
28+
case "french":
29+
return (
30+
<Column>
31+
<Text>Moustachio sort par la trappe du sous-marin...</Text>
32+
<Text>et la referme derrière lui.</Text>
33+
<Text>C'est la fin de votre histoire d'amour.</Text>
34+
<Text>Vous mourrez seul.</Text>
35+
</Column>
36+
)
37+
}
38+
}
39+
40+
export const Ending2 = ({language}) => {
41+
switch (language) {
42+
case "english":
43+
return (
44+
<Column>
45+
<Text>Moustachio climbs up the hatch and you scramble out after him</Text>
46+
<Text>Escaping certain death reminded him how much he loves you</Text>
47+
<Text>You both live happily ever after on a tropical deserted island</Text>
48+
<Text>Cute!</Text>
49+
</Column>
50+
)
51+
case "french":
52+
return (
53+
<Column>
54+
<Text>Moustachio sort par la trappe du sous-marin et vous le suivez</Text>
55+
<Text>Echapper une mort certaine lui rappelle à quel point il vous aime</Text>
56+
<Text>Vous vivrez heureux ensemble sur une île tropicale déserte.</Text>
57+
</Column>
58+
)
59+
}
60+
}
61+
62+
export const Ending3 = ({language}) => {
63+
switch (language) {
64+
case "english":
65+
return (
66+
<Column>
67+
<Text>Punching the glass was a real dumb idea</Text>
68+
<Text>You slice your hand open and bleed to death</Text>
69+
<Text>Moustachio has to clean up the mess.</Text>
70+
<Text>So now you're dead and single.</Text>
71+
</Column>
72+
)
73+
case "french":
74+
return (
75+
<Column>
76+
<Text>Briser la glace avec votre poing était vraiment une idée stupide.</Text>
77+
<Text>Vous vous videz de votre sang et Moustachio doit nettoyer derrière vous.</Text>
78+
<Text>Vous êtes mort (et célibataire)</Text>
79+
</Column>
80+
)
81+
}
82+
}

components/core/Game/Game.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const Game = () => {
129129
<>
130130
<GlobalStyle />
131131
<OverlayNotClickable isToggled={showOverlayNotClickable} />
132-
{typeEnding && <EndingOverlay typeEnding={typeEnding} />}
132+
{typeEnding && <EndingOverlay typeEnding={typeEnding} language={language} />}
133133
<Water />
134134
<LoveMeter progressLove={progressLove} />
135135
<Stage

components/events/Actions/ActionsBedroom.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from "react";
1+
import React, { useEffect, useState } from "react";
22

33
import ActionEvent from "./ActionEvent";
44
import Leak from "../Leak";

0 commit comments

Comments
 (0)