Skip to content

Commit

Permalink
chore: add missing and improve Chinese translation
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Jan 24, 2024
1 parent 3db6f16 commit 43d079d
Show file tree
Hide file tree
Showing 39 changed files with 41 additions and 49 deletions.
3 changes: 2 additions & 1 deletion src/database/queries/CategoryQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { noop } from 'lodash-es';
import { BackupCategory, Category, NovelCategory, CCategory } from '../types';
import { showToast } from '@utils/showToast';
import { txnErrorCallback } from '../utils/helpers';
import { getString } from '@strings/translations';
const db = SQLite.openDatabase('lnreader.db');

const getCategoriesQuery = `
Expand Down Expand Up @@ -69,7 +70,7 @@ const deleteCategoryQuery = 'DELETE FROM Category WHERE id = ?';

export const deleteCategoryById = (category: Category): void => {
if (category.sort <= 2) {
return showToast('You cant delete default category');
return showToast(getString('categories.cantDeleteDefault'));
}
db.transaction(tx => {
tx.executeSql(
Expand Down
9 changes: 5 additions & 4 deletions src/database/queries/ChapterQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { txnErrorCallback } from '@database/utils/helpers';
import { Plugin } from '@plugins/types';
import { Update } from '../types';
import { noop } from 'lodash-es';
import { getString } from '@strings/translations';

const db = SQLite.openDatabase('lnreader.db');

Expand Down Expand Up @@ -107,7 +108,7 @@ export const getPrevChapter = (
(_txObj, results) =>
resolve(results.rows.item(results.rows.length - 1)),
() => {
showToast("There's no previous chapter");
showToast(getString('readerScreen.noPreviousChapter'));
return false;
},
);
Expand Down Expand Up @@ -137,7 +138,7 @@ export const getNextChapter = (
[novelId, chapterId],
(_txObj, results) => resolve(results.rows.item(0)),
() => {
showToast("There's no next Chapter");
showToast(getString('readerScreen.noNextChapter'));
return false;
},
);
Expand Down Expand Up @@ -348,7 +349,7 @@ export const deleteDownloads = async (chapters: DownloadedChapter[]) => {
);
db.transaction(tx => {
tx.executeSql('UPDATE Chapter SET isDownloaded = 0', [], () =>
showToast('Deleted all Downloads'),
showToast(getString('toast.deletedAllDownloads')),
);
});
};
Expand Down Expand Up @@ -383,7 +384,7 @@ export const deleteReadChaptersFromDb = async () => {
db.transaction(tx => {
tx.executeSql(updateIsDownloadedQuery, [], noop, txnErrorCallback);
});
showToast('Read chapters deleted');
showToast(getString('toast.readChaptersDeleted'));
};

const bookmarkChapterQuery = 'UPDATE Chapter SET bookmark = ? WHERE id = ?';
Expand Down
4 changes: 2 additions & 2 deletions src/database/queries/NovelQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const removeNovelsFromLibrary = (novelIds: Array<number>) => {
`DELETE FROM NovelCategory WHERE novelId IN (${novelIds.join(', ')});`,
);
});
showToast('Removed from Library');
showToast(getString('toast.removedFromLibrary'));
};

export const getCachedNovels = (): Promise<NovelInfo[]> => {
Expand All @@ -175,7 +175,7 @@ export const deleteCachedNovels = async () => {
tx.executeSql(
'DELETE FROM Novel WHERE inLibrary = 0',
[],
() => showToast('Cached novels deleted'),
() => showToast(getString('advancedSettings.cachedNovelsDeletedToast')),
txnErrorCallback,
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/SettingsAppearanceScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const AppearanceSettings = ({ navigation }: AppearanceSettingsScreenProps) => {
theme={theme}
/>
<SwitchSetting
label={getString('advancedSettings.useFab')}
label={getString('advancedSettings.useFAB')}
value={useFabForContinueReading}
onPress={() =>
setAppSettings({
Expand Down
1 change: 0 additions & 1 deletion strings/languages/af_ZA/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/ar_SA/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "يوجد تصنيف بهذا الاسم بالفعل!",
"defaultCategory": "التصنيف الافتراضي"
},
"settings": {},
"downloadScreen": {
"dbInfo": "يتم حفظ التنزيلات في قاعدة بيانات SQLite",
"downloadChapters": "الفصول المحملة",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/ca_ES/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/cs_CZ/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/da_DK/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/de_DE/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Eine Kategorie mit diesem Namen existiert bereits!",
"defaultCategory": "Standard-Kategorie"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads werden in einer SQLite-Datenbank gespeichert.",
"downloadChapters": "Heruntergeladene Kapitel",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/el_GR/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
9 changes: 8 additions & 1 deletion strings/languages/en/strings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"advancedSettings": {
"cachedNovelsDeletedToast": "Cached novels deleted",
"clearCachedNovels": "Clear cached novels",
"clearCachedNovelsDesc": "Delete cached novels which not in your library",
"clearDatabaseWarning": "Are you sure? Read and Downloaded chapters and progress of non-library novels will be lost.",
Expand All @@ -11,7 +12,7 @@
"deleteReadChapters": "Delete read chapters",
"deleteReadChaptersDialogTitle": "Are you sure? All chapters marked as read will be deleted.",
"importEpub": "Import Epub",
"useFab": "Use FAB instead of button",
"useFAB": "Use FAB instead of button",
"userAgent": "User Agent"
},
"browse": "Browse",
Expand Down Expand Up @@ -47,6 +48,7 @@
},
"categories": {
"addCategories": "Add category",
"cantDeleteDefault": "You cant delete default category",
"defaultCategory": "Default category",
"deleteModal": {
"desc": "Do you wish to delete category",
Expand Down Expand Up @@ -407,6 +409,11 @@
"totalChapters": "Total chapters",
"unreadChapters": "Unread chapters"
},
"toast": {
"deletedAllDownloads": "Deleted all Downloads",
"readChaptersDeleted": "Read chapters deleted",
"removedFromLibrary": "Removed from Library"
},
"updates": "Updates",
"updatesScreen": {
"deleteChapter": "Delete %{name}",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/es_ES/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "¡Ya existe una categoría con este nombre!",
"defaultCategory": "Categoría por defecto"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Las descargas se guardan en una base de datos SQLite.",
"downloadChapters": "capítulos descargados",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/fi_FI/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/fr_FR/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Une catégorie avec ce nom existe déjà !",
"defaultCategory": "Catégorie par défaut"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Les téléchargements sont enregistrés dans une base de données SQLite.",
"downloadChapters": "chapitres téléchargés",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/he_IL/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/hi_IN/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/hu_HU/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Már létezik ilyen nevű kategória!",
"defaultCategory": "Alapértelmezett kategória"
},
"settings": {},
"downloadScreen": {
"dbInfo": "A letöltések egy SQLite adatbázisban vannak elmentve.",
"downloadChapters": "letöltött fejezetek",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/id_ID/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Kategori dengan nama ini sudah ada!\n",
"defaultCategory": "Kategori default\n"
},
"settings": {},
"downloadScreen": {
"dbInfo": "",
"downloadChapters": "downloaded chapters\n",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/it_IT/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Una categoria con questo nome esiste già!",
"defaultCategory": "Categoria predefinita"
},
"settings": {},
"downloadScreen": {
"dbInfo": "I download sono salvati in un database SQLite.",
"downloadChapters": "Capitoli scaricati",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/ja_JP/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "この名前のカテゴリーはすでに存在します。",
"defaultCategory": "デフォルトカテゴリー"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/ko_KR/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/nl_NL/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Er bestaat al een categorie met deze naam!",
"defaultCategory": "Standaard categorie"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/no_NO/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/or_IN/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/pl_PL/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/pt_BR/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Uma categoria com esse nome já existe!",
"defaultCategory": "Categoria padrão"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads são salvos em banco de dados SQLite.",
"downloadChapters": "Capítulos baixados",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/pt_PT/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/ro_RO/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/ru_RU/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Категория с таким названием уже существует!",
"defaultCategory": "Категория по умолчанию"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Загрузки сохраняются в базе данных SQLite.",
"downloadChapters": "загруженные главы",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/sq_AL/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/sr_SP/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/sv_SE/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "A category with this name already exists!",
"defaultCategory": "Default category"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/tr_TR/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Bu ada sahip bir kategori zaten var!",
"defaultCategory": "Varsayılan kategori"
},
"settings": {},
"downloadScreen": {
"dbInfo": "İndirilenler bir SQLite Veritabanında kaydedilmektedir.",
"downloadChapters": "İndirilen bölümler",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/uk_UA/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Категорія з такою назвою вже існує!",
"defaultCategory": "Категорія за замовчуванням"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Downloads are saved in a SQLite Database.",
"downloadChapters": "downloaded Chapters",
Expand Down
1 change: 0 additions & 1 deletion strings/languages/vi_VN/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"duplicateError": "Danh mục với tên này đã tồn tại!",
"defaultCategory": "Danh mục mặc định"
},
"settings": {},
"downloadScreen": {
"dbInfo": "Các chương tải về sẽ được lưu trong cơ sở dữ liệu SQLite.",
"downloadChapters": "chương đã tải về",
Expand Down
Loading

0 comments on commit 43d079d

Please sign in to comment.