@@ -11,6 +11,7 @@ import Tooltip from './Tooltip'
1111import BottomSheet from './BottomSheet'
1212import SlideDrawer from './SlideDrawer'
1313import AnnotationAdvertisement from './AnnotationAdvertisement'
14+ import { useT } from '../i18n'
1415
1516function AnnotationItem ( {
1617 annotation,
@@ -23,6 +24,7 @@ function AnnotationItem({
2324 selected : boolean
2425 layoutMode : LayoutMode
2526} ) {
27+ const t = useT ( )
2628 const setSelectedId = useAppStore ( ( s ) => s . setSelectedId )
2729 const updateAnnotation = useAppStore ( ( s ) => s . updateAnnotation )
2830 const removeAnnotation = useAppStore ( ( s ) => s . removeAnnotation )
@@ -60,7 +62,7 @@ function AnnotationItem({
6062 < button
6163 type = "button"
6264 className = "annotation-delete"
63- aria-label = { `Delete annotation ${ markerLabel ( index ) } ` }
65+ aria-label = { t ( 'notes.deleteAria' , { label : markerLabel ( index ) } ) }
6466 onClick = { ( e ) => {
6567 e . stopPropagation ( )
6668 removeAnnotation ( annotation . id )
@@ -87,7 +89,7 @@ function AnnotationItem({
8789 { layoutMode === 'touch' ? (
8890 markerBadge
8991 ) : (
90- < Tooltip content = "Click to center on the map" side = "left" >
92+ < Tooltip content = { t ( 'notes.centerHint' ) } side = "left" >
9193 { markerBadge }
9294 </ Tooltip >
9395 ) }
@@ -96,7 +98,7 @@ function AnnotationItem({
9698 < textarea
9799 ref = { commentInputRef }
98100 className = "annotation-comment-input"
99- placeholder = "Add a comment…"
101+ placeholder = { t ( 'notes.commentPlaceholder' ) }
100102 rows = { 1 }
101103 value = { annotation . comment }
102104 onClick = { ( e ) => e . stopPropagation ( ) }
@@ -108,7 +110,7 @@ function AnnotationItem({
108110 { layoutMode === 'touch' ? (
109111 deleteButton
110112 ) : (
111- < Tooltip content = "Remove this marker" > { deleteButton } </ Tooltip >
113+ < Tooltip content = { t ( 'notes.removeHint' ) } > { deleteButton } </ Tooltip >
112114 ) }
113115 </ div >
114116 </ div >
@@ -117,6 +119,7 @@ function AnnotationItem({
117119}
118120
119121function MarkerDisplayToggle ( ) {
122+ const t = useT ( )
120123 const markerDisplayMode = useAppStore ( ( s ) => s . markerDisplayMode )
121124 const setMarkerDisplayMode = useAppStore ( ( s ) => s . setMarkerDisplayMode )
122125
@@ -127,7 +130,7 @@ function MarkerDisplayToggle() {
127130 aria-pressed = { markerDisplayMode === 'labels' }
128131 onClick = { ( ) => setMarkerDisplayMode ( 'labels' ) }
129132 >
130- Labels
133+ { t ( 'notes.labels' ) }
131134 </ button >
132135 )
133136
@@ -138,21 +141,21 @@ function MarkerDisplayToggle() {
138141 aria-pressed = { markerDisplayMode === 'comments' }
139142 onClick = { ( ) => setMarkerDisplayMode ( 'comments' ) }
140143 >
141- Comments
144+ { t ( 'notes.comments' ) }
142145 </ button >
143146 )
144147
145148 return (
146149 < div
147150 className = "marker-display-toggle"
148151 role = "group"
149- aria-label = "Map marker display"
152+ aria-label = { t ( 'notes.displayAria' ) }
150153 >
151- < Tooltip content = "Show letter labels on map markers" side = "bottom" >
154+ < Tooltip content = { t ( 'notes.labelsHint' ) } side = "bottom" >
152155 { labelsButton }
153156 </ Tooltip >
154157 < Tooltip
155- content = "Show inline comments on the map. Drag the right edge of a selected comment to change its width."
158+ content = { t ( 'notes.commentsHint' ) }
156159 side = "bottom"
157160 >
158161 { commentsButton }
@@ -166,6 +169,7 @@ function AnnotationsContent({
166169} : {
167170 layoutMode : LayoutMode
168171} ) {
172+ const t = useT ( )
169173 const annotations = useAppStore ( ( s ) => s . annotations )
170174 const selectedId = useAppStore ( ( s ) => s . selectedId )
171175
@@ -174,14 +178,14 @@ function AnnotationsContent({
174178 < div className = "panel-header" >
175179 < div className = "panel-header-title" >
176180 < MessageSquareText size = { 16 } aria-hidden />
177- < h2 > Annotations </ h2 >
181+ < h2 > { t ( 'notes.heading' ) } </ h2 >
178182 </ div >
179183 < MarkerDisplayToggle />
180184 </ div >
181185
182186 { annotations . length === 0 ? (
183187 < p className = "panel-empty" >
184- No annotations yet. Use the marker tool to add comments to the map.
188+ { t ( 'notes.empty' ) }
185189 </ p >
186190 ) : (
187191 < ul className = "annotation-list" >
@@ -207,6 +211,7 @@ export default function AnnotationsPanel({
207211 variant : 'sidebar' | 'drawer' | 'sheet'
208212 layoutMode : LayoutMode
209213} ) {
214+ const t = useT ( )
210215 const annotations = useAppStore ( ( s ) => s . annotations )
211216 const annotationsOpen = useAppStore ( ( s ) => s . annotationsOpen )
212217 const toggleAnnotations = useAppStore ( ( s ) => s . toggleAnnotations )
@@ -229,18 +234,18 @@ export default function AnnotationsPanel({
229234 < button
230235 type = "button"
231236 className = "annotation-toggle"
232- aria-label = "Toggle annotations"
237+ aria-label = { t ( 'notes.toggleAria' ) }
233238 aria-expanded = { annotationsOpen }
234239 onClick = { toggleAnnotations }
235240 >
236241 < MessageSquareText size = { 16 } aria-hidden />
237- < span > Notes </ span >
242+ < span > { t ( 'notes.toggle' ) } </ span >
238243 { annotations . length > 0 && (
239244 < span className = "annotation-toggle-badge" > { annotations . length } </ span >
240245 ) }
241246 </ button >
242247 < SlideDrawer
243- title = "Annotations"
248+ title = { t ( 'notes.heading' ) }
244249 open = { annotationsOpen }
245250 onClose = { closeAnnotations }
246251 >
@@ -259,7 +264,7 @@ export default function AnnotationsPanel({
259264
260265 return (
261266 < BottomSheet
262- title = "Annotations"
267+ title = { t ( 'notes.heading' ) }
263268 onClose = { closeAnnotations }
264269 className = "bottom-sheet-full"
265270 >
0 commit comments