Add bilingual i18n UI and lighten component shadows
This commit is contained in:
@@ -5,13 +5,13 @@ import type { LatLng } from '@/types/api'
|
||||
function geolocationErrorMessage(error: GeolocationPositionError): string {
|
||||
switch (error.code) {
|
||||
case error.PERMISSION_DENIED:
|
||||
return 'Location access denied. Enable it to view nearby pings.'
|
||||
return 'location.error.permissionDenied'
|
||||
case error.POSITION_UNAVAILABLE:
|
||||
return 'Unable to determine your position. Try again.'
|
||||
return 'location.error.unavailable'
|
||||
case error.TIMEOUT:
|
||||
return 'Timed out while fetching your location.'
|
||||
return 'location.error.timeout'
|
||||
default:
|
||||
return 'Failed to retrieve your location.'
|
||||
return 'location.error.generic'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export function useUserLocation() {
|
||||
|
||||
const start = useCallback(() => {
|
||||
if (typeof navigator === 'undefined' || !navigator.geolocation) {
|
||||
setError('Geolocation is not supported in this browser.')
|
||||
setError('location.error.unsupported')
|
||||
setIsRequesting(false)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user