npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@usagi.network/un-i18n-svelte

v0.1.0

Published

Svelte / svelte-i18n side of the U.N. series i18n bridge. Pairs with the un-i18n Rust crate to bulk-load Tauri-bundled locale messages.

Readme

un-i18n-svelte

U.N. シリーズアプリの Svelte 側 i18n bridge。 Rust 側の un-i18n crate が Tauri command 経由で配信する bulk-loaded メッセージを svelte-i18n に登録する setup helpers。

インストール

pnpm add un-i18n-svelte
# peer deps
pnpm add @tauri-apps/api svelte-i18n

使い方

// src/main.ts
import { mount } from "svelte";
import App from "./App.svelte";
import { setupI18n } from "un-i18n-svelte";

await setupI18n();

mount(App, { target: document.getElementById("app")! });

App.svelte 内では通常の svelte-i18n API を使う:

<script lang="ts">
  import { _ } from "svelte-i18n";
  import { setUiLocale } from "un-i18n-svelte";
</script>

<h1>{$_("app.name")}</h1>
<button onclick={() => setUiLocale("en-US")}>English</button>

API

setupI18n(options?: SetupOptions): Promise<string>

svelte-i18n を初期化する。

  • 戻り値: 実際に適用された初期 locale (BCP-47 完全形)。
  • アプリの mount(App, ...) より 必ず前 に await すること。

SetupOptions:

| キー | 既定値 | 説明 | |------|--------|------| | fallbackLocale | "ja-JP" | svelte-i18n の fallbackLocale (UN シリーズの設計上、作者の第 1 言語)。 | | availableLocalesCommand | "i18n_available_locales" | Tauri command 名。 | | bundleCommand | "i18n_get_svelte_bundle" | Tauri command 名。 | | resolveDefaultCommand | "i18n_resolve_default_locale" | Tauri command 名。 |

setUiLocale(tag: string): void

UI から locale を切り替える。svelte-i18nlocale store を更新する だけのシンプルなラッパー。AppRuntimeSettings.locale の永続化は呼び出し側 で行う想定。

UN apps/*-supervisor での取り込み

  • Rust (un-i18n): Cargo.tomlgit = "https://github.com/usagi/un-common.git" 等(リリースブランチでは rev でピン留め推奨)。
  • npm (un-i18n-svelte): 本ディレクトリで npm publish --access public すると、各 Supervisor の package.jsonun-i18n-svelte を通常依存にできる。npm の git 依存で monorepo のサブフォルダだけを指す指定は環境によって期待どおり動かないことがあるため、publish 前はアプリ側に src/lib/i18n.ts として本パッケージの src/index.ts と同一実装をミラーする運用も可(コメントに同期元 URL を書いておく)。

ライセンス

MIT