Skip to content

Commit

Permalink
fix: adjust with the db source
Browse files Browse the repository at this point in the history
  • Loading branch information
iokkitan committed May 9, 2024
1 parent ed5b75e commit 22acec4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
32 changes: 16 additions & 16 deletions nextjs/app/_isomorphic/Dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function defaultPageURL(chhoeTaigi) {

const DICTIONARY_BY = {
[DICT_1895_JITPUN_SITAI_TANGI_MIALUI_CHIP]: {
code: 3, // TODO https://chhoe.taigi.info/JitpunSitaiTangiMialuiChip/1900001
code: DICT_1895_JITPUN_SITAI_TANGI_MIALUI_CHIP,
chineseName: "1895-1945 日本時代單語名彙集",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -176,7 +176,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1913_KAM_UILIM_TAIGI_JITIAN]: {
code: 1, // http://localhost:3000/han-peh/KamUilimTaigiJitian/1
code: DICT_1913_KAM_UILIM_TAIGI_JITIAN,
chineseName: "1913 甘為霖台語字典",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -216,7 +216,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1931_TAIJIT_SIN_SUSU]: {
code: -1,
code: DICT_1931_TAIJIT_SIN_SUSU,
chineseName: "1931 臺日新辭書",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -251,7 +251,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1932_TAIJIT_TOA_SUTIAN]: {
code: 4, // http://localhost:3000/han-peh/TaijitToaSutian/1
code: DICT_1932_TAIJIT_TOA_SUTIAN,
chineseName: "1932 臺日大辭典",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -296,7 +296,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1956_TAIOAN_PEHOE_KICHHOO_GIKU]: {
code: 5, // http://localhost:3000/han-peh/TaioanPehoeKichhooGiku/1
code: DICT_1956_TAIOAN_PEHOE_KICHHOO_GIKU,
chineseName: "1956 台灣白話基礎語句",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -342,7 +342,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1957_TAIOANGI_SIONGIONG_GILUI]: {
code: -1,
code: DICT_1957_TAIOANGI_SIONGIONG_GILUI,
chineseName: "1957 台灣語常用語彙",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -381,7 +381,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1973_EMBREE_TAIENG_SUTIAN]: {
code: 6, // http://localhost:3000/han-peh/EmbreeTaiengSutian/1
code: DICT_1973_EMBREE_TAIENG_SUTIAN,
chineseName: "1973 Embree台英辭典",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -420,7 +420,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1976_MARYKNOLL_TAIENG_SUTIAN]: {
code: 7, // http://localhost:3000/han-peh/MaryknollTaiengSutian/1
code: DICT_1976_MARYKNOLL_TAIENG_SUTIAN,
chineseName: "1976 Maryknoll台英辭典",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -454,7 +454,7 @@ const DICTIONARY_BY = {
},
},
[DICT_1979_MARYKNOLL_ENGTAI_SUTIAN]: {
code: -1,
code: DICT_1979_MARYKNOLL_ENGTAI_SUTIAN,
chineseName: "1979 Maryknoll英台辭典",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -489,7 +489,7 @@ const DICTIONARY_BY = {
},
},
[DICT_2002_TAIHOA_SOANNTENG_SUTIAN]: {
code: 9, // http://localhost:3000/han-peh/TaihoaSoanntengSutian/1
code: DICT_2002_TAIHOA_SOANNTENG_SUTIAN,
chineseName: "2002⁺ 台華線頂辭典",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -524,7 +524,7 @@ const DICTIONARY_BY = {
},
},
[DICT_2009_TJ_TAIGI_PEHOE_SIOSUTIAN_SEKIN]: {
code: 11, // http://localhost:3000/han-peh/TJTaigiPehoeSioSutianSekin/1
code: DICT_2009_TJ_TAIGI_PEHOE_SIOSUTIAN_SEKIN,
chineseName: "2009 TJ台語白話小詞典(索引)",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -561,7 +561,7 @@ const DICTIONARY_BY = {
},
},
[DICT_2011_KAUIOKPOO_SUTIAN]: {
code: 12, // http://localhost:3000/han-peh/KauiokPooSutian/1
code: DICT_2011_KAUIOKPOO_SUTIAN,
chineseName: "2011⁺ 教育部辭典⁺",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -605,7 +605,7 @@ const DICTIONARY_BY = {
},
},
[DICT_2016_ITAIGI]: {
code: 13, // http://localhost:3000/han-peh/ITaigi/1
code: DICT_2016_ITAIGI,
chineseName: "2016⁺ iTaigi",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -638,7 +638,7 @@ const DICTIONARY_BY = {
},
},
[DICT_CHHOETAIGI_CHENGPOO_SUTIAN]: {
code: -1,
code: DICT_CHHOETAIGI_CHENGPOO_SUTIAN,
chineseName: "ChhoeTaigi增補辭典",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -670,7 +670,7 @@ const DICTIONARY_BY = {
pageURL: defaultPageURL,
},
[DICT_TAIOAN_BUNHAK_TUCHOK_SEKIN]: {
code: -1,
code: DICT_TAIOAN_BUNHAK_TUCHOK_SEKIN,
chineseName: "台灣文學著作索引",
brief: {
PojUnicode: "白話字",
Expand Down Expand Up @@ -726,7 +726,7 @@ const DICTIONARY_BY = {
},
},
[DICT_SOANNTENG_MUITHE_SEKIN]: {
code: 14, // http://localhost:3000/han-peh/SoanntengMuitheSekin/1
code: DICT_SOANNTENG_MUITHE_SEKIN,
chineseName: "線頂媒體索引",
brief: {
PojUnicode: "白話字",
Expand Down
2 changes: 1 addition & 1 deletion nextjs/app/_rsc/RSCFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getTranslations } from "next-intl/server";
import Footer from "@/components/Footer";

export default async function RSCFooter({ lang }) {
const t = await getTranslations("RSCFooter");
// const t = await getTranslations("RSCFooter");
// translations={{
// basic: t("basic"),
// advanced: t("advanced"),
Expand Down
3 changes: 1 addition & 2 deletions nextjs/app/_rsc/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ async function basicDict(dictName, columns, pageAt, pageSize) {
if (!isDictionaryAcceptsColumns(dictionary, columns)) {
return false;
}
console.log(`basicDict [${dictName}], given: `, columns);
const [countResult, wordList] = await Promise.all([
sql`
SELECT count("JoinedWordID")
Expand All @@ -110,7 +109,7 @@ LIMIT ${pageSize}
OFFSET ${pageAt * pageSize}
`,
]);
console.log(countResult[0].count);
console.log(`Has: ${countResult[0].count} basicDict [${dictName}]. Given: `, columns);
return {
dic: dictName,
total: countResult[0].count,
Expand Down

0 comments on commit 22acec4

Please sign in to comment.