Skip to content

Commit

Permalink
ntp: missing translations (#1285)
Browse files Browse the repository at this point in the history
* ntp: missing translations

* missing key

---------

Co-authored-by: Shane Osbourne <sosbourne@duckduckgo.com>
  • Loading branch information
shakyShane and Shane Osbourne authored Nov 27, 2024
1 parent 9d311d3 commit 4f6b7e2
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 3 deletions.
5 changes: 4 additions & 1 deletion special-pages/pages/new-tab/app/favorites/components/Tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import styles from './Tile.module.css';
import { urlToColor } from '../color.js';
import { DDG_DEFAULT_ICON_SIZE, DDG_FALLBACK_ICON } from '../constants.js';
import { useItemState } from './PragmaticDND.js';
import { useTypedTranslationWith } from '../../types.js';

/**
* @import {Favorite} from '../../../../../types/new-tab'
* @import enStrings from '../../strings.json'
*/

/**
Expand Down Expand Up @@ -133,6 +135,7 @@ export function Placeholder() {
*/
export function PlusIcon({ onClick }) {
const id = useId();
const { t } = useTypedTranslationWith(/** @type {import('../strings.json')} */ ({}));
const { state, ref } = useItemState(`PLACEHOLDER-URL-${id}`, `PLACEHOLDER-ID-${id}`);
return (
<div class={styles.item} ref={ref} data-edge={'closestEdge' in state && state.closestEdge}>
Expand All @@ -147,7 +150,7 @@ export function PlusIcon({ onClick }) {
</svg>
</button>
<div class={styles.text} id={id}>
{'Add Favorite'}
{t('favorites_add')}
</div>
{state.type === 'is-dragging-over' && state.closestEdge ? <div class={styles.dropper} data-edge={state.closestEdge} /> : null}
</div>
Expand Down
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/app/favorites/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"favorites_menu_title": {
"title": "Favorites",
"note": "Used as a label in a customization menu"
},
"favorites_add": {
"title": "Add Favorite",
"note": "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 2 additions & 2 deletions special-pages/pages/new-tab/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export async function init(root, messaging, telemetry, baseEnvironment) {
<InitialSetupContext.Provider value={init}>
<TelemetryContext.Provider value={telemetry}>
<SettingsProvider settings={settings}>
<TranslationProvider translationObject={strings} fallback={strings} textLength={environment.textLength}>
<TranslationProvider translationObject={strings} fallback={enStrings} textLength={environment.textLength}>
<WidgetConfigProvider
api={widgetConfigAPI}
widgetConfigs={init.widgetConfigs}
Expand Down Expand Up @@ -174,7 +174,7 @@ function renderComponents(root, environment, settings, strings) {
$INTEGRATION: render(
<EnvironmentProvider debugState={environment.debugState} injectName={environment.injectName} willThrow={environment.willThrow}>
<SettingsProvider settings={settings}>
<TranslationProvider translationObject={strings} fallback={strings} textLength={environment.textLength}>
<TranslationProvider translationObject={strings} fallback={enStrings} textLength={environment.textLength}>
<Components />
</TranslationProvider>
</SettingsProvider>
Expand Down
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/de/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@
"favorites_menu_title" : {
"title" : "Favoriten",
"note" : "Used as a label in a customization menu"
},
"favorites_add" : {
"title" : "Favorit hinzufügen",
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/en/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,9 @@
"favorites_menu_title": {
"title": "Favorites",
"note": "Used as a label in a customization menu"
},
"favorites_add": {
"title": "Add Favorite",
"note": "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/es/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@
"favorites_menu_title" : {
"title" : "Favoritos",
"note" : "Used as a label in a customization menu"
},
"favorites_add" : {
"title" : "Añadir favorito",
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/fr/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@
"favorites_menu_title" : {
"title" : "Favoris",
"note" : "Used as a label in a customization menu"
},
"favorites_add" : {
"title" : "Ajouter un favori",
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/nl/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@
"favorites_menu_title" : {
"title" : "Favorieten",
"note" : "Used as a label in a customization menu"
},
"favorites_add" : {
"title" : "Favoriet toevoegen",
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/pl/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@
"favorites_menu_title" : {
"title" : "Ulubione",
"note" : "Used as a label in a customization menu"
},
"favorites_add" : {
"title" : "Dodaj do Ulubionych",
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/pt/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@
"favorites_menu_title" : {
"title" : "Favoritos",
"note" : "Used as a label in a customization menu"
},
"favorites_add" : {
"title" : "Adicionar favorito",
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}
4 changes: 4 additions & 0 deletions special-pages/pages/new-tab/src/locales/ru/new-tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@
"favorites_menu_title" : {
"title" : "Избранное",
"note" : "Used as a label in a customization menu"
},
"favorites_add" : {
"title" : "Добавить в избранное",
"note" : "A button that allows a user to add a new 'favorite' bookmark to their existing list"
}
}

0 comments on commit 4f6b7e2

Please sign in to comment.