Skip to content

Commit 6e88690

Browse files
ericyangpanclaude
andcommitted
refactor(ui): update translation field references
Update all UI components to reference 'translations' instead of 'i18n' following the type system refactor. Changes: - Update all detail pages ([slug]/page.tsx) to handle docsUrl properly - Update all list pages (page.client.tsx) search to use translations field - Update landscape-data.ts to convert null to undefined for docsUrl 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e7a7808 commit 6e88690

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

src/app/[locale]/clis/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default async function CLIPage({
7575
const tGlobal = await getTranslations({ locale })
7676

7777
const websiteUrl = cli.resourceUrls?.download || cli.websiteUrl
78-
const docsUrl = cli.docsUrl
78+
const docsUrl = cli.docsUrl || undefined
7979

8080
// Transform resourceUrls to component format (convert null to undefined)
8181
const resourceUrls: ComponentResourceUrls = {

src/app/[locale]/clis/page.client.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ export default function CLIsPageClient({ locale }: Props) {
3737
const filteredAndSortedClis = useMemo(() => {
3838
let result = [...localizedClis]
3939

40-
// Apply search filter (search in name and i18n fields)
40+
// Apply search filter (search in name and translations fields)
4141
if (searchQuery.trim()) {
4242
const query = searchQuery.toLowerCase()
4343
result = result.filter(cli => {
4444
// Search in main name
4545
if (cli.name.toLowerCase().includes(query)) return true
46-
// Search in i18n names if available
47-
if (cli.i18n) {
48-
return Object.values(cli.i18n).some(
46+
// Search in translations names if available
47+
if (cli.translations) {
48+
return Object.values(cli.translations).some(
4949
translation =>
5050
typeof translation === 'object' &&
5151
translation !== null &&

src/app/[locale]/extensions/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default async function ExtensionPage({
7070
const tGlobal = await getTranslations({ locale })
7171

7272
const websiteUrl = extension.resourceUrls?.download || extension.websiteUrl
73-
const docsUrl = extension.docsUrl
73+
const docsUrl = extension.docsUrl || undefined
7474

7575
// Schema.org structured data
7676
const softwareApplicationSchema = {

src/app/[locale]/extensions/page.client.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ export default function ExtensionsPageClient({ locale }: Props) {
3737
const filteredAndSortedExtensions = useMemo(() => {
3838
let result = [...localizedExtensions]
3939

40-
// Apply search filter (search in name and i18n fields)
40+
// Apply search filter (search in name and translations fields)
4141
if (searchQuery.trim()) {
4242
const query = searchQuery.toLowerCase()
4343
result = result.filter(extension => {
4444
// Search in main name
4545
if (extension.name.toLowerCase().includes(query)) return true
46-
// Search in i18n names if available
47-
if (extension.i18n) {
48-
return Object.values(extension.i18n).some(
46+
// Search in translations names if available
47+
if (extension.translations) {
48+
return Object.values(extension.translations).some(
4949
translation =>
5050
typeof translation === 'object' &&
5151
translation !== null &&

src/app/[locale]/ides/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default async function IDEPage({
7676
const tGlobal = await getTranslations({ locale })
7777

7878
const websiteUrl = ide.resourceUrls?.download || ide.websiteUrl
79-
const docsUrl = ide.docsUrl
79+
const docsUrl = ide.docsUrl || undefined
8080

8181
// Transform resourceUrls to component format (convert null to undefined)
8282
const resourceUrls: ComponentResourceUrls = {

src/app/[locale]/ides/page.client.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export default function IDEsPageClient({ locale }: Props) {
4343
result = result.filter(ide => {
4444
// Search in main name
4545
if (ide.name.toLowerCase().includes(query)) return true
46-
// Search in i18n names if available
47-
if (ide.i18n) {
48-
return Object.values(ide.i18n).some(
46+
// Search in translations names if available
47+
if (ide.translations) {
48+
return Object.values(ide.translations).some(
4949
translation =>
5050
typeof translation === 'object' &&
5151
translation !== null &&

src/app/[locale]/model-providers/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default async function ProviderPage({
6060
const tGlobal = await getTranslations({ locale })
6161

6262
const websiteUrl = provider.websiteUrl
63-
const docsUrl = provider.docsUrl
63+
const docsUrl = provider.docsUrl || undefined
6464

6565
// Configuration for AI platform links
6666
const AI_PLATFORM_LINKS = [

src/app/[locale]/model-providers/page.client.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ export default function ModelProvidersPageClient({ locale }: Props) {
3232
const filteredProviders = useMemo(() => {
3333
let result = [...localizedProviders]
3434

35-
// Apply search filter (search in name and i18n fields)
35+
// Apply search filter (search in name and translations fields)
3636
if (searchQuery.trim()) {
3737
const query = searchQuery.toLowerCase()
3838
result = result.filter(provider => {
3939
// Search in main name
4040
if (provider.name.toLowerCase().includes(query)) return true
41-
// Search in i18n names if available
42-
if (provider.i18n) {
43-
return Object.values(provider.i18n).some(
41+
// Search in translations names if available
42+
if (provider.translations) {
43+
return Object.values(provider.translations).some(
4444
translation =>
4545
typeof translation === 'object' &&
4646
translation !== null &&

src/app/[locale]/models/page.client.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export default function ModelsPageClient({ locale }: Props) {
3838
result = result.filter(model => {
3939
// Search in main name
4040
if (model.name.toLowerCase().includes(query)) return true
41-
// Search in i18n names if available
42-
if (model.i18n) {
43-
return Object.values(model.i18n).some(
41+
// Search in translations names if available
42+
if (model.translations) {
43+
return Object.values(model.translations).some(
4444
translation =>
4545
typeof translation === 'object' &&
4646
translation !== null &&

src/app/[locale]/vendors/page.client.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export default function VendorsPageClient({ locale }: Props) {
3838
result = result.filter(vendor => {
3939
// Search in main name
4040
if (vendor.name.toLowerCase().includes(query)) return true
41-
// Search in i18n names if available
42-
if (vendor.i18n) {
43-
return Object.values(vendor.i18n).some(
41+
// Search in translations names if available
42+
if (vendor.translations) {
43+
return Object.values(vendor.translations).some(
4444
translation =>
4545
typeof translation === 'object' &&
4646
translation !== null &&

0 commit comments

Comments
 (0)