Find hard-coded user-facing strings
ProprietaryFinds hard-coded strings that React apps show to users, as a starting point for internationalization. Reports JSX text; string and template literal values of user-facing attributes (alt, title, placeholder, label, text-bearing aria-*) and of component text props such as heading, text or names ending in Label, Title, Text or Message; strings in variables, and in properties and array elements of objects, that the same file or an importing file shows, directly or through the props of the components it renders, .map callbacks included; string props a component shows; following relative, baseUrl and @/ alias imports of named, default and namespace exports through up to three re-exports; titles and descriptions in Next.js metadata and generateMetadata; and messages passed to toast(...) from sonner, react-hot-toast, react-toastify or a local toast/use-toast module. Strings that need interpolation or <Trans> are marked MIXED; a sentence split by expressions or elements is one row, written as <Trans> reads it. Skips test, story, mock-data, example-app, playground, developer and debug sources; anything inside <Trans> or components imported from Lingui, react-intl, react-i18next, next-i18next or next-intl; text in <code>, <pre>, <kbd>, <script> and <style>; strings without a word (two letters, or one ideograph); and strings made of a single URL, email address, domain, path, hex colour, or camelCase, snake_case or CONSTANT_CASE identifier. Strings whose way to the screen goes through state, context or functions other than array callbacks are not followed.
org. openrewrite. react. search. find-hard-coded-stringsmod run . --recipe= org. openrewrite. react. search. find-hard-coded-stringsInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.