mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update i18n for memo visibility (#233)
This commit is contained in:
@ -33,6 +33,12 @@ const MemoCardDialog: React.FC<Props> = (props: Props) => {
|
|||||||
});
|
});
|
||||||
const [linkMemos, setLinkMemos] = useState<LinkedMemo[]>([]);
|
const [linkMemos, setLinkMemos] = useState<LinkedMemo[]>([]);
|
||||||
const [linkedMemos, setLinkedMemos] = useState<LinkedMemo[]>([]);
|
const [linkedMemos, setLinkedMemos] = useState<LinkedMemo[]>([]);
|
||||||
|
const visibilitySelectorItems = VISIBILITY_SELECTOR_ITEMS.map((item) => {
|
||||||
|
return {
|
||||||
|
value: item.value,
|
||||||
|
text: t(`memo.visibility.${item.text.toLowerCase()}`),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchLinkedMemos = async () => {
|
const fetchLinkedMemos = async () => {
|
||||||
@ -148,7 +154,7 @@ const MemoCardDialog: React.FC<Props> = (props: Props) => {
|
|||||||
<Icon.Eye className="icon-img" />
|
<Icon.Eye className="icon-img" />
|
||||||
<Selector
|
<Selector
|
||||||
className="visibility-selector"
|
className="visibility-selector"
|
||||||
dataSource={VISIBILITY_SELECTOR_ITEMS}
|
dataSource={visibilitySelectorItems}
|
||||||
value={memo.visibility}
|
value={memo.visibility}
|
||||||
handleValueChanged={(value) => handleVisibilitySelectorChange(value as Visibility)}
|
handleValueChanged={(value) => handleVisibilitySelectorChange(value as Visibility)}
|
||||||
/>
|
/>
|
||||||
|
@ -34,6 +34,12 @@ const editorFontStyleSelectorItems = [
|
|||||||
const PreferencesSection = () => {
|
const PreferencesSection = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { setting } = useAppSelector((state) => state.user.user as User);
|
const { setting } = useAppSelector((state) => state.user.user as User);
|
||||||
|
const visibilitySelectorItems = VISIBILITY_SELECTOR_ITEMS.map((item) => {
|
||||||
|
return {
|
||||||
|
value: item.value,
|
||||||
|
text: t(`memo.visibility.${item.text.toLowerCase()}`),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const handleLocaleChanged = async (value: string) => {
|
const handleLocaleChanged = async (value: string) => {
|
||||||
await userService.upsertUserSetting("locale", value);
|
await userService.upsertUserSetting("locale", value);
|
||||||
@ -61,7 +67,7 @@ const PreferencesSection = () => {
|
|||||||
<Selector
|
<Selector
|
||||||
className="ml-2 w-32"
|
className="ml-2 w-32"
|
||||||
value={setting.memoVisibility}
|
value={setting.memoVisibility}
|
||||||
dataSource={VISIBILITY_SELECTOR_ITEMS}
|
dataSource={visibilitySelectorItems}
|
||||||
handleValueChanged={handleDefaultMemoVisibilityChanged}
|
handleValueChanged={handleDefaultMemoVisibilityChanged}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
@ -73,7 +73,12 @@
|
|||||||
"cant-empty": "Content can't be empty"
|
"cant-empty": "Content can't be empty"
|
||||||
},
|
},
|
||||||
"memo": {
|
"memo": {
|
||||||
"view-story": "View Story"
|
"view-story": "View Story",
|
||||||
|
"visibility": {
|
||||||
|
"private": "Private",
|
||||||
|
"protected": "Protected",
|
||||||
|
"public": "Public"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"memo-list": {
|
"memo-list": {
|
||||||
"fetching-data": "fetching data..."
|
"fetching-data": "fetching data..."
|
||||||
|
@ -73,7 +73,12 @@
|
|||||||
"cant-empty": "Nội dung không thể trống"
|
"cant-empty": "Nội dung không thể trống"
|
||||||
},
|
},
|
||||||
"memo": {
|
"memo": {
|
||||||
"view-story": "Xem nội dung"
|
"view-story": "Xem nội dung",
|
||||||
|
"visibility": {
|
||||||
|
"private": "Private",
|
||||||
|
"protected": "Protected",
|
||||||
|
"public": "Public"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"memo-list": {
|
"memo-list": {
|
||||||
"fetching-data": "đang tải dữ liệu..."
|
"fetching-data": "đang tải dữ liệu..."
|
||||||
|
@ -73,7 +73,12 @@
|
|||||||
"cant-empty": "Content can't be empty"
|
"cant-empty": "Content can't be empty"
|
||||||
},
|
},
|
||||||
"memo": {
|
"memo": {
|
||||||
"view-story": "查看详情"
|
"view-story": "查看详情",
|
||||||
|
"visibility": {
|
||||||
|
"private": "仅自己可见",
|
||||||
|
"protected": "对所有用户公开",
|
||||||
|
"public": "对互联网公开"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"memo-list": {
|
"memo-list": {
|
||||||
"fetching-data": "请求数据中..."
|
"fetching-data": "请求数据中..."
|
||||||
|
Reference in New Issue
Block a user