Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop old zh and fix search #3476

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ DOCUSUARUS_LOCALE=jp yarn build

This allows each language to be deployed independently.

Ensure you only build if the languages folder changes e.g.

```text
git diff HEAD^ HEAD --quiet -- ./i18n/jp
```

Example [here](https://vercel.com/clickhouse/clickhouse-docs-jp/settings/git).

9. Add the route to the website worker - [example PR](https://github.com/ClickHouse/clickhouse-website-worker/pull/285/files)

## Known issues

- translations can modify links in rare cases, causing issues.
Expand Down
5 changes: 5 additions & 0 deletions i18n/jp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Russian docs

Modify this date to initiate rebuild:

`Tue 11 Mar 2025 10:02:12 GMT`
5 changes: 5 additions & 0 deletions i18n/ru/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Japanese docs

Modify this date to initiate rebuild:

`Tue 11 Mar 2025 10:02:12 GMT`
5 changes: 5 additions & 0 deletions i18n/zh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Chinese docs

Modify this date to initiate rebuild:

`Tue 11 Mar 2025 10:02:12 GMT`
7 changes: 0 additions & 7 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1541,13 +1541,6 @@ const sidebars = {

],

chinese: [
{
type: "autogenerated",
dirName: "zh",
},
],

// Used for generating the top nav menu and secondary nav mobile menu (DocsCategoryDropdown) AND top navigation menu
dropdownCategories: [
{
Expand Down
5 changes: 2 additions & 3 deletions src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ function mergeFacetFilters(f1, f2) {

function DocSearch({ contextualSearch, externalUrlRegex, ...props }) {
const queryIDRef = useRef(null);

const { siteMetadata } = useDocusaurusContext();
const { siteMetadata, i18n: { currentLocale } } = useDocusaurusContext();
const processSearchResultUrl = useSearchResultUrlProcessor();
const contextualSearchFacetFilters = useAlgoliaContextualFacetFilters();
const configFacetFilters = props.searchParameters?.facetFilters ?? [];
Expand Down Expand Up @@ -143,7 +142,7 @@ function DocSearch({ contextualSearch, externalUrlRegex, ...props }) {
: items.map((item, index) => {
return {
...item,
url: item.url, //TODO: temporary - all search results to english for now
url: currentLocale == 'en' ? processSearchResultUrl(item.url) : item.url, //TODO: temporary - all search results to english for now
// url: processSearchResultUrl(item.url),
index, // Adding the index property - needed for click metrics
queryID: queryIDRef.current
Expand Down
3 changes: 1 addition & 2 deletions src/theme/SearchPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ function SearchPageContent() {
);
return {
title: titles.pop(),
//url: processSearchResultUrl(url), // TEMP: All search results currently go to english
url: url,
url: currentLocale == 'en' ? processSearchResultUrl(url) : url, //TODO: temporary - all search results to english for now
summary: snippet.content
? `${sanitizeValue(snippet.content.value)}...`
: '',
Expand Down