Convert Figma logo to code with AI

opral logoinlang

open file format for localizing software (i18n)

1,709
170
1,709
9

Top Related Projects

🌍 All in one i18n extension for VS Code

8,358

i18next: learn once - translate everywhere

🌍 📖 A readable, automated, and optimized (2 kb) internationalization for JavaScript

14,610

The monorepo home to all of the FormatJS related libraries, most notably react-intl.

Give your JavaScript the ability to speak many languages.

Quick Overview

Inlang is an open-source localization solution for web applications. It provides a comprehensive set of tools and services to manage translations, integrate localization into development workflows, and streamline the process of creating multilingual applications.

Pros

  • Offers a complete ecosystem for localization, including a CLI, SDK, and visual editor
  • Integrates seamlessly with popular web frameworks and build tools
  • Provides real-time collaboration features for translators and developers
  • Supports various file formats and custom plugins for extended functionality

Cons

  • Learning curve may be steep for beginners due to the comprehensive nature of the toolset
  • Documentation could be more extensive, especially for advanced use cases
  • Limited support for non-web-based applications
  • Some features may require a paid subscription for larger projects or teams

Code Examples

  1. Installing the Inlang CLI:
npm install -g @inlang/cli
  1. Initializing an Inlang project:
inlang init
  1. Using the Inlang SDK in a React component:
import { useTranslation } from '@inlang/sdk-js'

function MyComponent() {
  const { t } = useTranslation()
  return <h1>{t('greeting', 'Hello, World!')}</h1>
}
  1. Extracting messages from source code:
inlang extract

Getting Started

To get started with Inlang:

  1. Install the Inlang CLI:

    npm install -g @inlang/cli
    
  2. Initialize a new Inlang project in your application directory:

    cd your-project
    inlang init
    
  3. Install the Inlang SDK for your framework (e.g., React):

    npm install @inlang/sdk-js
    
  4. Use the SDK in your code (see example 3 above).

  5. Extract messages and manage translations using the Inlang CLI and web interface.

For more detailed instructions and advanced usage, refer to the official Inlang documentation.

Competitor Comparisons

🌍 All in one i18n extension for VS Code

Pros of i18n-ally

  • Extensive IDE integration with support for Visual Studio Code
  • Robust features for managing translations, including auto-completion and inline annotations
  • Active community and regular updates

Cons of i18n-ally

  • Limited to specific file formats and frameworks
  • Requires more setup and configuration compared to inlang
  • Less focus on collaborative workflows and team-based localization

Code Comparison

i18n-ally configuration:

{
  "i18n-ally.localesPaths": ["locales"],
  "i18n-ally.keystyle": "nested",
  "i18n-ally.sortKeys": true
}

inlang configuration:

{
  "sourceLanguageTag": "en",
  "languageTags": ["en", "de", "fr"],
  "modules": ["@inlang/plugin-json"]
}

While i18n-ally offers more granular control over IDE-specific features, inlang's configuration is more focused on project-wide settings and language management. i18n-ally excels in providing a comprehensive IDE experience, whereas inlang aims for a more streamlined and collaborative approach to localization across different platforms and tools.

8,358

i18next: learn once - translate everywhere

Pros of i18next

  • Mature and widely adopted internationalization framework
  • Extensive ecosystem with plugins and integrations
  • Supports multiple languages and pluralization

Cons of i18next

  • Steeper learning curve for complex configurations
  • Can be overkill for smaller projects
  • Requires manual management of translation files

Code Comparison

i18next:

import i18n from 'i18next';

i18n.init({
  lng: 'en',
  resources: {
    en: { translation: { key: 'Hello' } },
    de: { translation: { key: 'Hallo' } }
  }
});

console.log(i18n.t('key')); // Output: Hello

inlang:

import { i18n } from '@inlang/sdk-js';

const messages = {
  en: { hello: 'Hello' },
  de: { hello: 'Hallo' }
};

i18n.init({ messages });

console.log(i18n.t('hello')); // Output: Hello

Both libraries offer similar functionality for basic internationalization, but i18next provides more advanced features out of the box. inlang focuses on simplicity and ease of use, making it potentially more suitable for smaller projects or those new to i18n. i18next's extensive ecosystem and long-standing presence in the community give it an edge for complex, large-scale applications.

🌍 📖 A readable, automated, and optimized (2 kb) internationalization for JavaScript

Pros of js-lingui

  • More mature project with a larger community and ecosystem
  • Extensive documentation and examples for various use cases
  • Supports multiple frameworks including React, Vue, and Svelte

Cons of js-lingui

  • Limited support for non-JavaScript environments
  • Requires more setup and configuration compared to inlang
  • Less focus on collaborative translation workflows

Code Comparison

js-lingui:

import { t } from "@lingui/macro";

function Welcome() {
  return <h1>{t`Welcome to our app!`}</h1>;
}

inlang:

import { t } from "@inlang/sdk-js";

function Welcome() {
  return <h1>{t("welcome")}</h1>;
}

Both libraries offer similar syntax for basic translation, but js-lingui uses template literals while inlang uses function calls with string keys. inlang's approach may be more suitable for larger projects with many translatable strings, as it allows for easier management and organization of translations.

js-lingui provides more advanced features out-of-the-box, such as pluralization and date/number formatting, while inlang focuses on simplicity and ease of integration with various tools and services in the localization workflow.

14,610

The monorepo home to all of the FormatJS related libraries, most notably react-intl.

Pros of formatjs

  • Mature and widely adopted project with extensive documentation
  • Supports a broad range of internationalization features beyond just translation
  • Integrates well with popular frameworks like React and Angular

Cons of formatjs

  • Steeper learning curve due to its comprehensive feature set
  • Can be overkill for simpler projects that only need basic translation functionality
  • Requires more setup and configuration compared to lightweight alternatives

Code Comparison

formatjs:

import { FormattedMessage } from 'react-intl';

<FormattedMessage
  id="welcome"
  defaultMessage="Welcome, {name}!"
  values={{ name: 'John' }}
/>

inlang:

import { t } from '@inlang/sdk-js';

t('welcome', { name: 'John' });

Summary

formatjs is a robust internationalization library with extensive features, making it suitable for complex applications. However, its complexity may be unnecessary for simpler projects. inlang offers a more streamlined approach to translation, which can be beneficial for projects with basic localization needs. The choice between the two depends on the specific requirements of your project and the level of internationalization features needed.

Give your JavaScript the ability to speak many languages.

Pros of Polyglot.js

  • Lightweight and focused on client-side translation
  • Simple API for easy integration into web applications
  • Supports pluralization and interpolation out of the box

Cons of Polyglot.js

  • Limited to JavaScript environments
  • Lacks advanced features for managing complex localization workflows
  • No built-in support for machine translation or collaborative editing

Code Comparison

Polyglot.js:

import Polyglot from 'node-polyglot';

const polyglot = new Polyglot();
polyglot.extend({"hello": "Hello"});
console.log(polyglot.t("hello")); // Output: Hello

Inlang:

import { createInstance } from '@inlang/sdk';

const i18n = await createInstance({
  projectId: 'your-project-id'
});
console.log(i18n.t('hello')); // Output: Hello

Key Differences

  • Inlang offers a more comprehensive solution for managing the entire localization process, including project management and collaboration features.
  • Polyglot.js is more focused on providing a simple translation library for JavaScript applications.
  • Inlang supports multiple platforms and languages, while Polyglot.js is primarily designed for JavaScript environments.
  • Inlang includes features like machine translation and real-time collaboration, which are not available in Polyglot.js.

Both libraries serve different needs in the localization ecosystem, with Polyglot.js being a lightweight option for simple translation tasks and Inlang offering a more robust solution for complex, multi-platform localization projects.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

inlang icon

The open file format and ecosystem for localization (i18n)


🕹️ Apps · 📄 Docs · 💙 Discord · 𝕏 Twitter


The problem

i18n tools are not interoperable.

┌──────────┐        ┌───────────┐         ┌──────────┐
│ i18n lib │───✗────│Translation│────✗────│  Design  │
│          │        │   Tool    │         │   Tool   │
└──────────┘        └───────────┘         └──────────┘

Every tool has its own format, its own sync, its own collaboration layer. Cross-team work? Manual exports and hand-offs.

The solution

An open file format. Everything interoperates.

┌──────────┐        ┌───────────┐         ┌──────────┐
│ Paraglide│        │   Fink    │         │ Sherlock │
└────┬─────┘        └─────┬─────┘         └─────┬────┘
     │                    │                     │
     └─────────┐          │          ┌──────────┘
               ▼          ▼          ▼
           ┌──────────────────────────────────┐
           │          .inlang file            │
           └──────────────────────────────────┘

One file format. Multiple tools. All interoperable. The good old Unix philosophy.

Popular tools

  • Paraglide — i18n library for JS/TS with fully translated, typesafe & fast apps in minutes
  • Fink — translation editor in the browser, invite collaborators to help
  • Sherlock — VS Code extension to translate right in your editor
  • Parrot — see translations directly in Figma
  • CLI — lint messages, machine translate, quality control in CI/CD

Build your own

import { loadProjectFromDirectory } from "@inlang/sdk";

const project = await loadProjectFromDirectory({
  path: "./project.inlang",
});

const messages = await project.db.selectFrom("message").selectAll().execute();

The SDK gives you:

  • CRUD API for translations
  • SQL queries
  • Plugin system for any format
  • Version control via lix

Read the docs →

Contributing

There are many ways you can contribute to inlang! Here are a few options:

  • Star this repo
  • Create issues every time you feel something is missing or goes wrong
  • Upvote issues with 👍 reaction so we know what the demand for a particular issue to prioritize it within the roadmap

If you would like to contribute to the development of the project, please refer to our Contributing guide.

All contributions are highly appreciated. 🙏

NPM DownloadsLast 30 Days