lingui fix
This commit is contained in:
@@ -6,9 +6,7 @@ import {type AnimatedRef, useAnimatedRef} from 'react-native-reanimated'
|
|||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {type AppBskyEmbedImages} from '@atproto/api'
|
import {type AppBskyEmbedImages} from '@atproto/api'
|
||||||
import {utils} from '@bsky.app/alf'
|
import {utils} from '@bsky.app/alf'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {Trans} from '@lingui/react/macro'
|
|
||||||
|
|
||||||
import {type Dimensions} from '#/lib/media/types'
|
import {type Dimensions} from '#/lib/media/types'
|
||||||
import {useA11y} from '#/state/a11y'
|
import {useA11y} from '#/state/a11y'
|
||||||
@@ -40,7 +38,7 @@ export function Gallery({
|
|||||||
viewContext,
|
viewContext,
|
||||||
}: GalleryProps) {
|
}: GalleryProps) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const {screenReaderEnabled} = useA11y()
|
const {screenReaderEnabled} = useA11y()
|
||||||
const largeAltBadge = useLargeAltBadgeEnabled()
|
const largeAltBadge = useLargeAltBadgeEnabled()
|
||||||
@@ -118,9 +116,9 @@ export function Gallery({
|
|||||||
onPressIn={onPressIn ? () => onPressIn(index) : undefined}
|
onPressIn={onPressIn ? () => onPressIn(index) : undefined}
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
accessibilityLabel={
|
accessibilityLabel={
|
||||||
image.alt || _(msg`Image ${index + 1} of ${images.length}`)
|
image.alt || l`Image ${index + 1} of ${images.length}`
|
||||||
}
|
}
|
||||||
accessibilityHint={_(msg`Opens full image`)}
|
accessibilityHint={l`Opens full image`}
|
||||||
style={[a.flex_1]}>
|
style={[a.flex_1]}>
|
||||||
<Image
|
<Image
|
||||||
source={{uri: image.thumb}}
|
source={{uri: image.thumb}}
|
||||||
@@ -240,9 +238,9 @@ export function Gallery({
|
|||||||
}}
|
}}
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
accessibilityLabel={
|
accessibilityLabel={
|
||||||
image.alt || _(msg`Image ${index + 1} of ${images.length}`)
|
image.alt || l`Image ${index + 1} of ${images.length}`
|
||||||
}
|
}
|
||||||
accessibilityHint={_(msg`Opens full image`)}
|
accessibilityHint={l`Opens full image`}
|
||||||
style={[
|
style={[
|
||||||
a.flex_1,
|
a.flex_1,
|
||||||
a.rounded_md,
|
a.rounded_md,
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ import {Pressable, ScrollView, View} from 'react-native'
|
|||||||
import {type AnimatedRef, useAnimatedRef} from 'react-native-reanimated'
|
import {type AnimatedRef, useAnimatedRef} from 'react-native-reanimated'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {type AppBskyEmbedImages} from '@atproto/api'
|
import {type AppBskyEmbedImages} from '@atproto/api'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {Trans} from '@lingui/react/macro'
|
|
||||||
|
|
||||||
import {type Dimensions} from '#/lib/media/types'
|
import {type Dimensions} from '#/lib/media/types'
|
||||||
import {useLargeAltBadgeEnabled} from '#/state/preferences/large-alt-badge'
|
import {useLargeAltBadgeEnabled} from '#/state/preferences/large-alt-badge'
|
||||||
@@ -36,7 +34,7 @@ export function Gallery({
|
|||||||
viewContext,
|
viewContext,
|
||||||
}: GalleryProps) {
|
}: GalleryProps) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const largeAltBadge = useLargeAltBadgeEnabled()
|
const largeAltBadge = useLargeAltBadgeEnabled()
|
||||||
const currentPageRef = useRef(0)
|
const currentPageRef = useRef(0)
|
||||||
@@ -199,7 +197,7 @@ export function Gallery({
|
|||||||
}}
|
}}
|
||||||
role="group"
|
role="group"
|
||||||
aria-roledescription="carousel"
|
aria-roledescription="carousel"
|
||||||
aria-label={_(msg`Image gallery, ${images.length} images`)}>
|
aria-label={l`Image gallery, ${images.length} images`}>
|
||||||
{containerWidth > 0 && (
|
{containerWidth > 0 && (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
ref={scrollRef}
|
ref={scrollRef}
|
||||||
@@ -268,7 +266,7 @@ export function Gallery({
|
|||||||
]}
|
]}
|
||||||
aria-roledescription="slide"
|
aria-roledescription="slide"
|
||||||
aria-label={
|
aria-label={
|
||||||
image.alt || _(msg`Image ${index + 1} of ${images.length}`)
|
image.alt || l`Image ${index + 1} of ${images.length}`
|
||||||
}>
|
}>
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={
|
onPress={
|
||||||
@@ -290,9 +288,9 @@ export function Gallery({
|
|||||||
onPressIn={onPressIn ? () => onPressIn(index) : undefined}
|
onPressIn={onPressIn ? () => onPressIn(index) : undefined}
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
accessibilityLabel={
|
accessibilityLabel={
|
||||||
image.alt || _(msg`Image ${index + 1} of ${images.length}`)
|
image.alt || l`Image ${index + 1} of ${images.length}`
|
||||||
}
|
}
|
||||||
accessibilityHint={_(msg`Opens full image`)}
|
accessibilityHint={l`Opens full image`}
|
||||||
style={[
|
style={[
|
||||||
a.flex_1,
|
a.flex_1,
|
||||||
a.rounded_md,
|
a.rounded_md,
|
||||||
|
|||||||
Reference in New Issue
Block a user