mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
fix: add .ts extensions to i18n imports for ESM compatibility
This commit is contained in:
committed by
Peter Steinberger
parent
e0c45eab49
commit
f20bef3d79
@@ -1,3 +1,3 @@
|
||||
export * from "./lib/types";
|
||||
export * from "./lib/translate";
|
||||
export * from "./lib/lit-controller";
|
||||
export * from "./lib/types.ts";
|
||||
export * from "./lib/translate.ts";
|
||||
export * from "./lib/lit-controller.ts";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ReactiveController, ReactiveControllerHost } from "lit";
|
||||
import { i18n } from "./translate";
|
||||
import { i18n } from "./translate.ts";
|
||||
|
||||
export class I18nController implements ReactiveController {
|
||||
private host: ReactiveControllerHost;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Locale, TranslationMap } from "./types";
|
||||
import { en } from "../locales/en";
|
||||
import type { Locale, TranslationMap } from "./types.ts";
|
||||
import { en } from "../locales/en.ts";
|
||||
|
||||
type Subscriber = (locale: Locale) => void;
|
||||
|
||||
@@ -40,11 +40,11 @@ class I18nManager {
|
||||
try {
|
||||
let module;
|
||||
if (locale === "zh-CN") {
|
||||
module = await import("../locales/zh-CN");
|
||||
module = await import("../locales/zh-CN.ts");
|
||||
} else if (locale === "zh-TW") {
|
||||
module = await import("../locales/zh-TW");
|
||||
module = await import("../locales/zh-TW.ts");
|
||||
} else if (locale === "pt-BR") {
|
||||
module = await import("../locales/pt-BR");
|
||||
module = await import("../locales/pt-BR.ts");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TranslationMap } from "../lib/types";
|
||||
import type { TranslationMap } from "../lib/types.ts";
|
||||
|
||||
export const en: TranslationMap = {
|
||||
common: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TranslationMap } from "../lib/types";
|
||||
import type { TranslationMap } from "../lib/types.ts";
|
||||
|
||||
export const pt_BR: TranslationMap = {
|
||||
common: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TranslationMap } from "../lib/types";
|
||||
import type { TranslationMap } from "../lib/types.ts";
|
||||
|
||||
export const zh_CN: TranslationMap = {
|
||||
common: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TranslationMap } from "../lib/types";
|
||||
import type { TranslationMap } from "../lib/types.ts";
|
||||
|
||||
export const zh_TW: TranslationMap = {
|
||||
common: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, beforeEach, vi } from "vitest";
|
||||
import { i18n, t } from "../lib/translate";
|
||||
import { i18n, t } from "../lib/translate.ts";
|
||||
|
||||
describe("i18n", () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { IconName } from "./icons.js";
|
||||
import { t } from "../i18n/index.js";
|
||||
import { t } from "../i18n/index.ts";
|
||||
|
||||
export const TAB_GROUPS = [
|
||||
{ label: "chat", tabs: ["chat"] },
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { html } from "lit";
|
||||
import type { GatewayHelloOk } from "../gateway";
|
||||
import type { UiSettings } from "../storage";
|
||||
import { t, i18n, type Locale } from "../../i18n";
|
||||
import { formatAgo, formatDurationMs } from "../format";
|
||||
import { formatNextRun } from "../presenter";
|
||||
import type { GatewayHelloOk } from "../gateway.ts";
|
||||
import type { UiSettings } from "../storage.ts";
|
||||
import { t, i18n, type Locale } from "../../i18n/index.ts";
|
||||
import { formatAgo, formatDurationMs } from "../format.ts";
|
||||
import { formatNextRun } from "../presenter.ts";
|
||||
|
||||
export type OverviewProps = {
|
||||
connected: boolean;
|
||||
|
||||
Reference in New Issue
Block a user