{"id":15654456,"url":"https://github.com/kropp/kotlinx-gettext","last_synced_at":"2025-04-30T23:47:51.431Z","repository":{"id":57736874,"uuid":"483578097","full_name":"kropp/kotlinx-gettext","owner":"kropp","description":"Gettext compatible library and Gradle plugin","archived":false,"fork":false,"pushed_at":"2025-02-27T18:26:06.000Z","size":328,"stargazers_count":45,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-30T23:47:43.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kropp.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,"publiccode":null,"codemeta":null}},"created_at":"2022-04-20T08:52:20.000Z","updated_at":"2025-04-15T13:31:45.000Z","dependencies_parsed_at":"2025-02-27T17:26:55.134Z","dependency_job_id":"63c1acdb-250b-400d-af26-2ec182c916c9","html_url":"https://github.com/kropp/kotlinx-gettext","commit_stats":{"total_commits":68,"total_committers":1,"mean_commits":68.0,"dds":0.0,"last_synced_commit":"744e3b30b1b795ec7210ccac0c3364f4de85beae"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kropp%2Fkotlinx-gettext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kropp%2Fkotlinx-gettext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kropp%2Fkotlinx-gettext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kropp%2Fkotlinx-gettext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kropp","download_url":"https://codeload.github.com/kropp/kotlinx-gettext/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251801087,"owners_count":21645968,"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-10-03T12:51:52.913Z","updated_at":"2025-04-30T23:47:51.379Z","avatar_url":"https://github.com/kropp.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Kotlinx Gettext](kotlinx-gettext.png)\n\n![maven](https://img.shields.io/maven-central/v/name.kropp.kotlinx-gettext/kotlinx-gettext)\n![license](https://img.shields.io/github/license/kropp/kotlinx-gettext)\n\nGettext is a widely used internationalization (i18n) format supported by many tools.\nThis project provides pure Kotlin implementation of Gettext.\n\nThe project consists of several parts:\n 1. `kotlinx-gettext` library to use in your project to translate strings.\n 2. `kotlinx-gettext-plugin` Kotlin compiler plugin to extract strings for translation from Kotlin code.\n 3. `kotlinx-gettext-gradle-plugin` to conveniently apply Kotlin compiler plugin in your Gradle build.\n\n## Usage\n\n### Library\n\nAdd the `\"name.kropp.kotlinx-gettext:kotlinx-gettext:0.7.0\"` to the dependencies of your project.\nThe library is available on [Maven Central](https://search.maven.org/artifact/name.kropp.kotlinx-gettext/kotlinx-gettext).\n\nLoad translated strings and apply translations using an instance of `I18n` class.\n\n```kotlin\nval i18n = Gettext.load(Locale.GERMAN, Thread.currentThread().contextClassLoader.getResourceAsStream(\"de.po\")!!)\nprintln(i18n.tr(\"Hello world!\"))\n```\n\nSee `sample` module for a full example. Refer to [GNU gettext documentation](https://www.gnu.org/software/gettext/)\nfor more details.\n\n### Translation\n\nApply Gradle plugin to extract strings and setup `gettext` task: \n\n```kotlin\nplugins {\n  id(\"name.kropp.kotlinx-gettext\") version \"0.7.0\"\n}\n\ngettext {\n  potFile.set(File(projectDir, \"src/messages.pot\"))\n  keywords.set(listOf(\"tr\",\"trn:1,2\"))\n}\n```\n\nThen invoke `./gradlew gettext` to extract strings for translations into `src/messages.pot`\n\nTranslate messages with any software or service supporting Gettext format. The result will be a number of .po files,\nwhich you should put into resources.\n\n## Known issues\n * The library only supports Kotlin/JVM and Kotlin/JS as of now, Multiplatform Native port is in progress.\n * .mo files are not (yet) supported.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkropp%2Fkotlinx-gettext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkropp%2Fkotlinx-gettext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkropp%2Fkotlinx-gettext/lists"}