Please wait for the host to finish
+{translations[$language].end}
{/if} {/if}From 8184c49e0b28f3152cdd4dafb9a07a6f731b46fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=97=E5=AE=8F=E6=98=80?=
<112567202+Buffett111@users.noreply.github.com>
Date: Fri, 14 Feb 2025 11:23:18 +0800
Subject: [PATCH] add language drop down menu, fix text errors (#139)
* feat: add language support
current support web
Chatroom
Navbar
dashboard
login
template
* feat: add language support
view template
* feat: complete language support
now support English and Chinese
* fix: fix my git,Idk what's going on
* deleted: ParticipantView.svelte
* fix: add ParticipantView component back
* feat: add language drop-down menu to navbar
fix: fix parts of the translation texts
---
src/lib/components/Chatroom.svelte | 32 ++-
src/lib/components/Navbar.svelte | 64 +++++-
src/lib/components/QrScanner.svelte | 37 ++-
src/lib/components/SessionCard.svelte | 18 +-
src/lib/components/session/HostView.svelte | 114 ++++++++--
.../components/session/ParticipantView.svelte | 164 ++++++++++----
.../components/session/StageProgress.svelte | 33 ++-
src/lib/stores/language.ts | 3 +
src/routes/+page.svelte | 214 +++++++++++++-----
src/routes/dashboard/+page.svelte | 122 ++++++++--
src/routes/join/+page.svelte | 28 ++-
src/routes/login/+page.svelte | 22 +-
src/routes/profile/+page.svelte | 60 +++--
src/routes/session/[id]/+page.svelte | 12 +-
.../[id]/discussion/[userId]/+page.svelte | 25 +-
.../session/[id]/participant/+page.svelte | 11 +-
src/routes/session/[id]/status/+page.svelte | 20 +-
src/routes/template/[id]/+page.svelte | 102 +++++++--
src/routes/template/[id]/view/+page.svelte | 39 +++-
static/icons/flag-us.png | Bin 0 -> 3265 bytes
static/icons/flag-zh.jpg | Bin 0 -> 33694 bytes
21 files changed, 893 insertions(+), 227 deletions(-)
create mode 100644 src/lib/stores/language.ts
create mode 100644 static/icons/flag-us.png
create mode 100644 static/icons/flag-zh.jpg
diff --git a/src/lib/components/Chatroom.svelte b/src/lib/components/Chatroom.svelte
index 5415105..b8b83de 100644
--- a/src/lib/components/Chatroom.svelte
+++ b/src/lib/components/Chatroom.svelte
@@ -3,6 +3,7 @@
import { Mic, Send, Square } from 'lucide-svelte'; // Added Square icon import
import AudioPlayer from './AudioPlayer.svelte';
import { renderMarkdown } from '$lib/utils/renderMarkdown';
+ import { language } from '$lib/stores/language'; // Import the global language store
interface Conversation {
name: string;
@@ -35,6 +36,25 @@
let messagesContainer: HTMLDivElement;
let dots = $state('...');
+ const translations = {
+ en: {
+ placeholder: 'Type your message...(max 500 characters)',
+ send: 'Send',
+ record: 'Record',
+ waiting: 'Waiting',
+ stop: 'Stop',
+ thinking: 'Thinking'
+ },
+ zh: {
+ placeholder: '手動輸入文字...(最多500個字元)',
+ send: '送出',
+ record: '錄音',
+ waiting: '等待',
+ stop: '停止',
+ thinking: '正在思考'
+ }
+ };
+
function scrollToBottom() {
if (!messagesContainer || !autoscroll) return;
@@ -147,7 +167,7 @@
- {#await renderMarkdown(`正在思考${dots}`)}
+ {#await renderMarkdown(`${translations[$language].thinking}${dots}`)}
Loading ...
{:then content}
@@ -167,7 +187,7 @@
+
{#each hinagiku as c, i}{$profile?.displayName}
{$user.email}
-Please scan the QR code or enter the code to join the session.
++ {$language === 'zh' ? translations.zh.joinSessionDesc : translations.en.joinSessionDesc} +
{#if $session?.status === 'preparing'}No participants
++ {$language === 'zh' + ? translations.zh.noParticipants + : translations.en.noParticipants} +
{:else}{$session?.task}
{#if $session?.subtasks.length > 0}No resources available
++ {$language === 'zh' ? translations.zh.noResources : translations.en.noResources} +
{:else}Please wait for the host to finish
+{translations[$language].end}
{/if} {/if}Work on your individual contributions.
+{translations[$language].individual}
{:else if $session?.status === 'before-group'} -Get ready to collaborate with your group.
+{translations[$language].beforeGroup}
{:else if $session?.status === 'group'} -Collaborate with your group members.
+{translations[$language].group}
{/if}The host will begin the session shortly.
+{translations[$language].hostBeginShortly}
- Hinagiku helps educators facilitate more engaging and productive discussions through - real-time transcription and intelligent analysis. + {translations[$lang].intro}
- Our platform combines cutting-edge technology with educational expertise to enhance - learning outcomes. + {translations[$lang].whyChooseDesc}
- Capture every valuable insight from your discussions with our advanced speech-to-text - technology. + {translations[$lang].tr_details}
@@ -99,9 +211,9 @@- Get AI-powered insights and suggestions to improve discussion quality and participation. + {translations[$lang].ia_details}
@@ -111,10 +223,9 @@- Purpose-built for educational environments with features that support meaningful - learning. + {translations[$lang].ef_details}
- Hinagiku enhances the Think-Pair-Share learning technique with AI assistance throughout - the entire process. + {translations[$lang].howItWorksDesc}
- Teachers create discussion templates and set up dynamic timelines for structured - learning sessions. + {translations[$lang].preparationDesc}
- Students easily join discussions by scanning a session QR code, then form or join - groups. + {translations[$lang].joinSessionDesc}
- AI assists in guiding individual reflection, group discussions, and helps maintain focus - on the topic. + {translations[$lang].discussionDesc}
- Get visual summaries and insights from discussions to understand class perspectives and - engagement. + {translations[$lang].analysisDesc}
- Our AI-powered system emphasizes student-led discussions while providing structured - guidance, making it easier for teachers to direct learning and analyze outcomes. + {translations[$lang].Ai_describe}
- Access and share discussion templates with educators worldwide. Build upon proven - discussion frameworks or contribute your own. + {translations[$lang].communityDrivenDesc}
- Hinagiku (雛菊), or Daisy in - English, is an intelligent system designed to support discussions in educational - environments. + Hinagiku (雛菊), {translations[ + $lang + ].storyBehindDesc}
- One of Hinagiku's key features is its real-time voice transcription and analysis, - which helps hosts provide timely and insightful feedback, setting it apart from other - educational tools. + {translations[$lang].realTime}
- We chose the name Hinagiku because it reflects our core values: - resilience, simplicity, and growth—much - like the daisy flower itself, which flourishes in diverse conditions. + {translations[$lang].coreValues}
- Our mission is to help participants and hosts connect meaningfully by providing tools - that facilitate better communication and collaboration in classrooms. + {translations[$lang].mission}
- Hinagiku is open source and available on GitHub. We welcome contributions from the - community! + {translations[$lang].openSourceDesc}
Welcome back, {$profile?.displayName || $user?.displayName}
++ {translations[$language].welcomeDashboard}, {$profile?.displayName || $user?.displayName} +
Create a new discussion template
+{translations[$language].createTemplateDesc}
@@ -169,8 +226,10 @@Join an existing discussion session
+{translations[$language].joinSessionDesc}
@@ -179,8 +238,10 @@Update your profile settings
+{translations[$language].editProfileDesc}
- Create and share your own templates with the community + {translations[$language].createFirstTemplate}
-No templates created yet
-Create your first template to get started
++ {translations[$language].noTemplates} +
+{translations[$language].createFirstTemplate}
No sessions created yet
-Create a new session with template
++ {translations[$language].noSessions} +
+{translations[$language].createSession}
- Scan the QR code provided by your session host to join the discussion. + {translations[$language].scanQr}
Or please enter the 6-digits code to join.
+{translations[$language].enterCode}
- Join Session + {translations[$language].joinButton}Sign in with your Google account to get started
+{translations[$language].login}
Update your personal information and preferences
+{translations[$language].updateInfo}
- Write a short bio to help others know more about you + {translations[$language].bioHelp}