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

medusa-plugin-localization

v0.1.1

Published

Meudsa localization plugin, supports deepseek automatic translation

Readme

Medusa Plugin Localization

The medusa-plugin-localization is a localization plugin for Medusa v2. The plugin stores localized content in the product's metadata. The frontend displays the localized language based on the current language setting. The plugin also supports automatic translation of localized languages using DeepSeek (requiring a DeepSeek API key). If no API key is available, localized languages need to be stored separately

Admin Demo

![admin demo]

Front-end Demo

![Front-end Demo]

Dependency Version

"@medusajs/medusa": "2.7.0+",

Install

npm i medusa-plugin-localization

Metadata struct

If an SEO section is added to the metadata, DeepSeek's API will automatically include it in the multilingual translation process

| name | value | description | | ------ | ------------------------------------------- | ----------------------------------------------------- | | seo | {"title":"xxx","description":"xxx"} | for page keyword optimization | | locale | {"en-GB":{"title":"...","seo_title":"..."}} | multiple languages ​​via deepseek or manually written |

medusa-config.js

modules: [
    {
      resolve: "./src/modules/deepseek",
      options: {
        api_key: process.env.DEEPSEEK_API_KEY, // Not required
      },
    }
  ]

Front-end

For frontend localization, I use next-intl(Doc:Without-i18n-routing) and retrieve the current locale value with const locale = await getLocale();. Then I specifically developed a <I18nTitle metadata={product.metadata} defaultTitle={product.title} /> component to render the title value.

I18nTitle Component Example

import { getLocale } from 'next-intl/server';

type I18nTitleProps = {
  metadata: Record<string, unknown> | null | undefined;
  defaultTitle: string;
}
const I18nTitle = async ({ metadata, defaultTitle }: I18nTitleProps) => {
  const locale = await getLocale();

  if (!metadata || !metadata?.locale) return defaultTitle
  try {
    const localeMaps = JSON.parse(metadata?.locale as string) || {}
    return localeMaps[locale]?.title || defaultTitle
  } catch (_) {
    
    return defaultTitle
  }
}

export default I18nTitle;

Compoent Using

// src/modules/products/templates/product-info/index.tsx

// Before
<Heading level="h2" className="text-3xl leading-10 text-ui-fg-base" >
    {product.title}
</Heading>

// After
<Heading level="h2" className="text-3xl leading-10 text-ui-fg-base" >
  <I18nTitle metadata={product.metadata} defaultTitle={product.title} />
</Heading>

Create Function @/lib/util/get-i18n

import { getLocale } from "next-intl/server";

async function getI18n(metadata: { locale?: string } | null | undefined): Promise<Record<string, string> | null> {
  if (!metadata || !metadata.locale) {
    return null;
  }
  const localeCode = await getLocale();
  try {
    const localeObj = JSON.parse(metadata.locale);
    return localeObj[localeCode]
  } catch (e) {
    return null
  }
}

export default getI18n;

generateMetadata Using

export async function generateMetadata(props: Props): Promise<Metadata> {
  // ...

  const localeData = await getI18n(product.metadata);
  if (localeData) {
    return {
      title: localeData.title?localeData.title:product.title,
      description: localeData.description?localeData.description:product.description,
      openGraph: {
        title: localeData.title?localeData.title:product.title,
        description: localeData.title?localeData.description:product.description||'',
        images: product.thumbnail ? [product.thumbnail] : [],
      },
    }
  }
  return {
    title: `${product.title} `,
    description: `${product.title}`,
    openGraph: {
      title: `${product.title}`,
      description: `${product.title}`,
      images: product.thumbnail ? [product.thumbnail] : [],
    },
  }
}