{"id":22196674,"url":"https://github.com/druids/gettext","last_synced_at":"2025-03-24T22:40:19.970Z","repository":{"id":62432464,"uuid":"136298302","full_name":"druids/gettext","owner":"druids","description":"GNU Gettext for Clojure based on Easy I18N","archived":false,"fork":false,"pushed_at":"2018-06-06T13:42:29.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T02:14:13.881Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/druids.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-06T08:34:24.000Z","updated_at":"2018-06-06T13:42:30.000Z","dependencies_parsed_at":"2022-11-01T20:47:06.916Z","dependency_job_id":null,"html_url":"https://github.com/druids/gettext","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fgettext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fgettext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fgettext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fgettext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/druids","download_url":"https://codeload.github.com/druids/gettext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245366207,"owners_count":20603438,"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":[],"created_at":"2024-12-02T14:16:02.462Z","updated_at":"2025-03-24T22:40:19.950Z","avatar_url":"https://github.com/druids.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"gettext\n=======\n\n[GNU Gettext](https://www.gnu.org/software/gettext) for Clojure based on\n [Easy i18n](https://github.com/awkay/easy-i18n).\n\nGettext library is just a thin wrapper around Easy i18n for ease usage.\n\n[![Dependencies Status](https://jarkeeper.com/druids/gettext/status.png)](https://jarkeeper.com/druids/gettext)\n[![License](https://img.shields.io/badge/MIT-Clause-blue.svg)](https://opensource.org/licenses/MIT)\n\n\nLeiningen/Boot\n--------------\n\nTo install, add the following to you project `:dependencies`:\n\n```clojure\n[druids/gettext \"0.2.0\"]\n```\n\nAnd into `:plugins`, if you want to call leiningen tasks.\n\n\nRequirements\n------------\n\nInstall a system dependency [GNU Gettext](https://www.gnu.org/software/gettext).\n\n\nConfiguration\n-------------\n\nA path for message files can be specified in `project.clj` like:\n\n```clojure\n{:gettext {:target-dir \"resources/myproject/i18n\"}\n```\n\nWhen the path is not specified following path is used: \"resources/PROJECT\\_NAME/i18n\".\n\n\nUsage\n-----\n\nBefore you start a language file need to be initialized, e.g.:\n\n```sh\nlein gettext init cs ge\n```\n\nWhen translations are done, messages need to be merged:\n\n```sh\nlein gettext merge cs ge\n```\n\nAnd compiled into Java classes:\n\n```sh\nlein gettext compile cs ge\n```\n\n\n`gettext.core` namespace provides following functions:\n\n- `tr` a basic translate function\n- `trc` translates a string in the given context\n- `trf` a basic translate function within format abilities\n- `trcf` translate a message with context and arguments\n- `trp` formats a string that varies based on plural forms\n\n\nExamples:\n\n```clojure\n(require '[gettext.core :as gettext])\n\n(gettext/tr \"Hello\") ;; Hello\n(gettext/tr :de \"Hello\") ;; \"Hallo\"\n\n(gettext/trf \"Hello {0}\" [\"world\"]) ;; \"Hello world\"\n(gettext/trf :de \"Hello {0}\" [\"Das Welt\"]) ;; \"Hallo Das Welt\"\n```\n\n\nNotes\n-----\n\nCurrently extracting messages from Clojure code is **NOT** supported. This job has to be done by a hand.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruids%2Fgettext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdruids%2Fgettext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruids%2Fgettext/lists"}