Improve manga type detection internationalization
This commit is contained in:
@@ -161,11 +161,60 @@ export const SOURCES_BY_MANGA_TYPE: Record<MangaType, string[]> = {
|
|||||||
// @ts-ignore - see comment
|
// @ts-ignore - see comment
|
||||||
// oxlint-disable-next-line no-unused-vars
|
// oxlint-disable-next-line no-unused-vars
|
||||||
const MANGA_TAG_DESCRIPTORS_BY_MANGA_TYPE: Record<MangaType, MessageDescriptor[]> = {
|
const MANGA_TAG_DESCRIPTORS_BY_MANGA_TYPE: Record<MangaType, MessageDescriptor[]> = {
|
||||||
[MangaType.MANGA]: [msg`Manga`],
|
[MangaType.MANGA]: [
|
||||||
[MangaType.COMIC]: [msg`Comic`],
|
msg({
|
||||||
[MangaType.WEBTOON]: [msg`Webtoon`, msg`Long strip`],
|
id: 'entry-type-detection-manga',
|
||||||
[MangaType.MANHWA]: [msg`Manhwa`, msg`Long strip`],
|
message: 'Manga',
|
||||||
[MangaType.MANHUA]: [msg`Manhua`, msg`Long strip`],
|
comment:
|
||||||
|
'Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[MangaType.COMIC]: [
|
||||||
|
msg({
|
||||||
|
id: 'entry-type-detection-comic',
|
||||||
|
message: 'Comic',
|
||||||
|
comment:
|
||||||
|
'Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[MangaType.WEBTOON]: [
|
||||||
|
msg({
|
||||||
|
id: 'entry-type-detection-webtoon',
|
||||||
|
message: 'Webtoon',
|
||||||
|
comment:
|
||||||
|
'Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")',
|
||||||
|
}),
|
||||||
|
msg({
|
||||||
|
id: 'entry-type-detection-long-strip',
|
||||||
|
message: 'Long strip',
|
||||||
|
comment:
|
||||||
|
'Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[MangaType.MANHWA]: [
|
||||||
|
msg({
|
||||||
|
id: 'entry-type-detection-manhwa',
|
||||||
|
message: 'Manhwa',
|
||||||
|
comment:
|
||||||
|
'Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")',
|
||||||
|
}),
|
||||||
|
msg({
|
||||||
|
id: 'entry-type-detection-long-strip',
|
||||||
|
message: 'Long strip',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[MangaType.MANHUA]: [
|
||||||
|
msg({
|
||||||
|
id: 'entry-type-detection-manhua',
|
||||||
|
message: 'Manhua',
|
||||||
|
comment:
|
||||||
|
'Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")',
|
||||||
|
}),
|
||||||
|
msg({
|
||||||
|
id: 'entry-type-detection-long-strip',
|
||||||
|
message: 'Long strip',
|
||||||
|
}),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -915,8 +915,10 @@ msgstr "Color filter blend mode"
|
|||||||
msgid "Comfortable grid"
|
msgid "Comfortable grid"
|
||||||
msgstr "Comfortable grid"
|
msgstr "Comfortable grid"
|
||||||
|
|
||||||
|
#. Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")
|
||||||
|
#. js-lingui-explicit-id
|
||||||
#: src/features/manga/Manga.constants.ts
|
#: src/features/manga/Manga.constants.ts
|
||||||
msgid "Comic"
|
msgid "entry-type-detection-comic"
|
||||||
msgstr "Comic"
|
msgstr "Comic"
|
||||||
|
|
||||||
#: src/base/components/GridLayouts.tsx
|
#: src/base/components/GridLayouts.tsx
|
||||||
@@ -2344,8 +2346,10 @@ msgstr "Logged in"
|
|||||||
msgid "Logging in to {trackerName}…"
|
msgid "Logging in to {trackerName}…"
|
||||||
msgstr "Logging in to {trackerName}…"
|
msgstr "Logging in to {trackerName}…"
|
||||||
|
|
||||||
|
#. Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")
|
||||||
|
#. js-lingui-explicit-id
|
||||||
#: src/features/manga/Manga.constants.ts
|
#: src/features/manga/Manga.constants.ts
|
||||||
msgid "Long strip"
|
msgid "entry-type-detection-long-strip"
|
||||||
msgstr "Long strip"
|
msgstr "Long strip"
|
||||||
|
|
||||||
#: src/features/device/screens/DeviceSetting.tsx
|
#: src/features/device/screens/DeviceSetting.tsx
|
||||||
@@ -2358,13 +2362,18 @@ msgstr ""
|
|||||||
"UI specific settings that are stored on the server are per device.\n"
|
"UI specific settings that are stored on the server are per device.\n"
|
||||||
"This makes it possible to have e.g. different settings on a desktop and a smartphone"
|
"This makes it possible to have e.g. different settings on a desktop and a smartphone"
|
||||||
|
|
||||||
#: src/features/manga/Manga.constants.ts
|
|
||||||
#: src/features/manga/screens/Manga.tsx
|
#: src/features/manga/screens/Manga.tsx
|
||||||
#: src/features/reader/settings/behaviour/components/ReaderSettingExitMode.tsx
|
#: src/features/reader/settings/behaviour/components/ReaderSettingExitMode.tsx
|
||||||
#: src/features/tracker/Tracker.constants.ts
|
#: src/features/tracker/Tracker.constants.ts
|
||||||
msgid "Manga"
|
msgid "Manga"
|
||||||
msgstr "Manga"
|
msgstr "Manga"
|
||||||
|
|
||||||
|
#. Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")
|
||||||
|
#. js-lingui-explicit-id
|
||||||
|
#: src/features/manga/Manga.constants.ts
|
||||||
|
msgid "entry-type-detection-manga"
|
||||||
|
msgstr "Manga"
|
||||||
|
|
||||||
#: src/features/settings/screens/Appearance.tsx
|
#: src/features/settings/screens/Appearance.tsx
|
||||||
msgid "Manga item width"
|
msgid "Manga item width"
|
||||||
msgstr "Manga item width"
|
msgstr "Manga item width"
|
||||||
@@ -2373,16 +2382,26 @@ msgstr "Manga item width"
|
|||||||
msgid "Manga thumbnail as background"
|
msgid "Manga thumbnail as background"
|
||||||
msgstr "Manga thumbnail as background"
|
msgstr "Manga thumbnail as background"
|
||||||
|
|
||||||
#: src/features/manga/Manga.constants.ts
|
|
||||||
#: src/features/tracker/Tracker.constants.ts
|
#: src/features/tracker/Tracker.constants.ts
|
||||||
msgid "Manhua"
|
msgid "Manhua"
|
||||||
msgstr "Manhua"
|
msgstr "Manhua"
|
||||||
|
|
||||||
|
#. Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")
|
||||||
|
#. js-lingui-explicit-id
|
||||||
#: src/features/manga/Manga.constants.ts
|
#: src/features/manga/Manga.constants.ts
|
||||||
|
msgid "entry-type-detection-manhua"
|
||||||
|
msgstr "Manhua"
|
||||||
|
|
||||||
#: src/features/tracker/Tracker.constants.ts
|
#: src/features/tracker/Tracker.constants.ts
|
||||||
msgid "Manhwa"
|
msgid "Manhwa"
|
||||||
msgstr "Manhwa"
|
msgstr "Manhwa"
|
||||||
|
|
||||||
|
#. Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")
|
||||||
|
#. js-lingui-explicit-id
|
||||||
|
#: src/features/manga/Manga.constants.ts
|
||||||
|
msgid "entry-type-detection-manhwa"
|
||||||
|
msgstr "Manhwa"
|
||||||
|
|
||||||
#: src/features/migration/MigrationManager.ts
|
#: src/features/migration/MigrationManager.ts
|
||||||
msgid "Manual migration search for \"{title}\""
|
msgid "Manual migration search for \"{title}\""
|
||||||
msgstr "Manual migration search for \"{title}\""
|
msgstr "Manual migration search for \"{title}\""
|
||||||
@@ -4096,11 +4115,16 @@ msgstr "Warning"
|
|||||||
msgid "Weblate"
|
msgid "Weblate"
|
||||||
msgstr "Weblate"
|
msgstr "Weblate"
|
||||||
|
|
||||||
#: src/features/manga/Manga.constants.ts
|
|
||||||
#: src/features/reader/settings/ReaderSettings.constants.tsx
|
#: src/features/reader/settings/ReaderSettings.constants.tsx
|
||||||
msgid "Webtoon"
|
msgid "Webtoon"
|
||||||
msgstr "Webtoon"
|
msgstr "Webtoon"
|
||||||
|
|
||||||
|
#. Used to detect the type of an entry by using it to check if the genre/tags of an entry includes this string. This is NOT shown to any user. Do NOT include any unnecessary text or characters, this will break the type detection (e.g. "MangaInMyLanguage (Manga)")
|
||||||
|
#. js-lingui-explicit-id
|
||||||
|
#: src/features/manga/Manga.constants.ts
|
||||||
|
msgid "entry-type-detection-webtoon"
|
||||||
|
msgstr "Webtoon"
|
||||||
|
|
||||||
#: src/features/settings/screens/About.tsx
|
#: src/features/settings/screens/About.tsx
|
||||||
#: src/features/settings/screens/Settings.tsx
|
#: src/features/settings/screens/Settings.tsx
|
||||||
#: src/features/settings/screens/WebUISettings.tsx
|
#: src/features/settings/screens/WebUISettings.tsx
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ const outputFilePath = path.join(import.meta.dirname, `../../../${OUTPUT_FILE_PA
|
|||||||
const localesDirPath = path.join(import.meta.dirname, '../../../src/i18n/locales');
|
const localesDirPath = path.join(import.meta.dirname, '../../../src/i18n/locales');
|
||||||
|
|
||||||
const MANGA_TYPE_TO_MSG_IDS = {
|
const MANGA_TYPE_TO_MSG_IDS = {
|
||||||
MANGA: ['Manga'],
|
MANGA: ['entry-type-detection-manga', 'Manga'],
|
||||||
COMIC: ['Comic'],
|
COMIC: ['entry-type-detection-comic', 'Comic'],
|
||||||
WEBTOON: ['Webtoon', 'Long strip'],
|
WEBTOON: ['entry-type-detection-webtoon', 'entry-type-detection-long-strip', 'Webtoon', 'Long strip'],
|
||||||
MANHWA: ['Manhwa', 'Long strip'],
|
MANHWA: ['entry-type-detection-manhwa', 'entry-type-detection-long-strip', 'Manhwa', 'Long strip'],
|
||||||
MANHUA: ['Manhua', 'Long strip'],
|
MANHUA: ['entry-type-detection-manhua', 'entry-type-detection-long-strip', 'Manhua', 'Long strip'],
|
||||||
} as const satisfies Record<string, string[]>;
|
} as const satisfies Record<string, string[]>;
|
||||||
|
|
||||||
type MangaTypeMsgId = (typeof MANGA_TYPE_TO_MSG_IDS)[keyof typeof MANGA_TYPE_TO_MSG_IDS][number];
|
type MangaTypeMsgId = (typeof MANGA_TYPE_TO_MSG_IDS)[keyof typeof MANGA_TYPE_TO_MSG_IDS][number];
|
||||||
@@ -64,7 +64,7 @@ const allTranslationsByMsgId = poFiles
|
|||||||
const translationsByMangaType = Object.fromEntries(
|
const translationsByMangaType = Object.fromEntries(
|
||||||
Object.entries(MANGA_TYPE_TO_MSG_IDS).map(([mangaType, msgIds]) => [
|
Object.entries(MANGA_TYPE_TO_MSG_IDS).map(([mangaType, msgIds]) => [
|
||||||
mangaType,
|
mangaType,
|
||||||
[...new Set([...msgIds, ...msgIds.flatMap((msgId) => [...(allTranslationsByMsgId.get(msgId) ?? [])])])],
|
[...new Set([...msgIds.flatMap((msgId) => [...(allTranslationsByMsgId.get(msgId) ?? [])])])],
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user