diff --git a/src/components/Section2Contact.astro b/src/components/Section2Contact.astro index fd5c5f9..4a66931 100644 --- a/src/components/Section2Contact.astro +++ b/src/components/Section2Contact.astro @@ -54,7 +54,7 @@ const { experience } = Astro.props
{getContactPrint().filter((e: any) => !e.qrcode).map((e: any) => (
- {e.label}
+ {t(`contact.${e.label.toLowerCase()}`)}
{e.text}
@@ -66,7 +66,7 @@ const { experience } = Astro.props {getContactView().map((e: any) => (
+ + diff --git a/src/components/Section5CodingHistory.astro b/src/components/Section5CodingHistory.astro index 992b55e..5008607 100644 --- a/src/components/Section5CodingHistory.astro +++ b/src/components/Section5CodingHistory.astro @@ -1,42 +1,36 @@ --- import coding from '../i18n/coding.json' +import { getTranslate } from '../i18n/utils' +const t = getTranslate(Astro.url) const parseTime = (seconds:number = 0) => { - return `${seconds > 60 * 60 ? `${Math.round(seconds / 60 / 60)}h ` : ''}${Math.round(seconds / 60 % 60)}m` + return `${seconds > 60 * 60 ? `${Math.round(seconds / 60 / 60)}${t('code-history.hour')} ` : ''}${Math.round(seconds / 60 % 60)}${t('code-history.minute')}` } ---
-

Code History

+

{t('code-history')}

wakatime.com
{parseTime(coding.weekly_seconds)}
-
- Weekly Coding -
+
{t('code-history.weekly')}
{parseTime(coding.average_seconds)}
-
- Daily Average -
+
{t('code-history.daily')}
{parseTime(coding.best_seconds)}
-
- Best Coding -
+
{t('code-history.best')}
{coding.languages.length}
-
- languages -
+
{t('code-history.languages')}
diff --git a/src/components/Section6Skill.astro b/src/components/Section6Skill.astro index e09f110..2e34e4b 100644 --- a/src/components/Section6Skill.astro +++ b/src/components/Section6Skill.astro @@ -1,4 +1,6 @@ --- +import { getTranslate } from '../i18n/utils' +const t = getTranslate(Astro.url) interface Props { experience: any @@ -12,14 +14,14 @@ const skillList = Object.keys(experience.skill)
-

Skills

+

{t('skills')}

{skillList.map((e:string) => (
-

{e}

+

{t(`skills.${e}`)}

    {experience.skill[e].filter((e:string) => !['hack'].includes(e.toLowerCase())).sort().map((l:any) => (
  • {l}
  • ))}
diff --git a/src/components/Section7Education.astro b/src/components/Section7Education.astro index 699bd14..6c93ad7 100644 --- a/src/components/Section7Education.astro +++ b/src/components/Section7Education.astro @@ -1,4 +1,7 @@ --- +import { getTranslate } from '../i18n/utils' +const t = getTranslate(Astro.url) + interface Props { resume: any } @@ -9,7 +12,7 @@ const { resume } = Astro.props
-

Education

+

{t('education')}

diff --git a/src/components/SectionFooter.astro b/src/components/SectionFooter.astro index 2b9605d..a82504c 100644 --- a/src/components/SectionFooter.astro +++ b/src/components/SectionFooter.astro @@ -1,4 +1,7 @@ --- +import { getTranslate } from '../i18n/utils' +const t = getTranslate(Astro.url) + import { Image } from 'astro:assets'; import { version } from '../../package.json'; import webring from '../assets/webring.svg' @@ -10,8 +13,8 @@ const getYear = (new Date()).getFullYear()
- © {getYear} dvgamerr sponsor by - Kananek T. and + © {getYear} dvgamerr {t('footer.sponser')} + Kananek T. {t('footer.and')} webring webring v{version} diff --git a/src/i18n/experience.json b/src/i18n/experience.json index 037b43d..32eefb1 100644 --- a/src/i18n/experience.json +++ b/src/i18n/experience.json @@ -208,7 +208,7 @@ "Discord", "Slack" ], - "SQL & NOSQL": [ + "sql": [ "PostgreSQL", "Redis", "MongoDB", @@ -218,7 +218,7 @@ "MSSQL", "SQLite" ], - "OS & Cloud": [ + "os": [ "Chat GPT", "AWS", "Azure", @@ -288,4 +288,4 @@ "icon": "email" } ] -} \ No newline at end of file +} diff --git a/src/i18n/ui.ts b/src/i18n/ui.ts index 2457e6c..ef167ed 100644 --- a/src/i18n/ui.ts +++ b/src/i18n/ui.ts @@ -31,6 +31,11 @@ export const ui = { 'head.availability.yes': 'Ready', 'head.availability.no': 'Not yet', "contact": "contact", + "contact.github": "github", + "contact.twitter": "twitter", + "contact.instrgram": "instrgram", + "contact.email": "email", + "contact.mobile": "mobile", "my-coding": "my coding", "my-coding.experience": "work experience", "my-coding.loc": "line of code", @@ -51,9 +56,20 @@ export const ui = { "daytime.sat": "sat", "daytime.sun": "sun", "code-history": "code history", + "code-history.hour": "h", + "code-history.minute": "m", + "code-history.weekly": "weekly coding", + "code-history.daily": "daily average", + "code-history.best": "best coding", + "code-history.languages": "languages", "skills": "skills", + "skills.coding": "coding", + "skills.tools": "tools", + "skills.sql": "sql & nosql", + "skills.os": "os & cloud", "education": "education", "experience": "work experience", + "experience.newjob": "new job", "footer.sponser": "sponsor by", "footer.and": "and", }, @@ -82,6 +98,11 @@ export const ui = { 'head.availability.yes': 'พร้อม', 'head.availability.no': 'ยังไม่เปิดโอกาส', "contact": "ช่องทางติดต่อ", + "contact.github": "กิตฮับ", + "contact.twitter": "ทวิสเตอร์", + "contact.instrgram": "ไอจี", + "contact.email": "อีเมล์", + "contact.mobile": "มือถือ", "my-coding": "โค้ดดิ่ง", "my-coding.experience": "ประสบการณ์ทำงานทั้งหมด", "my-coding.loc": "จำนวนบรรทัดของโค้ด", @@ -102,9 +123,20 @@ export const ui = { "daytime.sat": "เสาร์", "daytime.sun": "อาทิตย์", "code-history": "สถิติโค้ดดิ่ง", + "code-history.hour": "ชม.", + "code-history.minute": "น.", + "code-history.weekly": "ดีที่สุดในอาทิตย์นี้", + "code-history.daily": "ค่าเฉลี่ยต่อวัน", + "code-history.best": "ดีที่สุด", + "code-history.languages": "ภาษาที่เขียนได้", "skills": "สกิลทำงาน", + "skills.coding": "โค้ดดิ่ง", + "skills.tools": "เครื่องมือ", + "skills.sql": "ฐานข้อมูล", + "skills.os": "ระบบปฏิบัติการและคลาวด์", "education": "การศีกษา", "experience": "ประสบการ์ทำงาน", + "experience.newjob": "งานใหม่", "footer.sponser": "สนับสนุนโดย", "footer.and": "และ", }, diff --git a/src/pages/index.astro b/src/pages/index.astro index d43aa0b..2abf063 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -79,8 +79,8 @@ const { experience = expData, resume = resumeData } = Astro.props;
-

Work Experience

- {isNewJob(e.range.begin) ? (NEW JOB):()} +

{t('experience')}

+ {isNewJob(e.range.begin) ? ({t('experience.newjob')}):()}