Skip to content

Commit

Permalink
fix: i18n (#2597)
Browse files Browse the repository at this point in the history
* fix: lint

* fix: test

* fix: test import
  • Loading branch information
xiaoyatong authored Sep 20, 2024
1 parent 246529a commit 28fec26
Show file tree
Hide file tree
Showing 51 changed files with 91 additions and 144 deletions.
4 changes: 4 additions & 0 deletions src/locales/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export interface BaseLang {
noData: string
placeholder: string
select: string
edit: string
reset: string
video: {
errorTip: string
clickRetry: string
Expand Down Expand Up @@ -44,6 +46,7 @@ export interface BaseLang {
tips: string
}
uploader: {
list: string
ready: string
readyUpload: string
waitingUpload: string
Expand Down Expand Up @@ -112,6 +115,7 @@ export interface BaseLang {
mute: string
tips: string
}
avatarCropper: { rotate: string; selectImage: string }
datepicker: {
year: string
month: string
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const enUS: BaseLang = {
noData: 'No Data',
placeholder: 'Placeholder',
select: 'Select',
edit: 'Edit',
reset: 'Reset',
video: {
errorTip: 'Error Tip',
clickRetry: 'Click Retry',
Expand Down Expand Up @@ -44,6 +46,7 @@ const enUS: BaseLang = {
tips: 'Forget password',
},
uploader: {
list: 'Upload Files',
ready: 'Ready',
readyUpload: 'Ready to upload',
waitingUpload: 'Waiting for upload',
Expand Down Expand Up @@ -111,6 +114,7 @@ const enUS: BaseLang = {
mute: 'mute',
tips: 'The onplayend event will only be triggered when loop = false',
},
avatarCropper: { rotate: 'Rotate', selectImage: 'Select Image' },
datepicker: {
year: 'Year',
month: 'Month',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/id-ID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const idID: BaseLang = {
noData: 'Tidak Ada Data',
placeholder: 'Kolom Input',
select: 'Pilih',
edit: 'Sunting',
reset: 'Mengatur Ulang',
video: {
errorTip: 'Terjadi Kesalahan',
clickRetry: 'Coba Lagi',
Expand Down Expand Up @@ -45,6 +47,7 @@ const idID: BaseLang = {
tips: 'Lupa Kata Sandi',
},
uploader: {
list: 'Unggah file',
ready: 'File berhasil diunggah',
readyUpload: 'Siap untuk mengunggah',
waitingUpload: 'Menunggu untuk diunggah',
Expand Down Expand Up @@ -112,6 +115,7 @@ const idID: BaseLang = {
mute: 'bisu',
tips: 'Acara Onplayend hanya akan dipicu saat loop = false',
},
avatarCropper: { rotate: 'Memutar', selectImage: 'Pilih gambar' },
datepicker: {
year: 'Tahun',
month: 'Bulan',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/tr-TR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const trTR: BaseLang = {
noData: 'Veri Yok',
placeholder: 'Placeholder',
select: 'Seçiniz',
edit: 'düzenlemek',
reset: 'sıfırlama',
video: {
errorTip: 'Video yüklenemedi',
clickRetry: 'Yeniden Tıklayın',
Expand Down Expand Up @@ -53,6 +55,7 @@ const trTR: BaseLang = {
tips: 'Şifrenizi mi unuttunuz',
},
uploader: {
list: 'Dosyaları yükle',
ready: 'Tamamlamaya hazır',
readyUpload: 'Yüklemeye hazır',
waitingUpload: 'Yükleme için bekleniyor',
Expand Down Expand Up @@ -120,6 +123,7 @@ const trTR: BaseLang = {
mute: 'sessiz',
tips: 'onPlayEnd olayı loop=false olduğunda ateşlenir',
},
avatarCropper: { rotate: 'döndürmek', selectImage: 'Resim seç' },
datepicker: {
year: 'yıl',
month: 'ay',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const zhCN: BaseLang = {
noData: '暂无数据',
placeholder: '请输入内容',
select: '请选择',
edit: '编辑',
reset: '重置',
video: {
errorTip: '视频加载失败',
clickRetry: '点击重试',
Expand Down Expand Up @@ -46,6 +48,7 @@ const zhCN: BaseLang = {
tips: '忘记密码',
},
uploader: {
list: '上传文件',
ready: '准备完成',
readyUpload: '准备上传',
waitingUpload: '等待上传',
Expand Down Expand Up @@ -112,6 +115,7 @@ const zhCN: BaseLang = {
mute: '静音',
tips: 'onPlayEnd事件在loop=false时才会触发',
},
avatarCropper: { rotate: '旋转', selectImage: '选择图片' },
datepicker: {
year: '年',
month: '月',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const zhCN: BaseLang = {
noData: '暫無數據',
placeholder: '請輸入內容',
select: '請選擇',
edit: '編輯',
reset: '重置',
video: {
errorTip: '視頻加載失敗',
clickRetry: '點擊重試',
Expand Down Expand Up @@ -46,6 +48,7 @@ const zhCN: BaseLang = {
tips: '忘記密碼',
},
uploader: {
list: '上傳文件',
ready: '準備完成',
readyUpload: '準備上傳',
waitingUpload: '等待上傳',
Expand Down Expand Up @@ -112,6 +115,7 @@ const zhCN: BaseLang = {
mute: '靜音',
tips: 'onPlayEnd事件在loop=false時才會觸發',
},
avatarCropper: { rotate: '旋轉', selectImage: '選擇圖片' },
datepicker: {
year: '年',
month: '月',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/zh-UG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const zhUG: BaseLang = {
noData: 'مەزمۇن يوق',
placeholder: 'كىرگۈزۈڭ',
select: 'تاللاڭ',
edit: 'يحرر',
reset: 'إعادة ضبط',
video: {
errorTip: 'فىلىمنى قويۇش مەغلۇپ بولدى',
clickRetry: 'قايتا سىناش',
Expand Down Expand Up @@ -44,6 +46,7 @@ const zhUG: BaseLang = {
tips: 'ئۇنتۇپ قاپتىمەن',
},
uploader: {
list: 'تحميل الملفات',
ready: 'تاماملىنىۋاتىدۇ',
readyUpload: 'يوللاش ئالدىدا',
waitingUpload: 'ساقلاۋاتىدۇ',
Expand Down Expand Up @@ -110,6 +113,7 @@ const zhUG: BaseLang = {
mute: 'جىم',
tips: 'onPlayEnd بولسا loop=false بولغاندا ئىشلەيدۇ',
},
avatarCropper: { rotate: 'تناوب', selectImage: 'حدد الصورة' },
datepicker: {
year: 'يىل',
month: 'ئاي',
Expand Down
2 changes: 0 additions & 2 deletions src/packages/address/address.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export interface AddressProps extends CascaderProps {
selectIcon: React.ReactNode
backIcon: React.ReactNode
onSwitch?: (data: { type: string }) => void
// 仅用于选择已有地址
onExistSelect?: (data: AddressList) => void
}

Expand Down Expand Up @@ -142,7 +141,6 @@ const InternalAddress: ForwardRefRenderFunction<
handleClose()
}

// 切换地址选择模式
const onSwitchModule = () => {
if (currentType === 'exist') {
setCurrentType('custom')
Expand Down
2 changes: 0 additions & 2 deletions src/packages/address/address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export interface AddressProps extends CascaderProps {
selectIcon: React.ReactNode
backIcon: React.ReactNode
onSwitch?: (data: { type: string }) => void
// 仅用于选择已有地址
onExistSelect?: (data: AddressList) => void
}

Expand Down Expand Up @@ -142,7 +141,6 @@ export const InternalAddress: ForwardRefRenderFunction<
handleClose()
}

// 切换地址选择模式
const onSwitchModule = () => {
if (currentType === 'exist') {
setCurrentType('custom')
Expand Down
2 changes: 1 addition & 1 deletion src/packages/address/customRender.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Cascader, {
import { ComponentDefaults } from '@/utils/typings'

export interface AddressProps extends CascaderProps {
visible: boolean // popup 显示状态
visible: boolean // popup visible
type: string
options: CascaderOption[]
value?: CascaderValue
Expand Down
2 changes: 1 addition & 1 deletion src/packages/address/customRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Cascader, {
import { ComponentDefaults } from '@/utils/typings'

export interface AddressProps extends CascaderProps {
visible: boolean // popup 显示状态
visible: boolean // popup visible
type: string
options: CascaderOption[]
value?: CascaderValue
Expand Down
1 change: 0 additions & 1 deletion src/packages/address/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export interface CurrentData {
custom: string
selectedRegion?: Regions
}
// 已选地址
export interface Regions {
province: RegionData
city: RegionData
Expand Down
3 changes: 1 addition & 2 deletions src/packages/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const Avatar: FunctionComponent<

const [maxSum, setMaxSum] = useState(0) // avatarGroup里的avatar的个数
const [showMax, setShowMax] = useState(false) // 是否显示的最大头像个数
const [avatarIndex, setAvatarIndex] = useState(1) // avatar的索引
const [avatarIndex, setAvatarIndex] = useState(1)
const avatarRef = useRef<any>(null)
const parent: any = useContext(AvatarContext)
const sizeValue = ['large', 'normal', 'small']
Expand Down Expand Up @@ -172,7 +172,6 @@ export const Avatar: FunctionComponent<
{!src && !icon && !children && <User className="icon" />}
</>
)}
{/* 折叠头像 */}
{showMax && (
<div className="text">
{parent?.propAvatarGroup?.maxContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`layout default slot 1`] = `
<div
class="nut-avatar-cropper-edit-text"
>
编辑
Edit
</div>
</div>
`;
Loading

0 comments on commit 28fec26

Please sign in to comment.