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

spark-emdash-multilingual

v0.1.0

Published

Multilingual editing UX for emdash CMS — locale bar, translation badges, side-by-side editor, completeness tracking

Downloads

144

Readme

spark-emdash-multilingual

Multilingual editing UX for emdash CMS. Companion plugin to spark-emdash — adds locale switching, translation status, side-by-side editing, and a translation dashboard to the admin.

Built by Alchemy Zürich for production multilingual sites on Cloudflare Workers.


Why multilingual matters (especially in Switzerland)

Switzerland runs on three languages. Your Zürich clients expect Deutsch, your Romandie leads need Français, and your international pipeline reads English. If your CMS admin makes multilingual editing painful, your editors will skip translations — and you'll lose rankings in three markets at once.

Google treats de-CH, fr-CH, and en as separate search markets. AI Overviews and Perplexity cite whichever locale version has the strongest E-E-A-T signals. A page that exists in one language but not the other two is invisible to two-thirds of Swiss search traffic. The translation dashboard in this plugin shows you exactly where those gaps are — so you can fix them before your competitors do.

For Swiss agencies building on emdash: this plugin turns "we should translate that" into a visible, trackable workflow your editors will actually follow.


What does it do?

| Feature | What changes | |---------|-------------| | Locale bar | Sticky locale switcher at the top of the admin — DE / FR / EN tabs, persists across navigation | | Translation status badges | Colored dots next to each content item: green (translated), yellow (outdated), red (missing) | | Side-by-side editor | Source language shown read-only alongside the translation form when editing non-default locales | | Copy-from-source | Per-field button to copy the source locale value into the current field | | Completeness bar | Progress indicator showing "12/18 fields translated (67%)" in the edit view | | Stale translation warning | Yellow banner when the source language was updated after the current translation | | Bulk publish | "Publish All Languages" button that publishes all locale variants in one click | | Translation dashboard | Matrix view of all content items × locales with missing/outdated/ok status |

All features inject via Astro middleware, same pattern as spark-emdash. No emdash internals modified.


Install

npm install spark-emdash-multilingual

Usage

In your src/middleware.ts:

import { sparkEmdash } from "spark-emdash/middleware";
import { sparkMultilingual } from "spark-emdash-multilingual/middleware";
import { sequence } from "astro:middleware";

export const onRequest = sequence(
  sparkEmdash({ layouts: { /* ... */ } }),
  sparkMultilingual({
    locales: ["de", "fr", "en"],
    defaultLocale: "de",
    labels: {
      de: "Deutsch",
      fr: "Français",
      en: "English",
    },
  })
);

Configuration

| Property | Type | Description | |----------|------|-------------| | locales | string[] | All locale codes, e.g. ["de", "fr", "en"] | | defaultLocale | string | The source language that translations are based on | | labels | Record<string, string>? | Display names for locale tabs (defaults to uppercase code) |

How it works

The plugin intercepts HTML responses from /_emdash/admin and injects CSS + JS that:

  1. Locale bar: Renders locale tabs from config, stores selection in localStorage, updates ?locale= URL param on switch
  2. Badges: Calls /_emdash/api/content/{collection}/{id}/translations to check which locales exist and their freshness
  3. Side-by-side: Fetches the default-locale version via API and renders a read-only source panel alongside the edit form
  4. Completeness: Counts empty vs filled fields in real-time
  5. Stale warnings: Compares updatedAt timestamps between source and translation
  6. Bulk publish: Calls the publish endpoint for each locale variant
  7. Dashboard: Fetches all collections, groups by translation_group, and renders a status matrix

Requires emdash's i18n to be enabled in the CMS config with "supports": ["i18n"] on collections.

API reference

import { sparkMultilingual, buildPatch } from "spark-emdash-multilingual";
import type { MultilingualConfig } from "spark-emdash-multilingual";

| Export | Description | |--------|-------------| | sparkMultilingual(config) | Returns an Astro middleware handler | | buildPatch(config) | Returns the raw HTML string for custom injection |


License

MIT

Built by

Alchemy Zürich builds handcrafted brands for passionate megalomaniacs. spark-emdash-multilingual makes sure your content editors can actually manage 3 languages without losing their minds.