🌐 Add theme tab translation keys (#1119)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Implemented internationalization across various components, enabling dynamic language translation for UI elements. - **Enhancements** - Improved accessibility with translated `aria-label` attributes. - Enhanced user interface with translated button texts and labels. - **Refactor** - Streamlined translation handling with the `useTranslate` hook. - **Bug Fixes** - Corrected tooltip label for better clarity. - **Style** - Updated visual elements to reflect changes in language settings. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { ThemeTemplate } from '@typebot.io/schemas'
|
||||
import { useState } from 'react'
|
||||
import { MyTemplates } from './MyTemplates'
|
||||
import { TemplatesGallery } from './TemplatesGallery'
|
||||
import { useTranslate } from '@tolgee/react'
|
||||
|
||||
type Tab = 'my-templates' | 'gallery'
|
||||
|
||||
@@ -21,6 +22,8 @@ export const ThemeTemplates = ({
|
||||
currentTheme,
|
||||
onTemplateSelect,
|
||||
}: Props) => {
|
||||
const { t } = useTranslate()
|
||||
|
||||
const [selectedTab, setSelectedTab] = useState<Tab>('my-templates')
|
||||
|
||||
return (
|
||||
@@ -32,7 +35,7 @@ export const ThemeTemplates = ({
|
||||
colorScheme={selectedTab === 'my-templates' ? 'blue' : 'gray'}
|
||||
onClick={() => setSelectedTab('my-templates')}
|
||||
>
|
||||
My templates
|
||||
{t('theme.sideMenu.template.myTemplates')}
|
||||
</Button>
|
||||
<Button
|
||||
flex="1"
|
||||
@@ -40,7 +43,7 @@ export const ThemeTemplates = ({
|
||||
colorScheme={selectedTab === 'gallery' ? 'blue' : 'gray'}
|
||||
onClick={() => setSelectedTab('gallery')}
|
||||
>
|
||||
Gallery
|
||||
{t('theme.sideMenu.template.gallery')}
|
||||
</Button>
|
||||
</HStack>
|
||||
<ThemeTemplatesBody
|
||||
|
||||
Reference in New Issue
Block a user