Skip to main content

Built and signed on GitHub Actions

A simple and flexible internationalization (i18n) plugin for Deno's Fresh framework.

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (1.2.0)
function createTranslator
createTranslator(translations: Record<string, Record<string, string>>): (key: string) => string

Retrieves a translation value from a nested translation object.

Parameters

translations: Record<string, Record<string, string>>
  • The translations object (e.g., ctx.state.translationData).

Return Type

(key: string) => string

A function t that takes a translation key in dot notation and returns the translated string.

Add Package

deno add jsr:@elsoul/fresh-i18n

Import symbol

import { createTranslator } from "@elsoul/fresh-i18n";

---- OR ----

Import directly with a jsr specifier

import { createTranslator } from "jsr:@elsoul/fresh-i18n";

Add Package

npx jsr add @elsoul/fresh-i18n

Import symbol

import { createTranslator } from "@elsoul/fresh-i18n";

Add Package

yarn dlx jsr add @elsoul/fresh-i18n

Import symbol

import { createTranslator } from "@elsoul/fresh-i18n";

Add Package

pnpm dlx jsr add @elsoul/fresh-i18n

Import symbol

import { createTranslator } from "@elsoul/fresh-i18n";

Add Package

bunx jsr add @elsoul/fresh-i18n

Import symbol

import { createTranslator } from "@elsoul/fresh-i18n";