GithubHelp home page GithubHelp logo

omnomnomka / next-intl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amannn/next-intl

0.0 0.0 0.0 2.53 MB

A minimal, but complete solution for internationalization in Next.js apps. ๐ŸŒ

Home Page: https://next-intl-docs.vercel.app

License: MIT License

JavaScript 5.80% TypeScript 93.94% CSS 0.26%

next-intl's Introduction



next-intl


A minimal, but complete solution for internationalization in Next.js apps.

Gzipped size Tree shaking supported

Features

This library complements the internationalized routing capabilities of Next.js by managing translations and providing them to components.

  • ๐ŸŒŸ Proven ICU syntax: This covers interpolation, plurals, ordinal pluralization, label selection based on enums and rich text. I18n is an essential part of the user experience, therefore this library doesn't compromise on flexibility and never leaves you behind when you need to fine tune a translation.
  • ๐Ÿ“… Built-in date, time and number formatting: You can use global formats for a consistent look & feel of your app and integrate them with translations.
  • ๐Ÿ’ก Hooks-only API: This ensures that you can use the same API for children as well as for attributes which expect strings.
  • โœ… Type-safe: If you're using TypeScript, you'll benefit from autocompletion for available message keys and compile-time errors for typos.
  • โš”๏ธ Battle-tested building blocks: This library is a minimal wrapper around built-in browser APIs and supplemental lower-level APIs from Format.JS.
  • ๐Ÿš€ Fast: By integrating with both static as well as server side rendering you always get the best possible performance from your app.

What does it look like?

This library is based on the premise that messages can be grouped by namespaces (typically a component name).

// LatestFollower.js
function LatestFollower({user}) {
  const t = useTranslations('LatestFollower');

  return (
    <>
      <Text>{t('latestFollower', {username: user.name})}</Text>
      <IconButton aria-label={t('followBack')} icon={<FollowIcon />} />
    </>
  );
}
// en.json
{
  "LatestFollower": {
    "latestFollower": "{username} started following you",
    "followBack": "Follow back"
  }
}

next-intl's People

Contributors

amannn avatar mismosmi avatar mchccn avatar maxwoedl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.