Browse Source

feat: add Thai translations for i18n

imwald
codytseng 9 months ago
parent
commit
2298254903
  1. 23
      src/components/TranslateButton/index.tsx
  2. 3
      src/i18n/index.ts
  3. 277
      src/i18n/locales/th.ts

23
src/components/TranslateButton/index.tsx

@ -49,16 +49,23 @@ export default function TranslateButton({ @@ -49,16 +49,23 @@ export default function TranslateButton({
return false
}
const hasChinese = /[\u4e00-\u9fff]/.test(cleanText)
const hasJapanese = /[\u3040-\u309f\u30a0-\u30ff]/.test(cleanText)
const hasArabic = /[\u0600-\u06ff]/.test(cleanText)
const hasRussian = /[\u0400-\u04ff]/.test(cleanText)
if (/[\u3040-\u309f\u30a0-\u30ff]/.test(cleanText)) {
return i18n.language !== 'ja'
}
if (/[\u0e00-\u0e7f]/.test(cleanText)) {
return i18n.language !== 'th'
}
if (/[\u4e00-\u9fff]/.test(cleanText)) {
return i18n.language !== 'zh'
}
if (hasJapanese) return i18n.language !== 'ja'
if (hasChinese && !hasJapanese) return i18n.language !== 'zh'
if (/[\u0600-\u06ff]/.test(cleanText)) {
return i18n.language !== 'ar'
}
if (hasArabic) return i18n.language !== 'ar'
if (hasRussian) return i18n.language !== 'ru'
if (/[\u0400-\u04ff]/.test(cleanText)) {
return i18n.language !== 'ru'
}
try {
const detectedLang = franc(cleanText)

3
src/i18n/index.ts

@ -13,6 +13,7 @@ import pl from './locales/pl' @@ -13,6 +13,7 @@ import pl from './locales/pl'
import pt_BR from './locales/pt-BR'
import pt_PT from './locales/pt-PT'
import ru from './locales/ru'
import th from './locales/th'
import zh from './locales/zh'
const languages = {
@ -27,6 +28,7 @@ const languages = { @@ -27,6 +28,7 @@ const languages = {
'pt-BR': { resource: pt_BR, name: 'Português (Brasil)' },
'pt-PT': { resource: pt_PT, name: 'Português (Portugal)' },
ru: { resource: ru, name: 'Русский' },
th: { resource: th, name: 'ไทย' },
zh: { resource: zh, name: '简体中文' }
} as const
@ -73,6 +75,7 @@ i18n.services.formatter?.add('date', (timestamp, lng) => { @@ -73,6 +75,7 @@ i18n.services.formatter?.add('date', (timestamp, lng) => {
case 'pt-BR':
case 'pt-PT':
case 'ar':
case 'th':
return dayjs(timestamp).format('DD/MM/YYYY')
default:
return dayjs(timestamp).format('MMM D, YYYY')

277
src/i18n/locales/th.ts

@ -0,0 +1,277 @@ @@ -0,0 +1,277 @@
export default {
translation: {
'Welcome! 🥳': 'ยนดอนรบ! 🥳',
About: 'เกยวกบ',
'New Note': 'โนตใหม',
Post: 'โพสต',
Home: 'หนาหลก',
'Relay settings': 'การตงคารเลย',
Settings: 'การตงคา',
SidebarRelays: 'รเลย',
Refresh: 'รเฟรช',
Profile: 'โปรไฟล',
Logout: 'ออกจากระบบ',
Following: 'กำลงตดตาม',
followings: 'กำลงตดตาม',
reposted: 'รโพสต',
'just now': 'เมอสกคร',
'n minutes ago': '{{n}} นาทแลว',
'n m': '{{n}}น',
'n hours ago': '{{n}} ชวโมงทแลว',
'n h': '{{n}}ชม',
'n days ago': '{{n}} วนทแลว',
'n d': '{{n}}วน',
date: '{{timestamp, date}}',
Follow: 'ตดตาม',
Unfollow: 'เลกตดตาม',
'Follow failed': 'ตดตามไมสำเรจ',
'Unfollow failed': 'เลกตดตามไมสำเรจ',
'show new notes': 'แสดงโนตใหม',
'loading...': 'กำลงโหลด...',
'no more notes': 'ไมโนตเพมเตม',
'reply to': 'ตอบกลบถง',
reply: 'ตอบกลบ',
Reply: 'ตอบกลบ',
'load more older replies': 'โหลดการตอบกลบเพมเตม',
'Write something...': 'เขยนอะไรบางอยาง...',
Cancel: 'ยกเลก',
Mentions: 'การกลาวถง',
'Failed to post': 'โพสตไมสำเรจ',
'Post successful': 'โพสตสำเรจ',
'Your post has been published': 'โพสตของคณถกเผยแพรแลว',
Repost: 'รโพสต',
Quote: 'อางอง',
'Copy event ID': 'คดลอก ID เหตการณ',
'Copy user ID': 'คดลอก ID ผใช',
'View raw event': 'ดเหตการณบ',
Like: 'ถกใจ',
'switch to light theme': 'เปลยนเปนธมสวาง',
'switch to dark theme': 'เปลยนเปนธมมด',
'switch to system theme': 'เปลยนเปนธมระบบ',
Note: 'โนต',
note: 'โนต',
"username's following": 'ผ {{username}} กำลงตดตาม',
"username's used relays": 'รเลย {{username}} ใชงาน',
"username's muted": 'ผ {{username}} ปดเสยง',
Login: 'เขาสระบบ',
'Follows you': 'ตดตามคณ',
'Relay Settings': 'การตงคารเลย',
'Relay set name': 'ชอชดรเลย',
'Add a new relay set': 'เพมชดรเลยใหม',
Add: 'เพม',
'n relays': '{{n}} รเลย',
Rename: 'เปลยนชอ',
'Copy share link': 'คดลอกลงกแชร',
Delete: 'ลบ',
'Relay already exists': 'รเลยอยแลว',
'invalid relay URL': 'URL รเลยไมกตอง',
'Add a new relay': 'เพมรเลยใหม',
back: 'ยอนกลบ',
'Lost in the void': 'หลงอยในความวางเปลา',
'Carry me home': 'พาฉนกลบบาน',
'no replies': 'ไมการตอบกลบ',
'Reply to': 'ตอบกลบถง',
Search: 'คนหา',
'The relays you are connected to do not support search':
'รเลยณเชอมตอไมรองรบการคนหา',
'Show more...': 'แสดงเพมเตม...',
'All users': 'ผใชงหมด',
'Display replies': 'แสดงการตอบกลบ',
Notes: 'โนต',
Replies: 'การตอบกลบ',
Notifications: 'การแจงเตอน',
'no more notifications': 'ไมการแจงเตอนเพมเตม',
'Using private key login is insecure. It is recommended to use a browser extension for login, such as alby, nostr-keyx or nos2x.':
'การเขาสระบบดวยควนตวไมปลอดภย แนะนำใหใชวนขยายเบราวเซอร เชน alby, nostr-keyx หรอ nos2x',
'Login with Browser Extension': 'เขาสระบบดวยสวนขยายเบราวเซอร',
'Login with Bunker': 'เขาสระบบดวย Bunker',
'Login with Private Key': 'เขาสระบบดวยควนตว',
'reload notes': 'โหลดโนตใหม',
'Logged in Accounts': 'บญชเขาสระบบ',
'Add an Account': 'เพมบญช',
'More options': 'ตวเลอกเพมเตม',
'Add client tag': 'เพมแทกไคลเอนต',
'Show others this was sent via Jumble': 'แสดงใหนเหนวาสงผาน Jumble',
'Are you sure you want to logout?': 'คณแนใจหรอไมาตองการออกจากระบบ?',
'relay sets': 'ชดรเลย',
edit: 'แกไข',
Languages: 'ภาษา',
Theme: 'ธม',
System: 'ระบบ',
Light: 'สวาง',
Dark: 'มด',
Temporary: 'ชวคราว',
'Choose a relay set': 'เลอกชดรเลย',
'Switch account': 'สลบบญช',
Pictures: 'รปภาพ',
'Picture note': 'โนตรปภาพ',
'A special note for picture-first clients like Olas':
'หมายเหตเศษสำหรบไคลเอนตเนนรปภาพเชน Olas',
'Picture note requires images': 'โนตรปภาพตองมปภาพ',
Relays: 'รเลย',
image: 'รปภาพ',
'R & W': 'อาน & เขยน',
Read: 'อาน',
Write: 'เขยน',
'Pull relay sets': 'ดงชดรเลย',
'Select the relay sets you want to pull': 'เลอกชดรเลยองการดง',
'No relay sets found': 'ไมพบชดรเลย',
'Pull n relay sets': 'ดงชดรเลย {{n}} ชด',
Pull: 'ดง',
'Select all': 'เลอกทงหมด',
'Relay Sets': 'ชดรเลย',
'Read & Write Relays': 'รเลยานและเขยน',
'read relays description':
'รเลยานใชสำหรบคนหาเหตการณเกยวกบคณ ผใชนจะเผยแพรเหตการณองการใหณเหนไปยงรเลยานของคณ',
'write relays description':
'รเลยเขยนใชสำหรบเผยแพรเหตการณของคณ ผใชนจะคนหาเหตการณของคณจากรเลยเขยนของคณ',
'read & write relays notice': 'จำนวนเซฟเวอรานและเขยนควรอยระหวาง 2 ถง 4',
"Don't have an account yet?": 'ยงไมญช?',
'or simply generate a private key': 'หรอสรางควนตว',
'This is a private key. Do not share it with anyone. Keep it safe and secure. You will not be able to recover it if you lose it.':
'นอควนตว อยาแบงปนกบใคร เกบไวใหปลอดภย หากสญหายจะไมสามารถกนได',
Edit: 'แกไข',
Save: 'บนทก',
'Display Name': 'ชอทแสดง',
Bio: 'ประว',
'Nostr Address (NIP-05)': 'ทอย Nostr (NIP-05)',
'Invalid NIP-05 address': 'ทอย NIP-05 ไมกตอง',
'Copy private key': 'คดลอกควนตว',
'Enter the password to decrypt your ncryptsec': 'กรอกรหสผานเพอถอดรหส ncryptsec ของคณ',
Back: 'ยอนกลบ',
'optional: encrypt nsec': 'ตวเลอก: เขารหส nsec',
password: 'รหสผาน',
'Sign up': 'สมครสมาชก',
'Save to': 'บนทกไปท',
'Enter a name for the new relay set': 'กรอกชอชดรเลยใหม',
'Save to a new relay set': 'บนทกไปยงชดรเลยใหม',
Mute: 'ปดเสยง',
Muted: 'ปดเสยงแลว',
Unmute: 'ยกเลกปดเสยง',
'Unmute user': 'ยกเลกปดเสยงผใช',
'Append n relays': 'เพมรเลย {{n}}',
Append: 'เพม',
'Select relays to append': 'เลอกรเลยจะเพม',
'calculating...': 'กำลงคำนวณ...',
'Calculate optimal read relays': 'คำนวณรเลยานทเหมาะสม',
'Login to set': 'เขาสระบบเพอกำหนด',
'Please login to view following feed': 'กรณาเขาสระบบเพอดดทดตาม',
'Send only to r': 'สงเฉพาะไปยง {{r}}',
'Send only to these relays': 'สงเฉพาะไปยงรเลยเหลาน',
Explore: 'สำรวจ',
'Search relays': 'คนหารเลย',
relayInfoBadgeAuth: 'ยนยนตวตน',
relayInfoBadgeSearch: 'คนหา',
relayInfoBadgePayment: 'ชำระเงน',
Operator: 'ผดำเนนการ',
Contact: 'ตดตอ',
Software: 'ซอฟตแวร',
Version: 'เวอรน',
'Random Relays': 'รเลยม',
randomRelaysRefresh: 'รเฟรช',
'Explore more': 'สำรวจเพมเตม',
'Payment page': 'หนาชำระเงน',
'Supported NIPs': 'NIP ทรองรบ',
'Open in a': 'เปดใน {{a}}',
'Cannot handle event of kind k': 'ไมสามารถจดการเหตการณประเภท {{k}}',
'Sorry! The note cannot be found 😔': 'ขออภย! ไมพบโนต 😔',
'This user has been muted': 'ผใชกปดเสยง',
Wallet: 'กระเปาสตางค',
Sats: 'ซาตส',
sats: 'ซาตส',
'Zap to': 'สงซาตสไปยง',
'Zap n sats': 'สง {{n}} ซาตส',
zapComment: 'ความคดเหน',
'Default zap amount': 'จำนวนซาตสเรมตน',
'Default zap comment': 'ความคดเหนเรมตน',
'Lightning Address (or LNURL)': 'ทอย Lightning (หรอ LNURL)',
'Quick zap': 'สงซาตสวน',
'If enabled, you can zap with a single click. Click and hold for custom amounts':
'หากเปดใชงาน คณสามารถสงซาตสวยคลกเดยว กดคางเพอกำหนดจำนวนเอง',
All: 'ทงหมด',
Reactions: 'ปฏยา',
Zaps: 'ซาตส',
'Enjoying Jumble?': 'ชอบ Jumble ไหม?',
'Your donation helps me maintain Jumble and make it better! 😊':
'การบรจาคของคณชวยใหนดแลและพฒนา Jumble ใหน! 😊',
'Earlier notifications': 'การแจงเตอนกอนหนา',
'Temporarily display this note': 'แสดงโนตนวคราว',
buttonFollowing: 'กำลงตดตาม',
'Are you sure you want to unfollow this user?': 'คณแนใจหรอไมาตองการเลกตดตามผใช?',
'Recent Supporters': 'ผสนบสนนลาสด',
'Seen on': 'เหนเมอ',
'Temporarily display this reply': 'แสดงการตอบกลบนวคราว',
'Not found the note': 'ไมพบโนต',
'no more replies': 'ไมการตอบกลบเพมเตม',
'Relay sets': 'ชดรเลย',
'Favorite Relays': 'รเลยโปรด',
"Following's Favorites": 'รายการโปรดของผดตาม',
'no more relays': 'ไมเลยเพมเตม',
'Favorited by': 'ถกเพมเปนรายการโปรดโดย',
'Post settings': 'การตงคาโพสต',
'Media upload service': 'บรการอปโหลดสอ',
'Choose a relay': 'เลอกรเลย',
'no relays found': 'ไมพบรเลย',
video: 'วโอ',
'Show n new notes': 'แสดงโนตใหม {{n}} รายการ',
YouTabName: 'คณ',
Bookmark: 'บกมารก',
'Remove bookmark': 'ลบบกมารก',
'no bookmarks found': 'ไมพบบกมารก',
'no more bookmarks': 'ไมกมารกเพมเตม',
Bookmarks: 'บกมารก',
'Show more': 'แสดงเพมเตม',
General: 'ทวไป',
Autoplay: 'เลนอตโนม',
'Enable video autoplay on this device': 'เปดใชงานเลนวโออตโนมบนอปกรณ',
'Paste or drop media files to upload': 'วางหรอหยอนไฟลอเพออปโหลด',
Preview: 'ดวอยาง',
'You are about to publish an event signed by [{{eventAuthorName}}]. You are currently logged in as [{{currentUsername}}]. Are you sure?':
'คณกำลงจะเผยแพรเหตการณลงนามโดย [{{eventAuthorName}}] ขณะนณเขาสระบบเปน [{{currentUsername}}] คณแนใจหรอไม?',
'Platinum Sponsors': 'ผสนบสนนระดบแพลตม',
From: 'จาก',
'Comment on': 'แสดงความคดเหนใน',
'View on njump.me': 'ดบน njump.me',
'Hide content from untrusted users': 'ซอนเนอหาจากผใชไมาเชอถอ',
'Only show content from your followed users and the users they follow':
'แสดงเฉพาะเนอหาจากผใชณตดตามและผใชพวกเขาตดตาม',
'Followed by': 'ตดตามโดย',
'Mute user privately': 'ปดเสยงผใชแบบสวนตว',
'Mute user publicly': 'ปดเสยงผใชแบบสาธารณะ',
Quotes: 'คำพด',
'Lightning Invoice': 'ใบแจงหน Lightning',
'Bookmark failed': 'บกมารกไมสำเรจ',
'Remove bookmark failed': 'ลบบกมารกไมสำเรจ',
Translation: 'การแปล',
Balance: 'ยอดคงเหลอ',
characters: 'ตวอกษร',
jumbleTranslateApiKeyDescription:
'คณสามารถใช API key นบทนทรองรบ LibreTranslate ทอยบรการคอ {{serviceUrl}}',
'Top up': 'เตมเงน',
'Will receive: {n} characters': 'จะไดบ: {{n}} ตวอกษร',
'Top up {n} sats': 'เตมเงน {{n}} ซาตส',
'Minimum top up is {n} sats': 'เตมเงนขนตำ {{n}} ซาตส',
Service: 'บรการ',
'Reset API key': 'รเซต API key',
'Are you sure you want to reset your API key? This action cannot be undone.':
'คณแนใจหรอไมาตองการรเซต API key? การกระทำนไมสามารถยอนกลบได',
Warning: 'คำเตอน',
'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.':
'API key ปจจนของคณจะใชไมไดนท และแอปพลเคชนทใชงานจะหยดทำงานจนกวาคณจะอปเดตดวยคใหม',
'Service address': 'ทอยบรการ',
Pay: 'ชำระเงน',
interactions: 'การโตตอบ',
notifications: 'การแจงเตอน',
'Show untrusted {type}': 'แสดง {{type}} ทไมาเชอถอ',
'Hide untrusted {type}': 'ซอน {{type}} ทไมาเชอถอ',
'Currently hiding {type} from untrusted users.':
'ขณะนกำลงซอน {{type}} จากผใชไมาเชอถอ',
'Currently showing all {type}.': 'ขณะนแสดง {{type}} ทงหมด',
'Click continue to show all {type}.': 'คลกดำเนนการตอเพอแสดง {{type}} ทงหมด',
'Click continue to hide {type} from untrusted users.':
'คลกดำเนนการตอเพอซอน {{type}} จากผใชไมาเชอถอ',
'Trusted users include people you follow and people they follow.':
'ผใชเชอถอไดรวมถงผณตดตามและผพวกเขาตดตาม',
Continue: 'ดำเนนการตอ'
}
}
Loading…
Cancel
Save