{"id":13806720,"url":"https://github.com/crystal-i18n/i18n","last_synced_at":"2025-04-19T13:48:21.646Z","repository":{"id":44372814,"uuid":"296920685","full_name":"crystal-i18n/i18n","owner":"crystal-i18n","description":"🌐 An internationalization library for Crystal. ","archived":false,"fork":false,"pushed_at":"2025-02-08T01:32:51.000Z","size":484,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T08:22:40.095Z","etag":null,"topics":["crystal","i18n","internationalization","l10n","locale","localization","translation"],"latest_commit_sha":null,"homepage":"https://crystal-i18n.github.io","language":"Crystal","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/crystal-i18n.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"2020-09-19T17:40:59.000Z","updated_at":"2025-03-15T18:20:42.000Z","dependencies_parsed_at":"2023-11-15T03:27:20.111Z","dependency_job_id":"850775bb-0031-4c5a-81ba-be9dc29a90a5","html_url":"https://github.com/crystal-i18n/i18n","commit_stats":{"total_commits":138,"total_committers":2,"mean_commits":69.0,"dds":"0.021739130434782594","last_synced_commit":"8f2ae3d13ae6dfeee71f64bef3afc0cda0f8f0fc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-i18n%2Fi18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-i18n%2Fi18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-i18n%2Fi18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-i18n%2Fi18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystal-i18n","download_url":"https://codeload.github.com/crystal-i18n/i18n/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246385451,"owners_count":20768668,"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":["crystal","i18n","internationalization","l10n","locale","localization","translation"],"created_at":"2024-08-04T01:01:15.248Z","updated_at":"2025-03-30T21:32:03.851Z","avatar_url":"https://github.com/crystal-i18n.png","language":"Crystal","funding_links":[],"categories":["Marten shards","Internationalization"],"sub_categories":["Internationalization"],"readme":"# Crystal I18n\n\n![logo](https://raw.githubusercontent.com/crystal-i18n/i18n/main/docs/src/.vuepress/public/assets/img/hero.svg)\n\n[![Version](https://img.shields.io/github/v/tag/crystal-i18n/i18n)](https://github.com/crystal-i18n/i18n/tags)\n[![License](https://img.shields.io/github/license/crystal-i18n/i18n)](https://github.com/crystal-i18n/i18n/blob/main/LICENSE)\n[![CI](https://github.com/crystal-i18n/i18n/workflows/CI/badge.svg)](https://github.com/crystal-i18n/i18n/actions)\n\n---\n\n**Crystal I18n** is an internationalization library for the Crystal programming language. It provides a unified interface \nallowing to leverage translations and localized contents in a Crystal project.\n\nFeatures:\n\n* Translation lookups\n* Localization\n* Interpolation\n* Pluralization rules\n* Locale fallbacks\n* Flexible configuration\n\n## Documentation\n\nOnline browsable documentation is available at https://crystal-i18n.github.io/.\n\n## Installation\n\nSimply add the following entry to your project's `shard.yml`:\n\n```yaml\ndependencies:\n  i18n:\n    github: crystal-i18n/i18n\n```\n\nAnd run `shards install` afterwards.\n\n## Usage\n\nAssuming that a `config/locales` relative folder exists in your project, with the following `en.yml` file in it:\n\n```yaml\nen:\n  simple:\n    translation: \"This is a simple translation\"\n    interpolation: \"Hello, %{name}!\"\n    pluralization:\n      one: \"One item\"\n      other: \"%{count} items\"\n```\n\nThe following setup could be performed in order to initialize `I18n` properly:\n\n```crystal\nrequire \"i18n\"\n\nI18n.config.loaders \u003c\u003c I18n::Loader::YAML.new(\"config/locales\")\nI18n.config.default_locale = :en\nI18n.init\n```\n\nHere a translation loader is configured to load the previous translation file while also configuring the default locale \n(`en`) and initializing the `I18n` module.\n\nTranslations lookups can now be performed using the `#translate` method (or the shorter version `#t`) as follows:\n\n```crystal\nI18n.t(\"simple.translation\")                     # outputs \"This is a simple translation\"\nI18n.t(\"simple.interpolation\", name: \"John Doe\") # outputs \"Hello, John Doe!\"\nI18n.t(\"simple.pluralization\", count: 42)        # outputs \"42 items\"\n```\n\nPlease head over to the [documentation](https://crystal-i18n.github.io/) for a more complete overview of the `I18n` \nmodule capabilities (including the configuration options, localization features, etc).\n\n## Authors\n\nMorgan Aubert ([@ellmetha](https://github.com/ellmetha)) and \n[contributors](https://github.com/crystal-i18n/i18n/contributors).\n\n## Credits\n\nCrystal I18n initially draws its inspiration from [Ruby I18n](https://github.com/ruby-i18n/i18n) and \n[rails-i18n](https://github.com/svenfuchs/rails-i18n). Originally, pluralization and localization rules all come from\n[rails-i18n](https://github.com/svenfuchs/rails-i18n) as well.\n\n## License\n\nMIT. See ``LICENSE`` for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-i18n%2Fi18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystal-i18n%2Fi18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-i18n%2Fi18n/lists"}