Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
257b8add
Unverified
Commit
257b8add
authored
Apr 12, 2024
by
imikod
Committed by
GitHub
Apr 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: localization improvements (#3213)
* localization improvements * typo fix * fix linting error
parent
755d5b83
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
12 deletions
+26
-12
ActivityCalendar.tsx
web/src/components/ActivityCalendar.tsx
+3
-1
TagsSection.tsx
web/src/components/HomeSidebar/TagsSection.tsx
+3
-3
MemoCommentMessage.tsx
web/src/components/Inbox/MemoCommentMessage.tsx
+1
-1
VersionUpdateMessage.tsx
web/src/components/Inbox/VersionUpdateMessage.tsx
+1
-1
MemoActionMenu.tsx
web/src/components/MemoActionMenu.tsx
+1
-1
AddMemoRelationButton.tsx
...ponents/MemoEditor/ActionButton/AddMemoRelationButton.tsx
+3
-1
TagSelector.tsx
web/src/components/MemoEditor/ActionButton/TagSelector.tsx
+3
-1
MemoView.tsx
web/src/components/MemoView.tsx
+1
-1
en.json
web/src/locales/en.json
+10
-2
No files found.
web/src/components/ActivityCalendar.tsx
View file @
257b8add
import
{
Tooltip
}
from
"@mui/joy"
;
import
{
Tooltip
}
from
"@mui/joy"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
{
getNormalizedDateString
,
getDateWithOffset
}
from
"@/helpers/datetime"
;
import
{
getNormalizedDateString
,
getDateWithOffset
}
from
"@/helpers/datetime"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
interface
Props
{
interface
Props
{
// Format: 2021-1
// Format: 2021-1
...
@@ -25,6 +26,7 @@ const getCellAdditionalStyles = (count: number, maxCount: number) => {
...
@@ -25,6 +26,7 @@ const getCellAdditionalStyles = (count: number, maxCount: number) => {
};
};
const
ActivityCalendar
=
(
props
:
Props
)
=>
{
const
ActivityCalendar
=
(
props
:
Props
)
=>
{
const
t
=
useTranslate
();
const
{
month
:
monthStr
,
data
,
onClick
}
=
props
;
const
{
month
:
monthStr
,
data
,
onClick
}
=
props
;
const
year
=
new
Date
(
monthStr
).
getUTCFullYear
();
const
year
=
new
Date
(
monthStr
).
getUTCFullYear
();
const
month
=
new
Date
(
monthStr
).
getUTCMonth
()
+
1
;
const
month
=
new
Date
(
monthStr
).
getUTCMonth
()
+
1
;
...
@@ -52,7 +54,7 @@ const ActivityCalendar = (props: Props) => {
...
@@ -52,7 +54,7 @@ const ActivityCalendar = (props: Props) => {
);
);
const
count
=
data
[
date
]
||
0
;
const
count
=
data
[
date
]
||
0
;
const
isToday
=
new
Date
().
toDateString
()
===
new
Date
(
date
).
toDateString
();
const
isToday
=
new
Date
().
toDateString
()
===
new
Date
(
date
).
toDateString
();
const
tooltipText
=
count
?
`${count} memos in ${date}`
:
date
;
const
tooltipText
=
count
?
t
(
"memo.count-memos-in-date"
,
{
count
:
count
,
date
:
date
})
:
date
;
return
day
?
(
return
day
?
(
<
Tooltip
className=
"shrink-0"
key=
{
`${date}-${index}`
}
title=
{
tooltipText
}
placement=
"top"
arrow
>
<
Tooltip
className=
"shrink-0"
key=
{
`${date}-${index}`
}
title=
{
tooltipText
}
placement=
"top"
arrow
>
<
div
<
div
...
...
web/src/components/HomeSidebar/TagsSection.tsx
View file @
257b8add
...
@@ -93,7 +93,7 @@ const TagsSection = () => {
...
@@ -93,7 +93,7 @@ const TagsSection = () => {
<
div
className=
"p-2 border rounded-md flex flex-row justify-start items-start gap-1 text-gray-400 dark:text-gray-500"
>
<
div
className=
"p-2 border rounded-md flex flex-row justify-start items-start gap-1 text-gray-400 dark:text-gray-500"
>
<
Icon
.
ThumbsUp
/>
<
Icon
.
ThumbsUp
/>
<
p
className=
"mt-0.5 text-sm leading-snug italic"
>
<
p
className=
"mt-0.5 text-sm leading-snug italic"
>
You can create tags by inputting
<
code
>
`#tag`
</
code
>
.
{
t
(
"tag.create-tags-guide"
)
}
</
p
>
</
p
>
</
div
>
</
div
>
)
}
)
}
...
@@ -130,8 +130,8 @@ const TagItemContainer: React.FC<TagItemContainerProps> = (props: TagItemContain
...
@@ -130,8 +130,8 @@ const TagItemContainer: React.FC<TagItemContainerProps> = (props: TagItemContain
const
handleDeleteTag
=
async
()
=>
{
const
handleDeleteTag
=
async
()
=>
{
showCommonDialog
({
showCommonDialog
({
title
:
"Delete Tag"
,
title
:
t
(
"tag.delete-tag"
)
,
content
:
"Are you sure to delete this tag?"
,
content
:
t
(
"tag.delete-confirm"
)
,
style
:
"danger"
,
style
:
"danger"
,
dialogName
:
"delete-tag-dialog"
,
dialogName
:
"delete-tag-dialog"
,
onConfirm
:
async
()
=>
{
onConfirm
:
async
()
=>
{
...
...
web/src/components/Inbox/MemoCommentMessage.tsx
View file @
257b8add
...
@@ -69,7 +69,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
...
@@ -69,7 +69,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
[
"status"
],
[
"status"
],
);
);
if
(
!
silence
)
{
if
(
!
silence
)
{
toast
.
success
(
"Archived"
);
toast
.
success
(
t
(
"message.archived-successfully"
)
);
}
}
};
};
...
...
web/src/components/Inbox/VersionUpdateMessage.tsx
View file @
257b8add
...
@@ -55,7 +55,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
...
@@ -55,7 +55,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
["status"],
["status"],
);
);
if (!silence) {
if (!silence) {
toast.success(
"Archived"
);
toast.success(
t("message.archived-successfully")
);
}
}
};
};
...
...
web/src/components/MemoActionMenu.tsx
View file @
257b8add
...
@@ -97,7 +97,7 @@ const MemoActionMenu = (props: Props) => {
...
@@ -97,7 +97,7 @@ const MemoActionMenu = (props: Props) => {
dialogName
:
"delete-memo-dialog"
,
dialogName
:
"delete-memo-dialog"
,
onConfirm
:
async
()
=>
{
onConfirm
:
async
()
=>
{
await
memoStore
.
deleteMemo
(
memo
.
name
);
await
memoStore
.
deleteMemo
(
memo
.
name
);
toast
.
success
(
"Deleted successfully"
);
toast
.
success
(
t
(
"message.deleted-successfully"
)
);
if
(
isInMemoDetailPage
)
{
if
(
isInMemoDetailPage
)
{
navigateTo
(
"/"
);
navigateTo
(
"/"
);
}
}
...
...
web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx
View file @
257b8add
...
@@ -5,6 +5,7 @@ import toast from "react-hot-toast";
...
@@ -5,6 +5,7 @@ import toast from "react-hot-toast";
import
showCreateMemoRelationDialog
from
"@/components/CreateMemoRelationDialog"
;
import
showCreateMemoRelationDialog
from
"@/components/CreateMemoRelationDialog"
;
import
Icon
from
"@/components/Icon"
;
import
Icon
from
"@/components/Icon"
;
import
{
MemoRelation_Type
}
from
"@/types/proto/api/v2/memo_relation_service"
;
import
{
MemoRelation_Type
}
from
"@/types/proto/api/v2/memo_relation_service"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
EditorRefActions
}
from
"../Editor"
;
import
{
EditorRefActions
}
from
"../Editor"
;
import
{
MemoEditorContext
}
from
"../types"
;
import
{
MemoEditorContext
}
from
"../types"
;
...
@@ -15,6 +16,7 @@ interface Props {
...
@@ -15,6 +16,7 @@ interface Props {
const
AddMemoRelationButton
=
(
props
:
Props
)
=>
{
const
AddMemoRelationButton
=
(
props
:
Props
)
=>
{
const
{
editorRef
}
=
props
;
const
{
editorRef
}
=
props
;
const
context
=
useContext
(
MemoEditorContext
);
const
context
=
useContext
(
MemoEditorContext
);
const
t
=
useTranslate
();
const
handleAddMemoRelationBtnClick
=
()
=>
{
const
handleAddMemoRelationBtnClick
=
()
=>
{
showCreateMemoRelationDialog
({
showCreateMemoRelationDialog
({
...
@@ -22,7 +24,7 @@ const AddMemoRelationButton = (props: Props) => {
...
@@ -22,7 +24,7 @@ const AddMemoRelationButton = (props: Props) => {
// If embedded mode is enabled, embed the memo instead of creating a relation.
// If embedded mode is enabled, embed the memo instead of creating a relation.
if
(
embedded
)
{
if
(
embedded
)
{
if
(
!
editorRef
.
current
)
{
if
(
!
editorRef
.
current
)
{
toast
.
error
(
"Failed to embed memo"
);
toast
.
error
(
t
(
"message.failed-to-embed-memo"
)
);
return
;
return
;
}
}
...
...
web/src/components/MemoEditor/ActionButton/TagSelector.tsx
View file @
257b8add
...
@@ -4,6 +4,7 @@ import useClickAway from "react-use/lib/useClickAway";
...
@@ -4,6 +4,7 @@ import useClickAway from "react-use/lib/useClickAway";
import
Icon
from
"@/components/Icon"
;
import
Icon
from
"@/components/Icon"
;
import
OverflowTip
from
"@/components/kit/OverflowTip"
;
import
OverflowTip
from
"@/components/kit/OverflowTip"
;
import
{
useTagStore
}
from
"@/store/module"
;
import
{
useTagStore
}
from
"@/store/module"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
EditorRefActions
}
from
"../Editor"
;
import
{
EditorRefActions
}
from
"../Editor"
;
interface
Props
{
interface
Props
{
...
@@ -11,6 +12,7 @@ interface Props {
...
@@ -11,6 +12,7 @@ interface Props {
}
}
const
TagSelector
=
(
props
:
Props
)
=>
{
const
TagSelector
=
(
props
:
Props
)
=>
{
const
t
=
useTranslate
();
const
{
editorRef
}
=
props
;
const
{
editorRef
}
=
props
;
const
tagStore
=
useTagStore
();
const
tagStore
=
useTagStore
();
const
[
open
,
setOpen
]
=
useState
(
false
);
const
[
open
,
setOpen
]
=
useState
(
false
);
...
@@ -74,7 +76,7 @@ const TagSelector = (props: Props) => {
...
@@ -74,7 +76,7 @@ const TagSelector = (props: Props) => {
</
div
>
</
div
>
)
:
(
)
:
(
<
p
className=
"italic mx-2"
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
<
p
className=
"italic mx-2"
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
No tag found
{
t
(
"tag.no-tag-found"
)
}
</
p
>
</
p
>
)
}
)
}
</
div
>
</
div
>
...
...
web/src/components/MemoView.tsx
View file @
257b8add
...
@@ -138,7 +138,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
...
@@ -138,7 +138,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
</
Link
>
</
Link
>
)
}
)
}
{
props
.
showPinned
&&
memo
.
pinned
&&
(
{
props
.
showPinned
&&
memo
.
pinned
&&
(
<
Tooltip
title=
{
"Pinned"
}
placement=
"top"
>
<
Tooltip
title=
{
t
(
"common.pinned"
)
}
placement=
"top"
>
<
Icon
.
Bookmark
className=
"w-4 h-auto text-amber-500"
/>
<
Icon
.
Bookmark
className=
"w-4 h-auto text-amber-500"
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
...
...
web/src/locales/en.json
View file @
257b8add
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"language"
:
"Language"
,
"language"
:
"Language"
,
"version"
:
"Version"
,
"version"
:
"Version"
,
"pin"
:
"Pin"
,
"pin"
:
"Pin"
,
"pinned"
:
"Pinned"
,
"unpin"
:
"Unpin"
,
"unpin"
:
"Unpin"
,
"edit"
:
"Edit"
,
"edit"
:
"Edit"
,
"restore"
:
"Restore"
,
"restore"
:
"Restore"
,
...
@@ -106,7 +107,8 @@
...
@@ -106,7 +107,8 @@
"no-comment"
:
"No comment"
"no-comment"
:
"No comment"
},
},
"show-more"
:
"Show more"
,
"show-more"
:
"Show more"
,
"wrapping"
:
"Wrapping"
"wrapping"
:
"Wrapping"
,
"count-memos-in-date"
:
"{{count}} memos in {{date}}"
},
},
"reference"
:
{
"reference"
:
{
"add-references"
:
"Add references"
,
"add-references"
:
"Add references"
,
...
@@ -153,13 +155,17 @@
...
@@ -153,13 +155,17 @@
"tag"
:
{
"tag"
:
{
"tip-text"
:
"Input `#tag` to create"
,
"tip-text"
:
"Input `#tag` to create"
,
"create-tag"
:
"Create Tag"
,
"create-tag"
:
"Create Tag"
,
"delete-tag"
:
"Delete Tag"
,
"delete-confirm"
:
"Are you sure to delete this tag?"
,
"all-tags"
:
"All Tags"
,
"all-tags"
:
"All Tags"
,
"tag-name"
:
"TAG_NAME"
,
"tag-name"
:
"TAG_NAME"
,
"invalid-tag-name"
:
"Invalid tag name"
,
"invalid-tag-name"
:
"Invalid tag name"
,
"tag-suggestions"
:
"Tag suggestions"
,
"tag-suggestions"
:
"Tag suggestions"
,
"no-tag-found"
:
"No tag found"
,
"show"
:
"Show"
,
"show"
:
"Show"
,
"hide"
:
"Hide"
,
"hide"
:
"Hide"
,
"save-all"
:
"Save all"
"save-all"
:
"Save all"
,
"create-tags-guide"
:
"You can create tags by inputting `#tag`."
},
},
"timeline"
:
{
"timeline"
:
{
"title"
:
"Timeline"
"title"
:
"Timeline"
...
@@ -318,11 +324,13 @@
...
@@ -318,11 +324,13 @@
"memos-ready"
:
"all memos are ready"
,
"memos-ready"
:
"all memos are ready"
,
"resource-ready"
:
"all resource are ready"
,
"resource-ready"
:
"all resource are ready"
,
"archived-successfully"
:
"Archived successfully"
,
"archived-successfully"
:
"Archived successfully"
,
"deleted-successfully"
:
"Deleted successfully"
,
"restored-successfully"
:
"Restored successfully"
,
"restored-successfully"
:
"Restored successfully"
,
"memo-updated-datetime"
:
"Memo created datetime changed."
,
"memo-updated-datetime"
:
"Memo created datetime changed."
,
"invalid-created-datetime"
:
"Invalid created datetime."
,
"invalid-created-datetime"
:
"Invalid created datetime."
,
"change-memo-created-time"
:
"Change memo created time"
,
"change-memo-created-time"
:
"Change memo created time"
,
"memo-not-found"
:
"Memo not found."
,
"memo-not-found"
:
"Memo not found."
,
"failed-to-embed-memo"
:
"Failed to embed memo"
,
"fill-all"
:
"Please fill in all fields."
,
"fill-all"
:
"Please fill in all fields."
,
"password-not-match"
:
"Passwords do not match."
,
"password-not-match"
:
"Passwords do not match."
,
"new-password-not-match"
:
"New passwords do not match."
,
"new-password-not-match"
:
"New passwords do not match."
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment