Skip to content

Commit e196d19

Browse files
committed
Update translations and layout
1 parent ecdd840 commit e196d19

File tree

13 files changed

+26
-27
lines changed

13 files changed

+26
-27
lines changed

packages/gitbook/src/components/Search/SearchContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export function SearchContainer(props: SearchContainerProps) {
233233
onOpenAutoFocus: (event) => event.preventDefault(),
234234
align: 'start',
235235
className:
236-
'@container bg-tint-base has-[.empty]:hidden gutter-stable scroll-py-2 w-128 p-2 pr-1 max-h-[min(32rem,var(--radix-popover-content-available-height))] max-w-[min(var(--radix-popover-content-available-width),32rem)]',
236+
'@container bg-tint-base has-[.empty]:hidden scroll-py-2 w-128 p-2 max-h-[min(32rem,var(--radix-popover-content-available-height))] max-w-[min(var(--radix-popover-content-available-width),32rem)]',
237237
onInteractOutside: (event) => {
238238
// Don't close if clicking on the search input itself
239239
if (searchInputRef.current?.contains(event.target as Node)) {

packages/gitbook/src/components/Search/SearchScopeToggle.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,18 @@ export function SearchScopeToggle(props: {
2727
return (
2828
<>
2929
{withSections ? (
30-
<SegmentedControl className="animate-scale-in @max-md:flex-col">
30+
<SegmentedControl className="animate-scale-in">
31+
<SegmentedControlItem
32+
active={state.scope === 'all' && state.depth === 'single'}
33+
label={
34+
withSiteVariants
35+
? tString(language, 'search_scope_all_depth_single')
36+
: tString(language, 'search_scope_all_depth_full')
37+
}
38+
className={withSiteVariants ? '@max-md:basis-full' : ''}
39+
icon={withSiteVariants ? 'bullseye-arrow' : 'infinity'}
40+
onClick={() => setSearchState({ ...state, scope: 'all', depth: 'single' })}
41+
/>
3142
<SegmentedControlItem
3243
active={state.scope === 'current'}
3344
icon={section?.icon ?? 'crosshairs'}
@@ -40,16 +51,6 @@ export function SearchScopeToggle(props: {
4051
setSearchState({ ...state, scope: 'current', depth: 'single' })
4152
}
4253
/>
43-
<SegmentedControlItem
44-
active={state.scope === 'all' && state.depth === 'single'}
45-
label={
46-
withSiteVariants
47-
? tString(language, 'search_scope_all_depth_single')
48-
: tString(language, 'search_scope_all_depth_full')
49-
}
50-
icon={withSiteVariants ? 'bullseye-arrow' : 'infinity'}
51-
onClick={() => setSearchState({ ...state, scope: 'all', depth: 'single' })}
52-
/>
5354
{withSiteVariants ? (
5455
<SegmentedControlItem
5556
active={state.scope === 'all' && state.depth === 'full'}
@@ -69,15 +70,13 @@ export function SearchScopeToggle(props: {
6970
active={state.depth === 'single'}
7071
className="py-1"
7172
label={tString(language, 'search_scope_current_depth_single', spaceTitle)}
72-
// icon="crosshairs"
7373
onClick={() => setSearchState({ ...state, depth: 'single' })}
7474
/>
7575
<SegmentedControlItem
7676
size={state.scope === 'current' ? 'small' : 'medium'}
7777
active={state.depth === 'full'}
7878
className="py-1"
79-
label={tString(language, 'search_scope_current_depth_full', section?.title)}
80-
// icon="rectangle-vertical-history"
79+
label={tString(language, 'search_scope_current_depth_full')}
8180
onClick={() => setSearchState({ ...state, depth: 'full' })}
8281
/>
8382
</SegmentedControl>

packages/gitbook/src/components/primitives/SegmentedControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function SegmentedControlItem(props: ButtonProps) {
2626
variant="blank"
2727
size={size}
2828
className={tcls(
29-
'flex-1 justify-center whitespace-normal not-contrast-more:data-[active=true]:bg-tint-base',
29+
'shrink grow justify-center whitespace-normal not-contrast-more:data-[active=true]:bg-tint-base',
3030
className
3131
)}
3232
{...rest}

packages/gitbook/src/intl/translations/de.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const de = {
1414
search_results_count: '${1} Ergebnisse',
1515
search_scope_current_depth_single: '${1}',
1616
search_scope_current_depth_full: 'Alle Inhalte',
17-
search_scope_all_depth_single: 'Am relevantesten',
17+
search_scope_all_depth_single: 'Beste Match',
1818
search_scope_all_depth_full: 'Alles',
1919
ask: 'Fragen',
2020
search_ask: 'Fragen "${1}"',

packages/gitbook/src/intl/translations/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const en = {
1414
search_results_count: '${1} results',
1515
search_scope_current_depth_single: '${1}',
1616
search_scope_current_depth_full: 'All content',
17-
search_scope_all_depth_single: 'Most relevant',
17+
search_scope_all_depth_single: 'Best match',
1818
search_scope_all_depth_full: 'Everything',
1919
ask: 'Ask',
2020
search_ask: 'Ask "${1}"',

packages/gitbook/src/intl/translations/es.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const es: TranslationLanguage = {
1616
search_results_count: '${1} resultados',
1717
search_scope_current_depth_single: '${1}',
1818
search_scope_current_depth_full: 'Todo el contenido',
19-
search_scope_all_depth_single: 'Más relevante',
19+
search_scope_all_depth_single: 'Mejor match',
2020
search_scope_all_depth_full: 'Todo',
2121
ask: 'Preguntar',
2222
search_ask: 'Preguntar "${1}"',

packages/gitbook/src/intl/translations/fr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const fr = {
1414
search_results_count: '${1} résultats',
1515
search_scope_current_depth_single: '${1}',
1616
search_scope_current_depth_full: 'Tous les contenus',
17-
search_scope_all_depth_single: 'Plus pertinent',
17+
search_scope_all_depth_single: 'Meilleur match',
1818
search_scope_all_depth_full: 'Tout',
1919
ask: 'Poser une question',
2020
search_ask: 'Demander « ${1} »',

packages/gitbook/src/intl/translations/ja.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const ja: TranslationLanguage = {
1616
search_results_count: '${1}件の結果',
1717
search_scope_current_depth_single: '${1}',
1818
search_scope_current_depth_full: '全てのコンテンツ',
19-
search_scope_all_depth_single: '最も関連性の高い',
19+
search_scope_all_depth_single: '最適なマッチ',
2020
search_scope_all_depth_full: 'すべて',
2121
ask: '質問する',
2222
search_ask: '"${1}" を質問する',

packages/gitbook/src/intl/translations/nl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const nl: TranslationLanguage = {
1616
search_results_count: '${1} resultaten',
1717
search_scope_current_depth_single: '${1}',
1818
search_scope_current_depth_full: 'Alle inhoud',
19-
search_scope_all_depth_single: 'Meest relevant',
19+
search_scope_all_depth_single: 'Beste match',
2020
search_scope_all_depth_full: 'Alles',
2121
ask: 'Vragen',
2222
search_ask: 'Vraag "${1}"',

packages/gitbook/src/intl/translations/no.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const no: TranslationLanguage = {
1616
search_results_count: '${1} resultater',
1717
search_scope_current_depth_single: '${1}',
1818
search_scope_current_depth_full: 'Alt innhold',
19-
search_scope_all_depth_single: 'Mest relevant',
19+
search_scope_all_depth_single: 'Beste treff',
2020
search_scope_all_depth_full: 'Alt',
2121
ask: 'Spør',
2222
search_ask: 'Spør "${1}"',

0 commit comments

Comments
 (0)