Skip to content

Commit

Permalink
refactor: update thai lang
Browse files Browse the repository at this point in the history
  • Loading branch information
dvgamerr committed Mar 15, 2024
1 parent 7a4ecb7 commit c97f69e
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 26 deletions.
12 changes: 10 additions & 2 deletions src/components/Section2Contact.astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const { experience } = Astro.props
<div class="d-print-only">
{getContactPrint().filter((e: any) => !e.qrcode).map((e: any) => (
<address>
<strong>{e.label}</strong><br>
<strong>{t(`contact.${e.label.toLowerCase()}`)}</strong><br>
<a href={e.url} target={filterPrint(e) ? '_blank' : ''} class="d-flex align-flex-start justify-content-start" style="gap: .2em;">
<div set:html={iconAssets[e.icon || 'chrome']} style="width: 16px;" />
<div style="padding-top:.1em">{e.text}</div>
Expand All @@ -66,7 +66,7 @@ const { experience } = Astro.props
{getContactView().map((e: any) => (
<div class="d-print-none">
<address>
<strong>{e.label}</strong><br>
<strong>{t(`contact.${e.label.toLowerCase()}`)}</strong><br>
<a href={e.url} target={filterPrint(e) ? '_blank' : ''} class="d-flex align-flex-start justify-content-start" style="gap: .2em;">
<div set:html={iconAssets[e.icon || 'chrome']} style="width: 16px;" />
<div style="padding-top:.1em">{e.text}</div>
Expand All @@ -78,3 +78,11 @@ const { experience } = Astro.props
</div>
</div>
</section>

<style>
@media print {
address a {
color: inherit !important;
}
}
</style>
22 changes: 8 additions & 14 deletions src/components/Section5CodingHistory.astro
Original file line number Diff line number Diff line change
@@ -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')}`
}
---
<section class="section-wrapper section-coding d-print-none">
<div class="row">
<div class="col-lg-9 col-md-11">
<div class="section-title">
<h2>Code History</h2>
<h2>{t('code-history')}</h2>
<small>wakatime.com</small>
</div>
</div>
<div class="col-lg-27 col-md-25 col-sm-36 d-grid stats">
<div class="stats-item">
<div class="value">{parseTime(coding.weekly_seconds)}</div>
<div class="name">
Weekly Coding
</div>
<div class="name">{t('code-history.weekly')}</div>
</div>
<div class="stats-item">
<div class="value">{parseTime(coding.average_seconds)}</div>
<div class="name">
Daily Average
</div>
<div class="name">{t('code-history.daily')}</div>
</div>
<div class="stats-item">
<div class="value">{parseTime(coding.best_seconds)}</div>
<div class="name">
Best Coding
</div>
<div class="name">{t('code-history.best')}</div>
</div>
<div class="stats-item">
<div class="value">{coding.languages.length}</div>
<div class="name">
languages
</div>
<div class="name">{t('code-history.languages')}</div>
</div>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Section6Skill.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
import { getTranslate } from '../i18n/utils'
const t = getTranslate(Astro.url)
interface Props {
experience: any
Expand All @@ -12,14 +14,14 @@ const skillList = Object.keys(experience.skill)
<div class="row">
<div class="col-lg-9 col-md-11">
<div class="section-title">
<h2>Skills</h2>
<h2>{t('skills')}</h2>
</div>
</div>
<div class="col-lg-27 col-md-25 col-sm-36">
<div class="row">
{skillList.map((e:string) => (
<div class="col-md-36 skill-list">
<h3 class="mb-1">{e}</h3>
<h3 class="mb-1">{t(`skills.${e}`)}</h3>
<ul class="pb-3">
{experience.skill[e].filter((e:string) => !['hack'].includes(e.toLowerCase())).sort().map((l:any) => (<li>{l}</li>))}
</ul>
Expand Down
5 changes: 4 additions & 1 deletion src/components/Section7Education.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
import { getTranslate } from '../i18n/utils'
const t = getTranslate(Astro.url)
interface Props {
resume: any
}
Expand All @@ -9,7 +12,7 @@ const { resume } = Astro.props
<div class="row">
<div class="col-lg-9 col-md-11">
<div class="section-title">
<h2>Education</h2>
<h2>{t('education')}</h2>
</div>
</div>
<div class="col-lg-27 col-md-25 col-sm-36">
Expand Down
7 changes: 5 additions & 2 deletions src/components/SectionFooter.astro
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -10,8 +13,8 @@ const getYear = (new Date()).getFullYear()
<div class="row">
<div class="col-36">
<div class="copytext">
&copy; {getYear} <b>dvgamerr</b> sponsor by
<a href="https://sponsor.dvgamerr.app/" target="_blank">Kananek T.</a> and
&copy; {getYear} <b>dvgamerr</b> {t('footer.sponser')}
<a href="https://sponsor.dvgamerr.app/" target="_blank">Kananek T.</a> {t('footer.and')}
<a href="https://webring.wonderful.software#dvgamerr.app">
webring <Image alt="webring" src={webring} width={14} height={14} style="margin-top: -.2em">
</a> v{version}
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/experience.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
"Discord",
"Slack"
],
"SQL & NOSQL": [
"sql": [
"PostgreSQL",
"Redis",
"MongoDB",
Expand All @@ -218,7 +218,7 @@
"MSSQL",
"SQLite"
],
"OS & Cloud": [
"os": [
"Chat GPT",
"AWS",
"Azure",
Expand Down Expand Up @@ -288,4 +288,4 @@
"icon": "email"
}
]
}
}
32 changes: 32 additions & 0 deletions src/i18n/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
},
Expand Down Expand Up @@ -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": "จำนวนบรรทัดของโค้ด",
Expand All @@ -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": "และ",
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ const { experience = expData, resume = resumeData } = Astro.props;
<div class="row">
<div class="col-lg-9 col-md-11">
<div class="section-title">
<h2>Work Experience</h2>
{isNewJob(e.range.begin) ? (<span class="badge text-bg-success" style="margin-top: 1em;">NEW JOB</span>):(<span />)}
<h2>{t('experience')}</h2>
{isNewJob(e.range.begin) ? (<span class="badge text-bg-success" style="margin-top: 1em;">{t('experience.newjob')}</span>):(<span />)}
</div>
</div>
<div class="col-lg-27 col-md-25 col-sm-36 content-job">
Expand Down

0 comments on commit c97f69e

Please sign in to comment.