Skip to content

Commit

Permalink
translations
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoertl committed Aug 14, 2024
1 parent f9bf5ca commit 96bf74b
Showing 1 changed file with 63 additions and 60 deletions.
123 changes: 63 additions & 60 deletions src/utils/kwic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,76 @@ import type { ColumnDef } from "@tanstack/vue-table";

import type { KeywordInContext } from "@/types/query";

import { VIcon } from 'vuetify/components';

export const getKWICColumns = (
t: (string) => string,
open: (keyword: KeywordInContext) => void,
): Array<ColumnDef<KeywordInContext>> => [
{
accessorKey: "docid",
header: () => h("div", { class: "text-right" }, "DocID"),
cell: ({ row }) => {
const docid = row.getValue("docid");
return h("div", { class: "text-right font-medium" }, docid as string);
{
accessorKey: "docid",
header: () => h("div", { class: "text-right" }, t('DocID')),
cell: ({ row }) => {
const docid = row.getValue("docid");
return h("div", { class: "text-right font-medium" }, docid as string);
},
},
},
{
accessorKey: "source",
header: () => h("div", { class: "text-right" }, "Source"),
cell: ({ row }) => {
const source = row.getValue("source");
return h("div", { class: "text-right font-medium" }, source as string);
{
accessorKey: "source",
header: () => h("div", { class: "text-right" }, t('source')),
cell: ({ row }) => {
const source = row.getValue("source");
return h("div", { class: "text-right font-medium" }, source as string);
},
},
},
{
accessorKey: "region",
header: () => h("div", { class: "text-right" }, "Region"),
cell: ({ row }) => {
const region = row.getValue("region");
return h("div", { class: "text-right font-medium" }, region as string);
{
accessorKey: "region",
header: () => h("div", { class: "text-right" }, t('region')),
cell: ({ row }) => {
const region = row.getValue("region");
return h("div", { class: "text-right font-medium" }, region as string);
},
},
},
{
accessorKey: "left",
header: () => h("div", { class: "text-right" }, "Left"),
cell: ({ row }) => {
const left = row.getValue("left");
return h("div", { class: "text-right font-medium" }, left as string);
{
accessorKey: "left",
header: () => h("div", { class: "text-right" }, t('left')),
cell: ({ row }) => {
const left = row.getValue("left");
return h("div", { class: "text-right font-medium" }, left as string);
},
},
},
{
accessorKey: "word",
header: () => h("div", { class: "text-right" }, "Word"),
cell: ({ row }) => {
const word = row.getValue("word");
return h("div", { class: "text-right font-medium" }, word as string);
{
accessorKey: "word",
header: () => h("div", { class: "text-right" }, t('word')),
cell: ({ row }) => {
const word = row.getValue("word");
return h("div", { class: "text-right font-medium" }, word as string);
},
},
},
{
accessorKey: "right",
header: () => h("div", { class: "text-left" }, "Right"),
cell: ({ row }) => {
const right = row.getValue("right");
return h("div", { class: "text-right font-medium" }, right as string);
{
accessorKey: "right",
header: () => h("div", { class: "text-left" }, t('right')),
cell: ({ row }) => {
const right = row.getValue("right");
return h("div", { class: "text-right font-medium" }, right as string);
},
},
},
{
accessorKey: "link",
header: () => h("div", { class: "text-right" }, "Link"),
cell: ({ row }) => {
// const link = row.getValue("link");
// < size = "" class="me-2" icon = "mdi-open-in-new" @click="open(item)" />
return h(
"VIcon",
{
onClick: () => open(row.original),
size: "small",
icon: "mdi-open-in-new",
class: "me-2 cursor-pointer font-medium",
},
`open`,
);
{
accessorKey: "link",
header: () => h("div", { class: "text-right" }, t('link')),
cell: ({ row }) => {
// const link = row.getValue("link");
// < size = "" class="me-2" icon = "mdi-open-in-new" @click="open(item)" />
return h(
VIcon,
{
onClick: () => open(row.original),
size: "small",
icon: "mdi-open-in-new",
class: "me-2 cursor-pointer font-medium",
},
// "open",
);
},
},
},
];
];

0 comments on commit 96bf74b

Please sign in to comment.