{"id":21195608,"url":"https://github.com/openpeeps/oris","last_synced_at":"2026-05-17T13:36:57.121Z","repository":{"id":230052817,"uuid":"778284905","full_name":"openpeeps/oris","owner":"openpeeps","description":"Streamlined YAML to multilingual translation library","archived":false,"fork":false,"pushed_at":"2024-03-27T15:01:33.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T14:15:43.615Z","etag":null,"topics":["i18n","internationalization","nim","nim-lang","openpeeps","oris","yaml"],"latest_commit_sha":null,"homepage":"","language":"Nim","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/openpeeps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-27T12:41:40.000Z","updated_at":"2024-04-01T13:36:57.000Z","dependencies_parsed_at":"2024-03-27T16:12:58.334Z","dependency_job_id":"14a1caa2-8680-4a4c-aaa8-964b6341379b","html_url":"https://github.com/openpeeps/oris","commit_stats":null,"previous_names":["openpeeps/oris"],"tags_count":0,"template":false,"template_full_name":"openpeeps/pistachio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Foris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Foris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Foris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Foris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openpeeps","download_url":"https://codeload.github.com/openpeeps/oris/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243652711,"owners_count":20325607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["i18n","internationalization","nim","nim-lang","openpeeps","oris","yaml"],"created_at":"2024-11-20T19:29:06.529Z","updated_at":"2026-05-17T13:36:57.116Z","avatar_url":"https://github.com/openpeeps.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/openpeeps/oris/blob/main/.github/oris.png\" width=\"120px\"\u003e\u003cbr\u003e\n  A simple i18n library for Nim\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ccode\u003enimble install oris\u003c/code\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://openpeeps.github.com/oris\"\u003eAPI reference\u003c/a\u003e\u003cbr\u003e\n  \u003cimg src=\"https://github.com/openpeeps/oris/workflows/test/badge.svg\" alt=\"Github Actions\"\u003e  \u003cimg src=\"https://github.com/openpeeps/oris/workflows/docs/badge.svg\" alt=\"Github Actions\"\u003e\n\u003c/p\u003e\n\n## 😍 Key Features\n- [x] Simple, macro-based interface\n- [x] Switch between languages at runtime\n- [x] Support for pluralization\n- [x] Support for interpolation of variables in translations\n- [x] Encode/Decode language data to/from disk using FastBinaryEncoding (FBE)\n\n## Examples\nThis example shows how to define multiple languages, retrieve translations with interpolation, and serialize/deserialize language data using [FastBinaryEncoding](https://github.com/chronoxor/FastBinaryEncoding) (FBE) format via [pkg/openparser](https://github.com/openpeeps/openparser).\n\n```nim\nimport pkg/oris\n\nvar i18n = newOris(default = \"en\")\n\n# Define English language\nnewLanguage i18n, \"en\":\n  welcome: \"Welcome to Oris!\"\n  welcome_message: \"Your Oris instance is now live. You have $count new messages.\"\n  dashboard_title: \"Dashboard\"\n  dashboard_description: \"This is your Oris dashboard where you can manage your projects, settings, and more.\"\n  greeting_user: \"Hello, $name! Welcome back.\"\n  animals do(dogs: int, cats: int):\n    result = \"$dogs and $cats\"\n    case dogs:\n      of 1: \"one dog\"\n      else: \"$dogs dogs\"\n    case cats:\n      of 1: \"one cat\"\n      else: \"$cats cats\"\n\n# Define Spanish language\nnewLanguage i18n, \"es\":\n  welcome: \"¡Bienvenido a Oris!\"\n  welcome_message: \"Tu instancia de Oris ya está en vivo. Tienes $count nuevos mensajes.\"\n  dashboard_title: \"Panel de Control\"\n  dashboard_description: \"Este es tu panel de control de Oris donde puedes administrar tus proyectos, configuraciones y más.\"\n  greeting_user: \"¡Hola, $name! Bienvenido de nuevo.\"\n  animals do(dogs: int, cats: int):\n    result = \"$dogs y $cats\"\n    case dogs:\n      of 1: \"un perro\"\n      else: \"$dogs perros\"\n    case cats:\n      of 1: \"un gato\"\n      else: \"$cats gatos\"\n\n# Showcase translations in the default language (\"en\")\necho i18n.translate(\"welcome\")\n  # \"Welcome to Oris!\"\n\necho i18n.translate(\"welcome_message\", [\"3\"])\n  # \"Your Oris instance is now live. You have 3 new messages.\"\n\necho i18n.translate(\"greeting_user\", @[\"Alice\"])\n  # \"Hello, Alice! Welcome back.\"\n\necho i18n.translate(\"animals\", [(\"dogs\", 2), (\"cats\", 1)])\n  # \"2 dogs and one cat\"\n\n# Showcase translations in Spanish (\"es\")\necho i18n.translate(\"es\", \"welcome\")\n  # \"¡Bienvenido a Oris!\"\n\necho i18n.translate(\"es\", \"welcome_message\", [\"5\"])\n  # \"Tu instancia de Oris ya está en vivo. Tienes 5 nuevos mensajes.\"\n\necho i18n.translate(\"es\", \"greeting_user\", @[\"Carlos\"])\n  # \"¡Hola, Carlos! Bienvenido de nuevo.\"\n\necho i18n.translate(\"es\", \"animals\", [(\"dogs\", 1), (\"cats\", 3)])\n  # \"un perro y 3 gatos\"\n```\n\n### Encode and Decode language data\nEncode language data to disk using FBE format and decode it back to verify that translations are preserved correctly\n\n```nim\n# Encode the English language to disk using FastBinaryEncoding (FBE) format\ni18n.languages[\"en\"].encode(\"en.fbe\")\n\n# Decode the language from disk and verify translations\nvar enDecoded: Language\nenDecoded.decode(\"en.fbe\")\n\n# Verify translations from the decoded language\necho enDecoded.translate(\"welcome\")\n  # \"Welcome to Oris!\"\n\necho enDecoded.translate(\"welcome_message\", [\"2\"])\n  # \"Your Oris instance is now live. You have 2 new messages.\"\n\necho enDecoded.translate(\"animals\", [(\"dogs\", 1), (\"cats\", 2)])\n  # \"one dog and 2 cats\"\n\n# Encode the Spanish language to disk\ni18n.languages[\"es\"].encode(\"es.fbe\")\n\n# Decode the Spanish language from disk and verify translations\nvar esDecoded: Language\nesDecoded.decode(\"es.fbe\")\n\n# Verify translations from the decoded Spanish language\necho esDecoded.translate(\"welcome\")\n  # \"¡Bienvenido a Oris!\"\n\necho esDecoded.translate(\"welcome_message\", [\"4\"])\n  # \"Tu instancia de Oris ya está en vivo. Tienes 4 nuevos mensajes.\"\n\necho esDecoded.translate(\"animals\", [(\"dogs\", 3), (\"cats\", 1)])\n  # \"3 perros y un gato\"\n```\n\n### Other serialization formats\nYou can use `pkg/openparser/json`(with/without `pkg/openparser/bson`), `pkg/jsony`, `pkg/flatty` to encode/decode `Language` data to/from JSON, JSONY, or binary formats as well.\n\n\n### Inspiration\nInspired by other i18n libraries from Nim community:\n- https://github.com/moigagoo/loco\n- https://github.com/heinthanth/ni18n\n\n### ❤ Contributions \u0026 Support\n- 🐛 Found a bug? [Create a new Issue](https://github.com/openpeeps/oris/issues)\n- 👋 Wanna help? [Fork it!](https://github.com/openpeeps/oris/fork)\n- 😎 [Get €20 in cloud credits from Hetzner](https://hetzner.cloud/?ref=Hm0mYGM9NxZ4)\n\n### 🎩 License\nMIT license. [Made by Humans from OpenPeeps](https://github.com/openpeeps).\u003cbr\u003e\nCopyright \u0026copy; 2026 OpenPeeps \u0026 Contributors \u0026mdash; All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpeeps%2Foris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenpeeps%2Foris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpeeps%2Foris/lists"}