Skip to content

Commit 2b0f898

Browse files
shakyShaneShane Osbournevkraucunas
authored
ntp: added translations (#1279)
* ntp: added translations * further UI tweaks * fix: wordwrap in nextsteps cards * prevent default padding on button * chore: Add hover and active states to list expander button * right-align expander with bars * don't use the offset when collapsed --------- Co-authored-by: Shane Osbourne <[email protected]> Co-authored-by: Valerie Kraucunas <[email protected]>
1 parent 12f5579 commit 2b0f898

File tree

13 files changed

+1437
-10
lines changed

13 files changed

+1437
-10
lines changed

special-pages/pages/new-tab/app/components/ShowHide.module.css

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
height: 2rem;
1818
width: 2rem;
1919
border-radius: 50%;
20+
padding-inline: 0;
2021

2122
&:focus-visible {
2223
box-shadow: var(--focus-ring);
@@ -28,6 +29,14 @@
2829
svg {
2930
margin-right: var(--sp-2);
3031
}
32+
33+
&:hover {
34+
background-color: var(--color-black-at-9);
35+
}
36+
37+
&:active {
38+
background-color: var(--color-black-at-12);
39+
}
3140
}
3241

3342
svg {
@@ -46,6 +55,14 @@
4655
@media (prefers-color-scheme: dark) {
4756
&.withText {
4857
border-color: var(--color-white-at-9);
58+
59+
&:hover {
60+
background-color: var(--color-white-at-9);
61+
}
62+
63+
&:active {
64+
background-color: var(--color-white-at-12);
65+
}
4966
}
5067
}
51-
}
68+
}

special-pages/pages/new-tab/app/customizer/components/Customizer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styles from './Customizer.module.css';
44
import { VisibilityMenu } from './VisibilityMenu.js';
55
import { CustomizeIcon } from '../../components/Icons.js';
66
import cn from 'classnames';
7-
import { useMessaging } from '../../types.js';
7+
import { useMessaging, useTypedTranslation } from '../../types.js';
88

99
/**
1010
* @import { Widgets, WidgetConfigItem, WidgetVisibility, VisibilityMenuItem } from '../../../../../types/new-tab.js'
@@ -107,6 +107,7 @@ export function useContextMenu() {
107107
* @param {import("preact").Ref<HTMLButtonElement>} [props.buttonRef]
108108
*/
109109
export function CustomizerButton({ menuId, buttonId, isOpen, toggleMenu, buttonRef }) {
110+
const { t } = useTypedTranslation();
110111
return (
111112
<button
112113
ref={buttonRef}
@@ -118,7 +119,7 @@ export function CustomizerButton({ menuId, buttonId, isOpen, toggleMenu, buttonR
118119
id={buttonId}
119120
>
120121
<CustomizeIcon />
121-
<span>Customize</span>
122+
<span>{t('ntp_customizer_button')}</span>
122123
</button>
123124
);
124125
}

special-pages/pages/new-tab/app/favorites/components/Favorites.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ function Inner({ rows, safeAreaRef, rowHeight, add }) {
209209
setVisibleRows();
210210

211211
const controller = new AbortController();
212+
212213
window.addEventListener(
213214
'resize',
214215
() => {
@@ -248,7 +249,7 @@ function Inner({ rows, safeAreaRef, rowHeight, add }) {
248249
return (
249250
<Fragment>
250251
{subsetOfRowsToRender.map((items, rowIndex) => {
251-
const topOffset = (start + rowIndex) * rowHeight;
252+
const topOffset = expansion === 'expanded' ? (start + rowIndex) * rowHeight : 0;
252253
const keyed = `-${start + rowIndex}-`;
253254
return <TileRow key={keyed} dropped={dropped} items={items} topOffset={topOffset} add={add} />;
254255
})}

special-pages/pages/new-tab/app/next-steps/components/NextSteps.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@
4242
background-color: transparent;
4343
border-width: 0;
4444
border-radius: var(--border-radius-sm);
45-
text-wrap: nowrap;
4645
font-weight: 600;
4746
font-size: calc(11 * var(--px-in-rem));
48-
line-height: 1;
47+
line-height: calc(14 * var(--px-in-rem));
4948
color: var(--ntp-color-primary);
5049

5150
&:hover {

special-pages/pages/new-tab/app/privacy-stats/components/PrivacyStats.module.css

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
display: flex;
4343
align-items: center;
4444
justify-content: center;
45-
padding-top: 2px;
45+
padding-top: 0.5px;
4646
}
4747

4848
.title {
@@ -60,6 +60,12 @@
6060
top: 50%;
6161
transform: translateY(-50%);
6262
opacity: 1;
63+
/**
64+
* NOTE: This is just for visual alignment. The grid in which this sits is correct,
65+
* but to preserve the larger tap-area for the button, we're opting to shift this over
66+
* manually to solve this specific layout case.
67+
*/
68+
right: -4px
6369
}
6470
}
6571

@@ -133,7 +139,7 @@
133139
align-items: center;
134140

135141
@media screen and (min-width: 500px) {
136-
grid-template-columns: auto auto 60%;
142+
grid-template-columns: 35% 10% calc(55% - 1rem); /* - 1rem accounts for the grid gaps */
137143
}
138144
}
139145

@@ -149,6 +155,7 @@
149155
align-items: center;
150156
gap: var(--sp-2);
151157
padding-left: var(--sp-1);
158+
overflow: hidden;
152159
}
153160

154161
.icon {
@@ -184,7 +191,12 @@
184191
.name {
185192
font-size: var(--title-3-em-font-size);
186193
font-weight: var(--title-3-em-font-weight);
187-
line-height: 1;
194+
text-overflow: ellipsis;
195+
display: block;
196+
overflow: hidden;
197+
white-space: nowrap;
198+
position: relative;
199+
top: -1px;
188200
}
189201

190202
.count {
@@ -224,4 +236,4 @@
224236
color: var(--ntp-text-muted);
225237
opacity: 1;
226238
}
227-
}
239+
}

special-pages/pages/new-tab/app/strings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"title": "Dismiss",
1212
"note": "Button that closes or hides the current popup or notification."
1313
},
14+
"ntp_customizer_button": {
15+
"title": "Customize",
16+
"note": "Button opens a menu. The menu allows the user to customize the page, such as showing/hiding sections."
17+
},
1418
"widgets_visibility_menu_title": {
1519
"title": "Customize New Tab Page",
1620
"note": "Heading text describing that there's a list of toggles for customizing the page layout."
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
{
2+
"smartling" : {
3+
"string_format" : "icu",
4+
"translate_paths" : [
5+
{
6+
"path" : "*/title",
7+
"key" : "{*}/title",
8+
"instruction" : "*/note"
9+
}]
10+
},
11+
"ntp_show_less" : {
12+
"title" : "Weniger anzeigen",
13+
"note" : "Button that reduces the number of items or content displayed."
14+
},
15+
"ntp_show_more" : {
16+
"title" : "Mehr anzeigen",
17+
"note" : "Button that increases the number of items or content displayed."
18+
},
19+
"ntp_dismiss" : {
20+
"title" : "Verwerfen",
21+
"note" : "Button that closes or hides the current popup or notification."
22+
},
23+
"ntp_customizer_button" : {
24+
"title" : "Anpassen",
25+
"note" : "Button opens a menu. The menu allows the user to customize the page, such as showing/hiding sections."
26+
},
27+
"widgets_visibility_menu_title" : {
28+
"title" : "Neuen Tab anpassen",
29+
"note" : "Heading text describing that there's a list of toggles for customizing the page layout."
30+
},
31+
"updateNotification_updated_version" : {
32+
"title" : "Browser auf Version {version} aktualisiert.",
33+
"note" : "Text to indicate which new version was updated. `{version}` will be formatted like `1.22.0`"
34+
},
35+
"updateNotification_whats_new" : {
36+
"title" : "Sieh dir an, was es in dieser Version <a>Neues</a> gibt.",
37+
"note" : "The `<a>` tag represents a clickable link, please preserve it."
38+
},
39+
"updateNotification_dismiss_btn" : {
40+
"title" : "Verwerfen",
41+
"note" : "Button label text for an action that removes the widget from the screen."
42+
},
43+
"stats_menuTitle" : {
44+
"title" : "Blockierte Tracking-Versuche",
45+
"note" : "Used as a label in a customization menu"
46+
},
47+
"stats_noActivity" : {
48+
"title" : "Blockierte Tracking-Versuche werden hier angezeigt. Browse weiter, um zu sehen, wie viele wir blockieren.",
49+
"note" : "Placeholder for when we cannot report any blocked trackers yet"
50+
},
51+
"stats_noRecent" : {
52+
"title" : "Keine aktuellen Tracking-Aktivitäten",
53+
"note" : "Placeholder to indicate that no tracking activity was blocked in the last 7 days"
54+
},
55+
"stats_countBlockedSingular" : {
56+
"title" : "1 Tracking-Versuch blockiert",
57+
"note" : "The main headline indicating that a single tracker was blocked"
58+
},
59+
"stats_countBlockedPlural" : {
60+
"title" : "{count} Tracking-Versuche blockiert",
61+
"note" : "The main headline indicating that more than 1 attempt has been blocked. Eg: '2 tracking attempts blocked'"
62+
},
63+
"stats_feedCountBlockedSingular" : {
64+
"title" : "1 Versuch von DuckDuckGo in den letzten 7 Tagen blockiert",
65+
"note" : "A summary description of how many tracking attempts where blocked, when only one exists."
66+
},
67+
"stats_feedCountBlockedPeriod" : {
68+
"title" : "Vergangene 7 Tage",
69+
"note" : "A summary description indicating the time period of the blocked tracking attempts, which is the past 7 days."
70+
},
71+
"stats_feedCountBlockedPlural" : {
72+
"title" : "{count} Tracking-Versuche blockiert",
73+
"note" : "A summary description of how many tracking attempts were blocked by DuckDuckGo in the last 7 days when there is more than one. E.g., '1,028 tracking attempts blocked."
74+
},
75+
"stats_toggleLabel" : {
76+
"title" : "Aktuelle Aktivität anzeigen",
77+
"note" : "The aria-label text for a toggle button that shows the detailed activity feed"
78+
},
79+
"stats_hideLabel" : {
80+
"title" : "Letzte Aktivitäten ausblenden",
81+
"note" : "The aria-label text for a toggle button that hides the detailed activity feed"
82+
},
83+
"stats_otherCompanyName" : {
84+
"title" : "Anderes",
85+
"note" : "A placeholder to represent an aggregated count of entries, not present in the rest of the list. For example, 'Other: 200', which would mean 200 entries excluding the ones already shown"
86+
},
87+
"stats_otherCount" : {
88+
"title" : "{count} Versuche von anderen Netzwerken",
89+
"note" : "An aggregated count of blocked entries not present in the main list. For example, '200 attempts from other networks'"
90+
},
91+
"nextSteps_sectionTitle" : {
92+
"title" : "Nächste Schritte",
93+
"note" : "Text that goes in the Next Steps bubble above the first card"
94+
},
95+
"nextSteps_bringStuff_title" : {
96+
"title" : "Bring deine Sachen",
97+
"note" : "Title of the Next Steps card for importing bookmarks and favorites"
98+
},
99+
"nextSteps_bringStuff_summary" : {
100+
"title" : "Importiere Lesezeichen, Favoriten und Passwörter für einen reibungslosen Übergang von deinem alten Browser.",
101+
"note" : "Summary of the Next Steps card for importing bookmarks and favorites"
102+
},
103+
"nextSteps_bringStuff_actionText" : {
104+
"title" : "Jetzt importieren",
105+
"note" : "Button text of the Next Steps card for importing bookmarks and favorites"
106+
},
107+
"nextSteps_defaultApp_title" : {
108+
"title" : "Als Standard-Browser festlegen",
109+
"note" : "Title of the Next Steps card for making DDG the user's default browser"
110+
},
111+
"nextSteps_defaultApp_summary" : {
112+
"title" : "Wir blockieren automatisch Tracker, während du browst. Das ist Datenschutz, vereinfacht.",
113+
"note" : "Summary of the Next Steps card for making DDG the user's default browser"
114+
},
115+
"nextSteps_defaultApp_actionText" : {
116+
"title" : "Standardbrowser erstellen",
117+
"note" : "Button text of the Next Steps card for making DDG the user's default browser"
118+
},
119+
"nextSteps_blockCookies_title" : {
120+
"title" : "Cookie-Pop-ups blockieren",
121+
"note" : "Title of the Next Steps card for blocking cookie pop-ups"
122+
},
123+
"nextSteps_blockCookies_summary" : {
124+
"title" : "Wir brauchen deine Erlaubnis, um in deinem Namen Cookies abzulehnen. Leichte Entscheidung.",
125+
"note" : "Summary of the Next Steps card for blocking cookie pop-ups"
126+
},
127+
"nextSteps_blockCookies_actionText" : {
128+
"title" : "Cookie-Pop-ups blockieren",
129+
"note" : "Button text of the Next Steps card for blocking cookie pop-ups"
130+
},
131+
"nextSteps_emailProtection_title" : {
132+
"title" : "Schütze deinen Posteingang",
133+
"note" : "Title of the Next Steps card for email protection"
134+
},
135+
"nextSteps_emailProtection_summary" : {
136+
"title" : "Erstelle @duck.com-Adressen, die Tracker aus E-Mails entfernen und an deinen Posteingang weiterleiten.",
137+
"note" : "Summary of the Next Steps card for email protection"
138+
},
139+
"nextSteps_emailProtection_actionText" : {
140+
"title" : "Email-Schutz erhalten",
141+
"note" : "Button text of the Next Steps card for email protection"
142+
},
143+
"nextSteps_duckPlayer_title" : {
144+
"title" : "YouTube ohne aufdringliche Werbung",
145+
"note" : "Title of the Next Steps card for adopting DuckPlayer"
146+
},
147+
"nextSteps_duckPlayer_summary" : {
148+
"title" : "Genieße ein sauberes Seherlebnis ohne personalisierte Werbung.",
149+
"note" : "Summary of the Next Steps card for adopting DuckPlayer"
150+
},
151+
"nextSteps_duckPlayer_actionText" : {
152+
"title" : "Duck Player testen",
153+
"note" : "Button text of the Next Steps card for adopting DuckPlayer"
154+
},
155+
"nextSteps_addAppDockMac_title" : {
156+
"title" : "App zum Dock hinzufügen",
157+
"note" : "Title of the Next Steps card for adding DDG app to OS dock"
158+
},
159+
"nextSteps_addAppDockMac_summary" : {
160+
"title" : "Greife schneller auf DuckDuckGo zu, indem du es zum Dock hinzufügst.",
161+
"note" : "Summary of the Next Steps card for adding DDG app to OS dock"
162+
},
163+
"nextSteps_addAppDockMac_actionText" : {
164+
"title" : "Zum Dock hinzufügen",
165+
"note" : "Initial button text of the Next Steps card for adding DDG app to OS dock"
166+
},
167+
"nextSteps_addAppDockMac_confirmationText" : {
168+
"title" : "Zum Dock hinzugefügt!",
169+
"note" : "Button text after clicking on the Next Steps card for adding DDG app to OS dock"
170+
},
171+
"nextSteps_pinAppToTaskbarWindows_title" : {
172+
"title" : "App an die Taskleiste anheften",
173+
"note" : "Title of the Next Steps card for adding DDG app to OS dock"
174+
},
175+
"nextSteps_pinAppToTaskbarWindows_summary" : {
176+
"title" : "Greife schneller auf DuckDuckGo zu, indem du es an die Taskleiste heftest.",
177+
"note" : "Summary of the Next Steps card for adding DDG app to OS dock"
178+
},
179+
"nextSteps_pinAppToTaskbarWindows_actionText" : {
180+
"title" : "An Taskleiste pinnen",
181+
"note" : "Initial button text of the Next Steps card for adding DDG app to OS dock"
182+
},
183+
"nextSteps_pinAppToTaskbarWindows_confirmationText" : {
184+
"title" : "An die Taskleiste angeheftet!",
185+
"note" : "Button text after clicking on the Next Steps card for adding DDG app to OS dock"
186+
},
187+
"favorites_show_less" : {
188+
"title" : "Weniger anzeigen",
189+
"note" : "Button label to display fewer items"
190+
},
191+
"favorites_show_more" : {
192+
"title" : "Mehr anzeigen ({count} verbleibend)",
193+
"note" : "Button text to show hidden items. {count} will be replaced with the number of remaining favorite items to show, including the parentheses. Example: 'Show more (18 remaining)'"
194+
},
195+
"favorites_menu_title" : {
196+
"title" : "Favoriten",
197+
"note" : "Used as a label in a customization menu"
198+
}
199+
}

0 commit comments

Comments
 (0)