Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
aeb7295
feat: initialize Next.js project with shared storage and materialized…
Sep 24, 2025
b3cef21
Merge branch 'feature/initial-setup'
Qiuhang817385 Sep 24, 2025
bb62368
chore: remove bailing
Qiuhang817385 Sep 24, 2025
487405b
add bailing and preparing i18n plans
Qiuhang817385 Sep 24, 2025
19196c3
remove bailing
Sep 25, 2025
1292f9c
remove window
Sep 25, 2025
1008d96
remove localStorage
Sep 25, 2025
6d2235f
add window precheck
Sep 25, 2025
41829d2
add more window undefined precheck
Sep 25, 2025
fcea072
use react-i18next realize i18n
Sep 25, 2025
e5bd819
modify output export
Qiuhang817385 Sep 25, 2025
964707b
fix direct route action
Oct 9, 2025
a62e400
Update English translations for UI elements and descriptions in trans…
Oct 9, 2025
9d38a23
Refactor Cloud and Storage components to utilize updated i18n transla…
Oct 9, 2025
179e71f
Remove assetPrefix and ASSET_PREFIX environment variable from next.co…
Qiuhang817385 Oct 9, 2025
903703a
Update translations for Materialized View data volume and query perfo…
Oct 10, 2025
d1aa46c
remove old master
Nov 14, 2025
ca13f9d
Merge branch 'master' of https://github.com/oceanbase/oceanbase-demos
Nov 14, 2025
64383c4
fix: 跨云主备库国际化
Dec 19, 2025
d5ba777
fix: cross-cloud-primary-standby intl
Dec 19, 2025
faf9504
Merge branch 'qh_cross' of https://github.com/Qiuhang817385/oceanbase…
Dec 19, 2025
78bf14b
chore: format reset - 恢复双引号和分号格式
Dec 19, 2025
5b0d2cf
feat: materialized-view intl
Dec 19, 2025
4cbdb7f
Merge branch 'master' of https://github.com/Qiuhang817385/oceanbase-d…
Dec 19, 2025
dfe4c61
Merge branch 'master' of https://github.com/oceanbase/oceanbase-demos…
Dec 19, 2025
b34b605
feat: cr suggestion modify
Dec 19, 2025
38b1dee
feat: seamless-scaling intl
Dec 19, 2025
54cfcea
Merge branch 'master' of https://github.com/oceanbase/oceanbase-demos…
Dec 19, 2025
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
3 changes: 2 additions & 1 deletion demos/seamless-scaling/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
{ "language": "typescriptreact", "autoFix": true }
],
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
"i18n-ally.localesPaths": ["src/locales"]
}
1 change: 1 addition & 0 deletions demos/seamless-scaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"react-day-picker": "^8.10.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.55.0",
"react-intl": "^7.1.14",
"react-resizable-panels": "^2.1.7",
"recharts": "^2.15.2",
"sonner": "^2.0.3",
Expand Down
930 changes: 579 additions & 351 deletions demos/seamless-scaling/pnpm-lock.yaml

Large diffs are not rendered by default.

141 changes: 65 additions & 76 deletions demos/seamless-scaling/src/App.tsx

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions demos/seamless-scaling/src/IntlProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React, { createContext, useEffect, useContext, useMemo } from 'react'
import { IntlProvider as ReactIntlProvider } from 'react-intl'
import { messages, getLocaleFromUrl, Locale, getTimeLocale } from './locales'

interface IntlContextValue {
locale: Locale
timeLocale: string
}

const IntlContext = createContext<IntlContextValue>({
locale: 'zh-CN',
timeLocale: 'zh-CN',
})

export const useLocale = () => useContext(IntlContext)

interface IntlProviderProps {
children: React.ReactNode
}

export function IntlProvider({ children }: IntlProviderProps) {
const locale = useMemo(() => getLocaleFromUrl(), [])
const timeLocale = useMemo(() => getTimeLocale(locale), [locale])

const contextValue = useMemo(
() => ({
locale,
timeLocale,
}),
[locale, timeLocale]
)

useEffect(() => {
// 根据语言设置 html lang 属性,用于 CSS :lang() 选择器
if (typeof document !== 'undefined') {
document.documentElement.lang = locale
}
}, [locale])

return (
<IntlContext.Provider value={contextValue}>
<ReactIntlProvider
locale={locale}
messages={messages[locale]}
defaultLocale="zh-CN"
>
{children}
</ReactIntlProvider>
</IntlContext.Provider>
)
}
Loading