Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: optimize demo #135

Open
wants to merge 8 commits into
base: v4.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions react-NutUI/src/app.js → react-NutUI/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react'
import { useDidShow, useDidHide } from '@tarojs/taro'
// 全局样式

import './app.{{ cssExt }}'

function App(props) {
Expand All @@ -12,7 +12,6 @@ function App(props) {

// 对应 onHide
useDidHide(() => {})

return props.children
}

Expand Down
140 changes: 140 additions & 0 deletions react-NutUI/src/locales/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
export interface BaseLang {
welcome: string;
button: string;
open: string;
save: string;
confirm: string;
cancel: string;
done: string;
noData: string;
placeholder: string;
select: string;
video: {
errorTip: string;
clickRetry: string;
};
fixednav: {
activeText: string;
inactiveText: string;
};
infiniteloading: {
pullRefreshText: string;
loadText: string;
loadMoreText: string;
};
pagination: {
prev: string;
next: string;
};
range: {
rangeText: string;
};
calendaritem: {
weekdays: Array<string>;
end: string;
start: string;
confirm: string;
title: string;
// eslint-disable-next-line @typescript-eslint/ban-types
monthTitle: Function;
today: string;
loadPreviousMonth: string;
noEarlierMonth: string;
};
shortpassword: {
title: string;
description: string;
tips: string;
};
uploader: {
ready: string;
readyUpload: string;
waitingUpload: string;
uploading: string;
success: string;
error: string;
deleteWord: string;
};
countdown: {
day: string;
hour: string;
minute: string;
second: string;
};
address: {
selectRegion: string;
deliveryTo: string;
chooseAnotherAddress: string;
};
signature: {
reSign: string;
unsupported: string;
};
ecard: {
chooseText: string;
otherValueText: string;
placeholder: string;
};
timeselect: {
pickupTime: string;
};
sku: {
buyNow: string;
buyNumber: string;
addToCard: string;
};
skuheader: {
skuId: string;
};
addresslist: {
addAddress: string;
};
comment: {
complaintsText: string;
// eslint-disable-next-line @typescript-eslint/ban-types
additionalReview: Function;
// eslint-disable-next-line @typescript-eslint/ban-types
additionalImages: Function;
};
searchbar: {
basePlaceholder: string;
text: string;
test: string;
title1: string;
title2: string;
title3: string;
title4: string;
title5: string;
title6: string;
};
audio: {
back: string;
forward: string;
pause: string;
start: string;
mute: string;
tips: string;
};
datepicker: {
year: string;
month: string;
day: string;
hour: string;
min: string;
seconds: string;
};
pullToRefresh: {
pullingText: string;
canReleaseText: string;
refreshingText: string;
completeText: string;
};
tour: {
prevStepText: string;
completeText: string;
nextStepText: string;
};
watermark: {
errorCanvasTips: string;
};
}
139 changes: 139 additions & 0 deletions react-NutUI/src/locales/en-US.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import { BaseLang } from './base';

const enUS: BaseLang = {
welcome: 'Welcome to use NutUI React.',
button: 'Use Chinese',
open: 'Click Me',
save: 'Save',
confirm: 'Confirm',
cancel: 'Cancel',
done: 'Done',
noData: 'No Data',
placeholder: 'Placeholder',
select: 'Select',
video: {
errorTip: 'Error Tip',
clickRetry: 'Click Retry',
},
fixednav: {
activeText: 'Close Nav',
inactiveText: 'Open Nav',
},
infiniteloading: {
pullRefreshText: 'Pull Refresh',
loadText: 'Loading',
loadMoreText: "Oops, here's the bottom",
},
pagination: {
prev: 'Previous',
next: 'Next',
},
range: { rangeText: 'is overflow' },
calendaritem: {
weekdays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
end: 'End',
start: 'Start',
confirm: 'Confirm',
title: 'Calendar',
monthTitle: (year: number, month: number) =>
`${year}/${Number(month) < 10 ? `0${Number(month)}` : month}`,
today: 'Today',
loadPreviousMonth: 'Load Previous Month',
noEarlierMonth: 'No Earlier Month',
},
shortpassword: {
title: 'Please input a password',
description: 'Verify',
tips: 'Forget password',
},
uploader: {
ready: 'Ready',
readyUpload: 'Ready to upload',
waitingUpload: 'Waiting for upload',
uploading: 'Uploading...',
success: 'Upload successful',
error: 'Upload failed',
deleteWord: 'The user blocked the deletion!',
},
countdown: {
day: ' Day ',
hour: ' Hour ',
minute: ' Minute ',
second: ' Second ',
},
address: {
selectRegion: 'Choose Address',
deliveryTo: 'Delivery To',
chooseAnotherAddress: 'Choose Another Address',
},
signature: {
reSign: 'Re Sign',
unsupported: `Sorry, the current browser doesn't support canvas, so we can't use this control!`,
},
ecard: {
chooseText: 'Select',
otherValueText: 'Other Value',
placeholder: 'Placeholder',
},
timeselect: {
pickupTime: 'Pickup Time',
},
sku: {
buyNow: 'Buy Now',
buyNumber: 'Buy Number',
addToCard: 'Add to Card',
},
skuheader: {
skuId: 'Sku Number',
},
addresslist: {
addAddress: 'Add New Address',
},
comment: {
complaintsText: 'I have a complaint',
additionalReview: (day: number) => `Review after ${day} days of purchase`,
additionalImages: (length: number) => `There are ${length} follow-up comments`,
},
searchbar: {
basePlaceholder: 'Go to jd.com and buy good things',
text: 'text',
test: 'test',
title1: 'basic usage',
title2: 'search box shape and maximum length',
title3: 'background settings inside and outside the search box',
title4: 'search box text settings',
title5: 'custom icon settings',
title6: 'data change monitoring',
},
audio: {
back: 'fastBack',
forward: 'forward',
pause: 'pause',
start: 'start',
mute: 'mute',
tips: 'The onplayend event will only be triggered when loop = false',
},
datepicker: {
year: 'Year',
month: 'Month',
day: 'Day',
hour: 'Hour',
min: 'Minute',
seconds: 'Second',
},
pullToRefresh: {
pullingText: 'Pulling',
canReleaseText: 'Release to refresh',
refreshingText: 'Loading...',
completeText: 'Refresh successful',
},
tour: {
prevStepText: 'Previous',
completeText: 'Finish',
nextStepText: 'Next step',
},
watermark: {
errorCanvasTips: 'Canvas is not supported in the current environment',
},
};
export default enUS;
Loading