Skip to content

Commit 4f6b7e2

Browse files
shakyShaneShane Osbourne
andauthored
ntp: missing translations (#1285)
* ntp: missing translations * missing key --------- Co-authored-by: Shane Osbourne <[email protected]>
1 parent 9d311d3 commit 4f6b7e2

File tree

11 files changed

+42
-3
lines changed

11 files changed

+42
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import styles from './Tile.module.css';
66
import { urlToColor } from '../color.js';
77
import { DDG_DEFAULT_ICON_SIZE, DDG_FALLBACK_ICON } from '../constants.js';
88
import { useItemState } from './PragmaticDND.js';
9+
import { useTypedTranslationWith } from '../../types.js';
910

1011
/**
1112
* @import {Favorite} from '../../../../../types/new-tab'
13+
* @import enStrings from '../../strings.json'
1214
*/
1315

1416
/**
@@ -133,6 +135,7 @@ export function Placeholder() {
133135
*/
134136
export function PlusIcon({ onClick }) {
135137
const id = useId();
138+
const { t } = useTypedTranslationWith(/** @type {import('../strings.json')} */ ({}));
136139
const { state, ref } = useItemState(`PLACEHOLDER-URL-${id}`, `PLACEHOLDER-ID-${id}`);
137140
return (
138141
<div class={styles.item} ref={ref} data-edge={'closestEdge' in state && state.closestEdge}>
@@ -147,7 +150,7 @@ export function PlusIcon({ onClick }) {
147150
</svg>
148151
</button>
149152
<div class={styles.text} id={id}>
150-
{'Add Favorite'}
153+
{t('favorites_add')}
151154
</div>
152155
{state.type === 'is-dragging-over' && state.closestEdge ? <div class={styles.dropper} data-edge={state.closestEdge} /> : null}
153156
</div>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
"favorites_menu_title": {
1111
"title": "Favorites",
1212
"note": "Used as a label in a customization menu"
13+
},
14+
"favorites_add": {
15+
"title": "Add Favorite",
16+
"note": "A button that allows a user to add a new 'favorite' bookmark to their existing list"
1317
}
1418
}

special-pages/pages/new-tab/app/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export async function init(root, messaging, telemetry, baseEnvironment) {
9595
<InitialSetupContext.Provider value={init}>
9696
<TelemetryContext.Provider value={telemetry}>
9797
<SettingsProvider settings={settings}>
98-
<TranslationProvider translationObject={strings} fallback={strings} textLength={environment.textLength}>
98+
<TranslationProvider translationObject={strings} fallback={enStrings} textLength={environment.textLength}>
9999
<WidgetConfigProvider
100100
api={widgetConfigAPI}
101101
widgetConfigs={init.widgetConfigs}
@@ -174,7 +174,7 @@ function renderComponents(root, environment, settings, strings) {
174174
$INTEGRATION: render(
175175
<EnvironmentProvider debugState={environment.debugState} injectName={environment.injectName} willThrow={environment.willThrow}>
176176
<SettingsProvider settings={settings}>
177-
<TranslationProvider translationObject={strings} fallback={strings} textLength={environment.textLength}>
177+
<TranslationProvider translationObject={strings} fallback={enStrings} textLength={environment.textLength}>
178178
<Components />
179179
</TranslationProvider>
180180
</SettingsProvider>

special-pages/pages/new-tab/src/locales/de/new-tab.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,9 @@
195195
"favorites_menu_title" : {
196196
"title" : "Favoriten",
197197
"note" : "Used as a label in a customization menu"
198+
},
199+
"favorites_add" : {
200+
"title" : "Favorit hinzufügen",
201+
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
198202
}
199203
}

special-pages/pages/new-tab/src/locales/en/new-tab.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,9 @@
196196
"favorites_menu_title": {
197197
"title": "Favorites",
198198
"note": "Used as a label in a customization menu"
199+
},
200+
"favorites_add": {
201+
"title": "Add Favorite",
202+
"note": "A button that allows a user to add a new 'favorite' bookmark to their existing list"
199203
}
200204
}

special-pages/pages/new-tab/src/locales/es/new-tab.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,9 @@
195195
"favorites_menu_title" : {
196196
"title" : "Favoritos",
197197
"note" : "Used as a label in a customization menu"
198+
},
199+
"favorites_add" : {
200+
"title" : "Añadir favorito",
201+
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
198202
}
199203
}

special-pages/pages/new-tab/src/locales/fr/new-tab.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,9 @@
195195
"favorites_menu_title" : {
196196
"title" : "Favoris",
197197
"note" : "Used as a label in a customization menu"
198+
},
199+
"favorites_add" : {
200+
"title" : "Ajouter un favori",
201+
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
198202
}
199203
}

special-pages/pages/new-tab/src/locales/nl/new-tab.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,9 @@
195195
"favorites_menu_title" : {
196196
"title" : "Favorieten",
197197
"note" : "Used as a label in a customization menu"
198+
},
199+
"favorites_add" : {
200+
"title" : "Favoriet toevoegen",
201+
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
198202
}
199203
}

special-pages/pages/new-tab/src/locales/pl/new-tab.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,9 @@
195195
"favorites_menu_title" : {
196196
"title" : "Ulubione",
197197
"note" : "Used as a label in a customization menu"
198+
},
199+
"favorites_add" : {
200+
"title" : "Dodaj do Ulubionych",
201+
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
198202
}
199203
}

special-pages/pages/new-tab/src/locales/pt/new-tab.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,9 @@
195195
"favorites_menu_title" : {
196196
"title" : "Favoritos",
197197
"note" : "Used as a label in a customization menu"
198+
},
199+
"favorites_add" : {
200+
"title" : "Adicionar favorito",
201+
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
198202
}
199203
}

0 commit comments

Comments
 (0)