intl: fix localization

This commit is contained in:
Ammar Ahmed
2024-11-04 10:01:45 +05:00
parent 9e9ef15737
commit c8ba9266a7
5 changed files with 1322 additions and 1286 deletions

View File

@@ -775,7 +775,7 @@ export const useActions = ({
actions.push(
{
id: "favorite",
title: item.favorite ? strings.favorite() : strings.unfavorite(),
title: !item.favorite ? strings.favorite() : strings.unfavorite(),
icon: item.favorite ? "star-off" : "star-outline",
func: addToFavorites,
close: false,

View File

@@ -19,19 +19,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { getFormattedDate } from "@notesnook/common";
import {
EVENTS,
isEncryptedContent,
NoteContent,
ContentItem,
ContentType,
DeletedItem,
EVENTS,
ItemReference,
Note,
NoteContent,
TrashItem,
UnencryptedContentItem,
isDeleted,
isEncryptedContent,
isTrashItem
} from "@notesnook/core";
import { strings } from "@notesnook/intl";
import { useThemeEngineStore } from "@notesnook/theme";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import WebView from "react-native-webview";
@@ -57,6 +58,7 @@ import {
eUpdateNoteInEditor
} from "../../../utils/events";
import { tabBarRef } from "../../../utils/global-refs";
import { sleep } from "../../../utils/time";
import { unlockVault } from "../../../utils/unlock-vault";
import { onNoteCreated } from "../../notes/common";
import Commands from "./commands";
@@ -73,8 +75,6 @@ import {
isEditorLoaded,
post
} from "./utils";
import { sleep } from "../../../utils/time";
import { strings } from "@notesnook/intl";
type NoteWithContent = Note & {
content?: NoteContent<false>;
@@ -282,7 +282,7 @@ export const useEditor = (
if (saved) return;
commands.setStatus(
getFormattedDate(note ? note.dateEdited : Date.now(), "date-time"),
"Saving",
strings.saving(),
tabId
);
}, 50);
@@ -365,7 +365,7 @@ export const useEditor = (
note = (await db.notes?.note(id)) as Note;
await commands.setStatus(
getFormattedDate(note.dateEdited, "date-time"),
"Saved",
strings.saved(),
tabId
);
@@ -574,7 +574,7 @@ export const useEditor = (
await commands.setStatus(
getFormattedDate(item.dateEdited, "date-time"),
"Saved",
strings.saved(),
tabId
);
@@ -695,7 +695,7 @@ export const useEditor = (
if (currentNotes.current[noteId]?.dateEdited !== note.dateEdited) {
commands.setStatus(
getFormattedDate(note.dateEdited, "date-time"),
"Saved",
strings.saved(),
tabId as number
);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -186,14 +186,14 @@ export const strings = {
key:
| "dateCreated"
| "dateEdited"
| "dateModifed"
| "dateModified"
| "dateUploaded"
| "dateDeleted"
) =>
select(key, {
dateCreated: `Created at`,
dateEdited: `Last edited at`,
dateModifed: `Last modified at`,
dateModified: `Last modified at`,
dateUploaded: `Uploaded at`,
dateDeleted: `Deleted at`,
other: key
@@ -1484,7 +1484,9 @@ For example:
remindeMeOf: () => t`Remind me of...`,
addShortNote: () => t`Add a short note`,
typeAKeywordToSearchIn: (route: string) =>
t`Type a keyword to search in ${route}`,
t`Type a keyword to search in ${strings.routes[
route as keyof typeof strings.routes
]()}...`,
searchingFor: (query: string) => t`Searching for ${query}`,
typeAKeyword: () => t`Type a keyword`,
search: () => t`Search`,
@@ -2419,5 +2421,7 @@ Use this if changes from other devices are not appearing on this device. This wi
setTableSizeNotice: () => t`Please set a table size`,
clickToReset: (title: string) => t`Click to reset ${title}`,
increase: (title: string) => t`Increase ${title}`,
decrease: (title: string) => t`Decrease ${title}`
decrease: (title: string) => t`Decrease ${title}`,
saved: () => t`Saved`,
saving: () => t`Saving`
};