Component: Language Suggestion Banner
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, react, tailwindcss, typescript
- Ambito
- frontend, internationalization
Direzione di ricerca
Read CONTRIBUTING.md and the Contributor Rulebook first, then inspect existing components in src/registry/components/, their exports in src/registry/components/index.ts, registry entries in src/registry/registry.ts, and related tests and docs. Implement the listed banner API and behaviors, following the project conventions. Add the requested tests in test/ and documentation under content/docs/components/language-switchers/; done means the component is registered, documented, and the listed matching, rendering, and dismissal cases are covered.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Component: Language Suggestion Banner
A slim banner that notices the visitor's browser prefers another language the site supports, and offers to switch: "This page is also available in Deutsch. Switch?"
Requirements
- TypeScript-first with exported props interface
- Reads
navigator.languageson the client and picks the first one that matcheslocales(match the primary subtag too, sode-AT→de) - Renders nothing when the best match is already the current locale, or when nothing matches
- Two actions: switch (calls
onSwitch(code)) and dismiss - Remembers a dismissal in
localStorageunder a configurablestorageKey, so it doesn't come back on every page - Banner text is passed in as props (no hardcoded English), with the suggested language's name shown in that language via
Intl.DisplayNames - No hydration mismatch: render
nulluntil mounted - Accessible:
role="region"with a label, buttons reachable by keyboard - Tailwind CSS compatible, follows the shadcn theme tokens
Expected API
<LanguageSuggestionBanner
locales={[{ code: "en" }, { code: "de" }, { code: "it" }]}
currentLocale="en"
onSwitch={(code) => router.push(`/${code}`)}
labels={{
message: (language) => `This page is also available in ${language}.`,
switch: "Switch",
dismiss: "Dismiss",
}}
/>
Deliverables
- Component source in
src/registry/components/ - Export in
src/registry/components/index.tsand entry insrc/registry/registry.ts - Tests in
test/covering: exact match, subtag match (de-AT), no match, already-current locale, dismissal persisted - Documentation page in
content/docs/components/language-switchers/
See CONTRIBUTING.md and the Contributor Rulebook.
- Lingua principale
- TypeScript
- Stelle
- 39
- Fork
- 16
- Merge medio
- 18h 14m
- PR unite (30g)
- 35
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di babelize/babelize-elements
-
accessibility help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
babelize/babelize-elements#94 ·
I maintainer di solito rispondono entro 1 giorno
-
component help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
babelize/babelize-elements#93 ·
I maintainer di solito rispondono entro 1 giorno
-
Component: Relative TimeApertacomponent date-time good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
babelize/babelize-elements#92 ·
I maintainer di solito rispondono entro 1 giorno
-
Component: Timezone PickerApertacomponent date-time good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
babelize/babelize-elements#91 ·
I maintainer di solito rispondono entro 1 giorno
-
component enhancement help wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
babelize/babelize-elements#47 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di babelize/babelize-elements
Issue simili
-
needs investigation
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Makefile names visualizer gate targets that do not exist; the TS packages have no test runnerApertaarea:visualizer tech-debt
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 66/100
jmbarzee/temporal-architect#292 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
riverqueue/river#1576 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
colbymchenry/codegraph#3228 ·
I maintainer di solito rispondono entro 1 giorno