escape-string-regexp
i18next
escape-string-regexp | i18next | |
---|---|---|
- | 70 | |
593 | 8,251 | |
-0.2% | 1.1% | |
2.5 | 8.9 | |
4 months ago | 8 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
escape-string-regexp
We haven't tracked posts mentioning escape-string-regexp yet.
Tracking mentions began in Dec 2020.
i18next
-
Show HN: Internationalizationext selector API – selector t for TypeScript
i18next.t($ => $.my.nested.key)
The change unlocks IDE autocompletion and “go to definition”, preserves JSDoc from your resource files at the call site, and — critically — removes the huge type-level unions that used to grind TypeScript/IDEs to a halt. See the announcement and examples.
The selector support has landed in i18next (PR merged) and react-i18next has matching typings/changes. If you want to migrate, there’s an automated codemod to convert usages to the selector form.
Why share this here: if you use TypeScript + i18next, this should make working with large translation catalogs far more pleasant — less “doom scrolling”, much better editor UX, and big type-performance improvements. We’d love feedback from folks who try the codemod or hit edge cases. => https://github.com/i18next/i18next/pull/2322
-
How to Implement Translations in a React App Using TypeScript?
The first step to implementing translations in a React app is to choose an appropriate library. One of the most popular libraries in the React ecosystem is i18next, which provides powerful features for internationalization. It allows you to easily manage translations, plural forms, and formatting.
-
Building a Scalable i18n System in React
This approach works particularly well for growing applications, allowing team members to work on different features without conflicts. For more information, check out the documentation for react-i18next, i18next, and js-cookie.
-
How to Easily Add Internationalization (i18n) to Your New Software Project
import i18n from 'i18next' import { initReactI18next } from 'react-i18next' import LanguageDetector from 'i18next-browser-languageDetector' import LocizeBackend from 'i18next-locize-backend' import LastUsed from 'locize-lastused' import { locizePlugin } from 'locize' const isDev = import.meta.env.DEV const locizeOptions = { projectId: import.meta.env.VITE_LOCIZE_PROJECTID, apiKey: import.meta.env.VITE_LOCIZE_APIKEY // // YOU should not expose your apps API key to production!!! } if (isDev) { // locize-lastused // sets a timestamp of last access on every translation segment on locize // -> safely remove the ones not being touched for weeks/months // https://github.com/locize/locize-lastused i18n.use(LastUsed) } i18n // i18next-locize-backend // loads translations from your project, saves new keys to it (saveMissing: true) // https://github.com/locize/i18next-locize-backend .use(LocizeBackend) // detect user language // learn more: https://github.com/i18next/i18next-browser-languageDetector .use(LanguageDetector) // Bind i18next to React .use(initReactI18next) // InContext Editor of locize .use(locizePlugin) // init i18next // for all options read: https://www.i18next.com/overview/configuration-options .init({ debug: isDev, // Enable logging for development fallbackLng: 'en', // Default language backend: locizeOptions, locizeLastUsed: locizeOptions, saveMissing: isDev // you should not use saveMissing in production }) export default i18n In src/main.tsx, import the i18n.ts configuration before rendering the app:
-
A Practical Guide to Translating & Localizing Your Web App: Using i18n and Lingo.dev
In this section, we will translate our previous web page to French and Spanish. The first step to achieve this is to install the i18next and react-i18next packages. i18next is an internationalization framework that makes localization possible for JavaScript, and react-i18next is specifically for React.
-
Testing with Playwright: Use i18next Translations in Tests, but not `t('key')`
E2E-testing localized applications can be challenging, translations keys can make test code harder to read and maintain. This article demonstrates how to test i18next translations in React app using Playwright, with a simplified approach that avoids translation keys. The idea can be used in any project with i18next or similar libraries.
-
Roadmap for Next.js
Next.js Internationalized Routing Next.js provides built-in support for internationalized routing. This page will introduce you to the fundamental concepts of i18n routing in Next.js and how to handle it. More Info i18next A popular library for internationalization that provides a complete set of tools for handling translation, formatting, and routing for i18n. More Info
-
Advanced Frontend Resources for Next.js Development 🚀
🌍 i18next Documentation
-
How to Easily Add Translations to Your React Apps with i18next
i18next is a popular internationalization library for JavaScript applications. It provides a robust framework for managing translations, formatting dates, numbers, and handling pluralization. i18next supports multiple backends for storing translations, making it versatile and adaptable to various project requirements.
-
Implementing Internationalization (i18n) in Vue.js Projects
For this article, we'll leverage the 'Simple CRM' project from our previous list of projects. We'll integrate and utilize the i18n library to internationalize our application.
What are some alternatives?
i18n-node - Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates.
Screen-Translator - An Electron.js-based desktop application for automatically translating on-screen text.
he - A robust HTML entity encoder/decoder written in JavaScript.
React Intl - The monorepo home to all of the FormatJS related libraries, most notably react-intl.
StegCloak - Hide secrets with invisible characters in plain text securely using passwords 🧙🏻♂️⭐
react-i18next - Internationalization for react done right. Using the i18next i18n ecosystem.