Skip to content
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
8 changes: 4 additions & 4 deletions demo/src/components/TermLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TTermLinks } from 'dev-dict'
import { ExternalLink, Globe } from 'lucide-react'
import { ExternalLink } from 'lucide-react'
import { Fragment } from 'react'

interface TermLinksProps {
Expand All @@ -10,7 +10,7 @@ interface TermLinksProps {
}

const linkData = [
{ key: 'official_website' as const, label: 'Official Website', icon: Globe },
{ key: 'official_website' as const, label: 'Official Website', icon: ExternalLink },
{ key: 'wikipedia' as const, label: 'Wikipedia', icon: ExternalLink },
{ key: 'github' as const, label: 'GitHub', icon: ExternalLink },
{ key: 'npm' as const, label: 'npm', icon: ExternalLink },
Expand All @@ -34,8 +34,8 @@ export function TermLinks({ links, variant = 'button', onLinkClick, showEmpty =
rel="noopener noreferrer"
className="inline-flex items-center gap-1.5 px-3 py-1.5 text-sm text-slate-600 hover:text-blue-600 bg-slate-50 hover:bg-blue-50 rounded-lg border border-slate-200 hover:border-blue-200 transition-colors"
>
<Icon size={14} />
{label}
<Icon size={14} />
</a>
))}
</div>
Expand All @@ -57,8 +57,8 @@ export function TermLinks({ links, variant = 'button', onLinkClick, showEmpty =
}}
className="inline-flex items-center gap-1 hover:text-blue-500 transition-colors cursor-pointer bg-transparent border-0 p-0 font-inherit"
>
<Icon size={10} />
{label}
<Icon size={10} />
</button>
</Fragment>
))}
Expand Down
12 changes: 6 additions & 6 deletions demo/src/pages/TermPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ export function TermPage({ termId, fromQuery }: TermPageProps) {
<TermLinks links={term.links} variant="button" showEmpty />
</div>

{term.sources && (term.sources.label?.length || term.sources.definition?.length) && (
{term.sources && (term.sources.label?.length || term.sources.definition?.length) ? (
<div className="pt-6 border-t border-slate-200">
<h2 className="text-sm font-semibold text-slate-400 uppercase tracking-wider mb-3">Sources</h2>
<div className="text-sm text-slate-500 space-y-1">
{term.sources.label && term.sources.label.length > 0 && (
{term.sources.label && term.sources.label.length ? (
<p>
<span className="text-slate-400">Label:</span>{' '}
{term.sources.label
Expand All @@ -208,8 +208,8 @@ export function TermPage({ termId, fromQuery }: TermPageProps) {
)
.join(', ')}
</p>
)}
{term.sources.definition && term.sources.definition.length > 0 && (
) : null}
{term.sources.definition && term.sources.definition.length ? (
<p>
<span className="text-slate-400">Definition:</span>{' '}
{term.sources.definition
Expand All @@ -218,10 +218,10 @@ export function TermPage({ termId, fromQuery }: TermPageProps) {
)
.join(', ')}
</p>
)}
) : null}
</div>
</div>
)}
) : null}

<div className="pt-8 mt-6 border-t border-slate-200">
<div className="flex items-center justify-between gap-6">
Expand Down
2 changes: 1 addition & 1 deletion demo/src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const LANGUAGES = [
export const FILTER_OPTIONS = [
{ id: 'all', label: 'All terms' },
{ id: 'baseline_incomplete', label: 'Needs work' },
{ id: 'baseline_complete', label: 'Ready' },
// { id: 'baseline_complete', label: 'Ready' },
{ id: 'fully_complete', label: 'Fully translated' },
]

Expand Down
28 changes: 25 additions & 3 deletions src/data/terms/golang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,39 @@ export default {

name: {
[LOCALES.EN_US]: `Go`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: LOCALES.EN_US,
},

altName: {
[LOCALES.EN_US]: `Golang`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: LOCALES.EN_US,
},

label: {
[LOCALES.EN_US]: ``,
[LOCALES.EN_US]: `High-Level Programming Language`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: `Hochsprache`,
},

definition: {
[LOCALES.EN_US]: ``,
[LOCALES.EN_US]: `Go, also known as Golang, is a statically typed, compiled programming language designed at Google. It emphasizes simplicity, concurrency, and performance, making it ideal for building scalable and efficient software applications.`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: `Go, auch bekannt als Golang, ist eine statisch typisierte, kompilierte Programmiersprache, die bei Google entwickelt wurde. Sie legt Wert auf Einfachheit, Nebenläufigkeit und Leistung, was sie ideal für den Aufbau skalierbarer und effizienter Softwareanwendungen macht.`,
},

type: [TYPES.language],

tags: [],
tags: [TAGS.backend, TAGS.open_source],

links: {
official_website: `https://go.dev/`,
wikipedia: `https://en.wikipedia.org/wiki/Go_(programming_language)`,
},

sources: {
label: [SOURCES.ai_generated],
definition: [SOURCES.ai_generated],
},
} as const satisfies TTerm
12 changes: 11 additions & 1 deletion src/data/terms/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ export default {

name: {
[LOCALES.EN_US]: `JavaScript`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: LOCALES.EN_US,
},

label: {
[LOCALES.EN_US]: `High-Level Programming Language`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: `Hochsprache`,
},

definition: {
[LOCALES.EN_US]: ``,
[LOCALES.EN_US]: `JavaScript is a high-level, dynamically typed programming language and one of the three core technologies of the Web alongside HTML and CSS. Created by Brendan Eich in 1995, it runs in browsers for client-side scripting and on servers via runtimes like Node.js.`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: `JavaScript ist eine hochsprachige, dynamisch typisierte Programmiersprache und eine der drei Kerntechnologien des Webs neben HTML und CSS. Sie wurde 1995 von Brendan Eich entwickelt und läuft in Browsern für clientseitiges Scripting sowie auf Servern über Laufzeitumgebungen wie Node.js.`,
},

type: [TYPES.language],
Expand All @@ -28,4 +33,9 @@ export default {
official_website: 'https://tc39.es/ecma262',
wikipedia: `https://en.wikipedia.org/wiki/JavaScript`,
},

sources: {
label: [SOURCES.ai_generated],
definition: [SOURCES.ai_generated],
},
} as const satisfies TTerm
30 changes: 26 additions & 4 deletions src/data/terms/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,39 @@ export default {

name: {
[LOCALES.EN_US]: `PostgreSQL`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: LOCALES.EN_US,
},

altName: {
[LOCALES.EN_US]: `Postgres`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: LOCALES.EN_US,
},

label: {
[LOCALES.EN_US]: ``,
[LOCALES.EN_US]: `Relational Database Management System`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: `Relationales Datenbankverwaltungssystem`,
},

definition: {
[LOCALES.EN_US]: ``,
[LOCALES.EN_US]: `PostgreSQL, often referred to as Postgres, is a powerful, open-source relational database management system (RDBMS) that emphasizes extensibility and SQL compliance. It supports advanced data types, complex queries, and a wide range of programming languages, making it a popular choice for developers and enterprises worldwide.`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: `PostgreSQL, oft als Postgres bezeichnet, ist ein leistungsstarkes, Open-Source relationales Datenbankverwaltungssystem (RDBMS), das Wert auf Erweiterbarkeit und SQL-Konformität legt. Es unterstützt erweiterte Datentypen, komplexe Abfragen und eine breite Palette von Programmiersprachen, was es zu einer beliebten Wahl für Entwickler und Unternehmen weltweit macht.`,
},

type: [],
type: [TYPES.database],

tags: [TAGS.backend, TAGS.open_source],

tags: [],
links: {
official_website: `https://www.postgresql.org/`,
wikipedia: `https://en.wikipedia.org/wiki/PostgreSQL`,
},

sources: {
label: [SOURCES.ai_generated],
definition: [SOURCES.ai_generated],
},
} as const satisfies TTerm
3 changes: 0 additions & 3 deletions src/data/types/cms.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `cms`,
Expand Down
3 changes: 0 additions & 3 deletions src/data/types/concept.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `concept`,
Expand Down
12 changes: 12 additions & 0 deletions src/data/types/database.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'

export default {
id: `database`,

name: {
[LOCALES.EN_US]: `Database`,
[LOCALES.EN_GB]: LOCALES.EN_US,
[LOCALES.DE_DE]: `Datenbank`,
},
} as const satisfies TTermType
3 changes: 0 additions & 3 deletions src/data/types/framework.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `framework`,
Expand Down
4 changes: 3 additions & 1 deletion src/data/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { interpolateValues } from '@/utils'

import cms from './cms'
import concept from './concept'
import database from './database'
import framework from './framework'
import language from './language'
import library from './library'
Expand All @@ -13,12 +14,13 @@ import standard from './standard'
export const RAW_TYPES = {
[cms.id]: cms,
[concept.id]: concept,
[database.id]: database,
[framework.id]: framework,
[language.id]: language,
[library.id]: library,
[methodology.id]: methodology,
[runtime_environment.id]: runtime_environment,
[platform.id]: platform,
[runtime_environment.id]: runtime_environment,
[standard.id]: standard,
} as const

Expand Down
3 changes: 0 additions & 3 deletions src/data/types/language.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `language`,
Expand Down
3 changes: 0 additions & 3 deletions src/data/types/library.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `library`,
Expand Down
3 changes: 0 additions & 3 deletions src/data/types/methodology.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `methodology`,
Expand Down
3 changes: 0 additions & 3 deletions src/data/types/platform.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `platform`,
Expand Down
3 changes: 0 additions & 3 deletions src/data/types/runtime_environment.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `runtime_environment`,
Expand Down
3 changes: 0 additions & 3 deletions src/data/types/standard.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { TTermType } from '@/types'
import { LOCALES } from '@/data/locales'
import { SOURCES } from '@/data/sources'
import { TAGS } from '@/data/tags'
import { TYPES } from '@/data/types'

export default {
id: `standard`,
Expand Down
1 change: 1 addition & 0 deletions src/types-entry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { default as cms } from '@/data/types/cms'
export { default as concept } from '@/data/types/concept'
export { default as database } from '@/data/types/database'
export { default as framework } from '@/data/types/framework'
export { default as language } from '@/data/types/language'
export { default as library } from '@/data/types/library'
Expand Down
Loading