Skip to content

OGS-GmbH/lexora

Repository files navigation

We're OGS, check out our work on github.com/ogs-gmbh

Lexora

Zero-friction translation library for Next.js with fast server and client APIs and a clean developer experience.

Preview

license badge workflow badge npm badge

  • Lightning-Fast Translations for Next.js
    Deliver localized experiences instantly with a translation workflow built for speed, simplicity, and modern Next.js applications.

  • Seamless Server and Client Integration
    Use one cohesive translation experience across server and client components, so your team can build multilingual interfaces without friction.

  • Flexible by Design
    Power your translations from files, APIs, or custom data sources with an adapter-based architecture that scales with your product.

  • Built for Clean, Scalable Localization
    Keep translation keys organized with scoped access patterns that make large multilingual codebases easier to manage and grow.

Getting Started

Important

We're offering an extensive API-Reference covered with in-depth usage examples of this project.

To get a starting point, simply refer to our documentation at ogs-gmbh.github.io/lexora.

Prerequisites

  • Node.js version 18 or higher
  • A package manager: e.g. npm, pnpm, ...

Installation

Using npm:

$ npm install @ogs-gmbh/lexora
Using a different package manager?

Using yarn:

$ pnpm add @ogs-gmbh/lexora

Using pnpm:

$ pnpm add @ogs-gmbh/lexora

Using bun:

$ bun add @ogs-gmbh/lexora

Usage

lexora provides a general facility for adapters and server/client integration, but it does not handle the loading of translations. Please refer to adapters for getting a better understanding. In the following example, we use lexora-postgres-adapter inside a Next.js layout, that will load translations from a Postgres database.

import { getTranslations } from "@ogs-gmbh/lexora/server";
import { LexoraProvider } from "@ogs-gmbh/lexora/client";
import { postgresAdapter } from "@ogs-gmbh/lexora-postgres-adapter";

function RootLayout() {
  const translations = await getTranslations({
    locale: "de",
    adapters: [postgresAdapter("postgres://admin:root@127.0.0.1:5432/default")]
  });

  return (
    <html>
      <body>
        <LexoraProvider data={translations}>{children}</LexoraProvider>
      </body>
    </html>
  );
}

export default RootLayout;

You're now able to translate by server and client components. Enjoy ⭐.

License

The MIT License (MIT) - Please have a look at the LICENSE file for more details.

Contributing

Contributions are always welcome and greatly appreciated. Whether you want to report a bug, suggest a new feature, or improve the documentation, your input helps make the project better for everyone.

Feel free to submit a pull request, issue or feature request.

Issues and Feature Requests

Reporting an issue or creating a feature request is made by creating a new issue on this repository.

You can create a new issue or feature request here.

Pull Requests

GitHub offers a solid guideline for contributing to open source projects through pull requests, covering key practices. These best practices provide a reliable starting point for making effective contributions.

You can find the guidelines here.

Code Of Conduct

We are committed to keeping a welcoming, inclusive, and respectful community for everyone. To help us achieve this, we kindly ask that you adhere to our Code of Conduct.

Disclaimer

All trademarks and registered trademarks mentioned are property of their respective owners and are used for identification purposes only. Use of these names does not imply endorsement or affiliation.

This project is a trademark of OGS Gesellschaft für Datenverarbeitung und Systemberatung mbH. The License does not grant rights to use the trademark without permission.


OGS Logo

Gesellschaft für Datenverarbeitung und Systemberatung mbH

Imprint | Contact | Careers

About

Zero-friction translation library for Next.js with fast server and client APIs and a clean developer experience.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from OGS-GmbH/_react-template