{"id":21490496,"url":"https://github.com/colorfy-software/localify","last_synced_at":"2026-04-17T12:31:14.887Z","repository":{"id":59831076,"uuid":"539469259","full_name":"colorfy-software/localify","owner":"colorfy-software","description":"🌍 Localization for React Native made simple.","archived":false,"fork":false,"pushed_at":"2024-01-02T09:17:04.000Z","size":467,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-30T09:33:26.676Z","etag":null,"topics":["android","i18n","ios","localization","react-native"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/@colorfy-software/localify","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colorfy-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-21T12:10:07.000Z","updated_at":"2025-08-15T01:31:57.000Z","dependencies_parsed_at":"2024-11-23T17:00:46.285Z","dependency_job_id":null,"html_url":"https://github.com/colorfy-software/localify","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"d2aa6ea1b43a2986e452b491073e1d3b898c0cdc"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/colorfy-software/localify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colorfy-software%2Flocalify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colorfy-software%2Flocalify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colorfy-software%2Flocalify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colorfy-software%2Flocalify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colorfy-software","download_url":"https://codeload.github.com/colorfy-software/localify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colorfy-software%2Flocalify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31929482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:35:34.458Z","status":"ssl_error","status_checked_at":"2026-04-17T10:35:09.472Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","i18n","ios","localization","react-native"],"created_at":"2024-11-23T14:38:29.773Z","updated_at":"2026-04-17T12:31:14.846Z","avatar_url":"https://github.com/colorfy-software.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/colorfy-software/localify/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    🌍 Localify\n  \u003c/a\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003cstrong\u003eLocalization for React Native made simple.\u003c/strong\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/colorfy-software/localify/actions\"\u003e\n    \u003cimg src=\"https://github.com/colorfy-software/localify/workflows/Test%20Suite/badge.svg?branch=main\" alt=\"Current GitHub Actions build status.\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.org/package/@colorfy-software/localify\"\u003e\n    \u003cimg src=\"https://badge.fury.io/js/@colorfy-software%2Flocalify.svg\" alt=\"Current npm package version.\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/colorfy-software/localify/contributing\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome!\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 🎯 Purpose\n\nLocalify helps you handle localization in your React Native apps with first class Typescript support: simply autocomplete your way through your translation files.\n\n## 🏗️ Installation\n\n```sh\nyarn add @colorfy-software/localify react-native-localize i18n-js\nnpx pod-install ios --yes\n```\n\n## 💻 Usage\n\n### Setup\n\n#### App\n\n```ts\n// ./index.tsx\n\nimport { AppRegistry } from 'react-native'\nimport Localify from '@colorfy-software/localify'\n\nimport App from './src/App'\n\nconst translations = {\n  en: require('./src/locales/en.ts'),\n  de: require('./src/locales/de.ts'),\n} as const\n\nLocalify.init({\n  // mandatory\n  translations,\n  // optional\n  defaultSeparator: '.',\n  // optional\n  fallback: { languageTag: 'en', isRTL: false },\n})\n\nAppRegistry.registerComponent('main', () =\u003e App)\n\n```\n\n#### Jest\n\n```js\n// ./jest.setup.js\n// (or wherever you have your Jest config's setupFiles file)\n\nprocess.env.JEST = true // add this line\n```\n\n### With TypeScript \u0026 autocomplete\n\n\u003cdetails\u003e\n\u003csummary\u003eSee steps\u003c/summary\u003e\n\n```ts\n// ./src/locales/index.ts\nimport Localify, { ValueMapType, currentLocale, currentLocaleCode } from '@colorfy-software/localify'\n\n// Example of what en.ts has to look like:\n\n// export default {\n//   general: {\n//     activity: 'Activity',\n//     home: 'Home',\n//     settings: 'Settings',\n//     tips: 'Tips',\n//     logout: 'Log out',\n//   },\n//   errors: {\n//     requiredField: 'This field is required',\n//     passwordTooLong: 'Password needs to be less than **{{maxLengthValue}}** characters long.',\n//     invalidEmail:\n//       \"Sorry, **{{email}}** is not a valid email address. Please double check the email you've entered and try again.\",\n//     passwordRules:\n//       'Your password must be **at least 8 characters long**, with at least three of the following kinds of characters: **uppercase, lowercase, number, and/or symbols**.',\n//   },\n// } as const\n\n// 👆 notice the `as const`.\n\nimport type en from './en'\n\ntype ContextType = keyof typeof en\n\nconst getLocalizedString = \u003c\n  C extends ContextType,\n  K extends keyof typeof en[C],\n  V extends ValueMapType\u003ctypeof en[C][K] extends string ? typeof en[C][K] : never\u003e,\n  R extends typeof en[C][K],\n\u003e(\n  context: C,\n  key: K,\n  ...values: keyof V extends never ? [never?] : [V]\n): R =\u003e Localify.getLocalizedString(context, key, values)\n\nexport { currentLocale, currentLocaleCode, getLocalizedString }\n```\n\nThis is required so that you can define your preferred language for the TypeScript-powered autocompletion. Now, you'd have to import everything from `./src/locales/index.ts` instead of the library, `getLocalizedString()` being the\nmost important here:\n\n```ts\n// ./src/App.tsx\nimport * as React from 'react'\nimport { StyleSheet, SafeAreaView, Text } from 'react-native'\n\nimport { currentLocale, getLocalizedString } from './locales'\n\nexport default function App() {\n  return (\n    \u003cSafeAreaView style={styles.container}\u003e\n      \u003cText\u003e\n        {currentLocale()}\n        {getLocalizedString('general', 'home')}\n        {getLocalizedString('errors', 'invalidEmail', { email: 'info@colorfy.me' })}\n      \u003c/Text\u003e\n    \u003c/SafeAreaView\u003e\n  )\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  box: {\n    width: 60,\n    height: 60,\n    marginVertical: 20,\n  },\n})\n```\n\n\u003c/details\u003e\n\n### Without TypeScript/autocomplete\n\n\u003cdetails\u003e\n\u003csummary\u003eSee steps\u003c/summary\u003e\n\n```ts\n// ./src/App.tsx\nimport * as React from 'react'\nimport Localify from '@colorfy-software/localify'\nimport { StyleSheet, SafeAreaView, Text } from 'react-native'\n\nexport default function App() {\n  return (\n    \u003cSafeAreaView style={styles.container}\u003e\n      \u003cText\u003e\n        {Localify.currentLocale()}\n        {Localify.getLocalizedString('general', 'settings')}\n        {Localify.getLocalizedString('errors', 'passwordTooLong', { maxLengthValue: '50' })}\n      \u003c/Text\u003e\n    \u003c/SafeAreaView\u003e\n  )\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  box: {\n    width: 60,\n    height: 60,\n    marginVertical: 20,\n  },\n})\n```\n\u003c/details\u003e\n\n## 🤝 Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## 💖 Code of Conduct\n\nThis library has adopted a Code of Conduct that we expect project participants to adhere to. Please read the [full text](https://github.com/colorfy-software/localify/blob/main/CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.\n\n## 📰 License\n\nlocalify is licensed under the [MIT License](https://github.com/colorfy-software/localify/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolorfy-software%2Flocalify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolorfy-software%2Flocalify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolorfy-software%2Flocalify/lists"}