Skip to content

Commit

Permalink
Merge pull request #9 from HiDeoo/hd-fix-labels-prop
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo authored Sep 23, 2024
2 parents dd6e026 + 60ff9d6 commit 8231e15
Show file tree
Hide file tree
Showing 6 changed files with 783 additions and 1,131 deletions.
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
},
"dependencies": {
"@astrojs/starlight": "^0.25.3",
"@astrojs/starlight": "^0.28.2",
"@hideoo/starlight-plugins-docs-components": "^0.2.2",
"astro": "^4.9.1",
"astro": "^4.15.8",
"sharp": "^0.33.4"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"preview": "astro preview"
},
"dependencies": {
"@astrojs/starlight": "^0.25.3",
"astro": "^4.9.1",
"@astrojs/starlight": "^0.28.2",
"astro": "^4.15.8",
"sharp": "^0.33.4",
"starlight-versions": "workspace:*"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@hideoo/prettier-config": "^2.0.0",
"@hideoo/tsconfig": "^2.0.1",
"@types/node": "^18.19.33",
"astro": "^4.9.1",
"astro": "^4.15.8",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.4",
Expand Down
18 changes: 9 additions & 9 deletions packages/starlight-versions/components/VersionSearch.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import starlightVersionsConfig from 'virtual:starlight-versions-config'
import { getVersionFromSlug, getVersionIdentifier, getVersionURL } from '../libs/versions'
const { entry, labels } = Astro.props
const { entry } = Astro.props
const pagefindTranslations = {
placeholder: labels['search.label'],
placeholder: Astro.locals.t('search.label'),
...Object.fromEntries(
Object.entries(labels)
Object.entries(Astro.locals.t.all())
.filter(([key]) => key.startsWith('pagefind.'))
.map(([key, value]) => [key.replace('pagefind.', ''), value]),
),
Expand All @@ -35,20 +35,20 @@ const pageVersionIdentifier = getVersionIdentifier(pageVersion)
data-pagefind-filter={`version:${pageVersionIdentifier}`}
>
<button data-open-modal disabled>
<Icon name="magnifier" label={labels['search.label']} />
<span class="sl-hidden md:sl-block" aria-hidden="true">{labels['search.label']}</span>
<Icon name="forward-slash" class="sl-hidden md:sl-block" label={labels['search.shortcutLabel']} />
<Icon name="magnifier" label={Astro.locals.t('search.label')} />
<span class="sl-hidden md:sl-block" aria-hidden="true">{Astro.locals.t('search.label')}</span>
<Icon name="forward-slash" class="sl-hidden md:sl-block" label={Astro.locals.t('search.shortcutLabel')} />
</button>

<dialog style="padding:0" aria-label={labels['search.label']}>
<dialog style="padding:0" aria-label={Astro.locals.t('search.label')}>
<div class="dialog-frame sl-flex">
<button data-close-modal class="sl-flex md:sl-hidden">
{labels['search.cancelLabel']}
{Astro.locals.t('search.cancelLabel')}
</button>
{
import.meta.env.DEV ? (
<div style="margin: auto; text-align: center; white-space: pre-line;" dir="ltr">
<p>{labels['search.devWarning']}</p>
<p>{Astro.locals.t('search.devWarning')}</p>
</div>
) : (
<div class="search-container">
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight-versions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"vitest": "^1.6.0"
},
"peerDependencies": {
"@astrojs/starlight": ">=0.25.0"
"@astrojs/starlight": ">=0.28.0"
},
"engines": {
"node": ">=18"
Expand Down
Loading

0 comments on commit 8231e15

Please sign in to comment.