Skip to content

Commit 9355785

Browse files
Frontend/i18n: Localize app store badges (#8673)
1 parent c600514 commit 9355785

52 files changed

Lines changed: 2872 additions & 110 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/web/components/Footer/Footer.tsx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export default function Footer({ bottomMargin }: { bottomMargin?: string }) {
257257
rel="noopener noreferrer"
258258
>
259259
<img
260-
src="/img/Download_on_the_App_Store_Badge_US-UK_RGB_blk_092917.svg"
260+
src={`/img/app-store-badge/${locale}.svg`}
261261
alt={t("app_store_badge_a11y")}
262262
style={{ height: "26px", width: "auto", display: "block" }}
263263
/>
@@ -267,26 +267,11 @@ export default function Footer({ bottomMargin }: { bottomMargin?: string }) {
267267
target="_blank"
268268
rel="noopener noreferrer"
269269
>
270-
<div
271-
style={{
272-
height: "26px",
273-
width: "87.75px",
274-
overflow: "hidden",
275-
position: "relative",
276-
}}
277-
>
278-
<img
279-
src="/img/GetItOnGooglePlay_Badge_Web_color_English.svg"
280-
alt={t("google_play_badge_a11y")}
281-
style={{
282-
height: "39px",
283-
width: "auto",
284-
position: "absolute",
285-
top: "-6.5px",
286-
left: "-6.5px",
287-
}}
288-
/>
289-
</div>
270+
<img
271+
src={`/img/google-play-badge/${locale}.svg`}
272+
alt={t("google_play_badge_a11y")}
273+
style={{ height: "26px", width: "auto", display: "block" }}
274+
/>
290275
</a>
291276
</Box>
292277
<StyledSocialIconsContainer>

app/web/features/auth/verification/StrongVerificationPage.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import { service } from "service";
2424
import { theme } from "theme";
2525

2626
export default function StrongVerificationInstructions() {
27-
const { t } = useTranslation([GLOBAL, AUTH]);
27+
const {
28+
t,
29+
i18n: { language: locale },
30+
} = useTranslation([GLOBAL, AUTH]);
2831

2932
const {
3033
error,
@@ -151,7 +154,7 @@ export default function StrongVerificationInstructions() {
151154
rel="noopener noreferrer"
152155
>
153156
<img
154-
src="/img/Download_on_the_App_Store_Badge_US-UK_RGB_blk_092917.svg"
157+
src={`/img/app-store-badge/${locale}.svg`}
155158
alt={t(
156159
"auth:strong_verification.instructions.download_app_store",
157160
)}
@@ -164,11 +167,11 @@ export default function StrongVerificationInstructions() {
164167
rel="noopener noreferrer"
165168
>
166169
<img
167-
src="/img/GetItOnGooglePlay_Badge_Web_color_English.svg"
170+
src={`/img/google-play-badge/${locale}.svg`}
168171
alt={t(
169172
"auth:strong_verification.instructions.download_google_play",
170173
)}
171-
style={{ height: "45px", width: "auto" }}
174+
style={{ height: "30px", width: "auto" }}
172175
/>
173176
</a>
174177
</Box>

app/web/features/landing/CouchersIntroduction.tsx

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@ import {
1212
import { theme } from "theme";
1313

1414
function AppStoreBadges({ appStoreHeight = 38 }: { appStoreHeight?: number }) {
15-
const { t } = useTranslation(GLOBAL);
16-
// Google Play SVG (viewBox 155×60) has 10px internal padding on all sides;
17-
// content rect is x=10 y=10 w=135 h=40. Render at 1.5× so the content
18-
// matches appStoreHeight, then clip the transparent padding with a wrapper.
19-
const googlePlayHeight = appStoreHeight * 1.5;
20-
const googlePlayPadding = appStoreHeight / 4; // 10/40 × appStoreHeight
21-
const googlePlayContentWidth = appStoreHeight * 3.375; // 135/40 × appStoreHeight
15+
const {
16+
t,
17+
i18n: { language: locale },
18+
} = useTranslation(GLOBAL);
2219
return (
2320
<Stack
2421
direction="row"
@@ -31,7 +28,7 @@ function AppStoreBadges({ appStoreHeight = 38 }: { appStoreHeight?: number }) {
3128
>
3229
<a href={couchersAppStoreURL} target="_blank" rel="noopener noreferrer">
3330
<img
34-
src="/img/Download_on_the_App_Store_Badge_US-UK_RGB_blk_092917.svg"
31+
src={`/img/app-store-badge/${locale}.svg`}
3532
alt={t("app_store_badge_a11y")}
3633
style={{
3734
height: `${appStoreHeight}px`,
@@ -41,26 +38,15 @@ function AppStoreBadges({ appStoreHeight = 38 }: { appStoreHeight?: number }) {
4138
/>
4239
</a>
4340
<a href={couchersGooglePlayURL} target="_blank" rel="noopener noreferrer">
44-
<div
41+
<img
42+
src={`/img/google-play-badge/${locale}.svg`}
43+
alt={t("google_play_badge_a11y")}
4544
style={{
4645
height: `${appStoreHeight}px`,
47-
width: `${googlePlayContentWidth}px`,
48-
overflow: "hidden",
49-
position: "relative",
46+
width: "auto",
47+
display: "block",
5048
}}
51-
>
52-
<img
53-
src="/img/GetItOnGooglePlay_Badge_Web_color_English.svg"
54-
alt={t("google_play_badge_a11y")}
55-
style={{
56-
height: `${googlePlayHeight}px`,
57-
width: "auto",
58-
position: "absolute",
59-
top: `-${googlePlayPadding}px`,
60-
left: `-${googlePlayPadding}px`,
61-
}}
62-
/>
63-
</div>
49+
/>
6450
</a>
6551
</Stack>
6652
);

app/web/public/img/GetItOnGooglePlay_Badge_Web_color_English.svg

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)