瀏覽代碼

Merge pull request #10304 from ttv20/dev

i18n: Improve RTL text handling in chat and sidebar with auto-direction #2
Timothy Jaeryang Baek 4 月之前
父節點
當前提交
a33214ab6b
共有 2 個文件被更改,包括 10 次插入4 次删除
  1. 6 0
      CHANGELOG.md
  2. 4 4
      src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte

+ 6 - 0
CHANGELOG.md

@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+## [0.5.15]
+
+### Added
+
+- **🌍 Enhanced Internationalization (i18n)**: Improved right-to-left languages experience with automatic text direction handling in chat and sidebar
+
 ## [0.5.14] - 2025-02-17
 
 ### Fixed

+ 4 - 4
src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte

@@ -76,7 +76,7 @@
 	{#if token.type === 'hr'}
 		<hr class=" border-gray-100 dark:border-gray-850" />
 	{:else if token.type === 'heading'}
-		<svelte:element this={headerComponent(token.depth)}>
+		<svelte:element this={headerComponent(token.depth)} dir="auto">
 			<MarkdownInlineTokens id={`${id}-${tokenIdx}-h`} tokens={token.tokens} {onSourceClick} />
 		</svelte:element>
 	{:else if token.type === 'code'}
@@ -176,7 +176,7 @@
 		{#if token.ordered}
 			<ol start={token.start || 1}>
 				{#each token.items as item, itemIdx}
-					<li dir="auto">
+					<li dir="auto" class="text-start">
 						{#if item?.task}
 							<input
 								class=" translate-y-[1px] -translate-x-1"
@@ -208,7 +208,7 @@
 		{:else}
 			<ul>
 				{#each token.items as item, itemIdx}
-					<li dir="auto">
+					<li dir="auto" class="text-start">
 						{#if item?.task}
 							<input
 								class=" translate-y-[1px] -translate-x-1"
@@ -239,7 +239,7 @@
 			</ul>
 		{/if}
 	{:else if token.type === 'details'}
-		<Collapsible title={token.summary} attributes={token?.attributes} className="w-full space-y-1">
+		<Collapsible title={token.summary} attributes={token?.attributes} className="w-full space-y-1" dir="auto">
 			<div class=" mb-1.5" slot="content">
 				<svelte:self
 					id={`${id}-${tokenIdx}-d`}