{"id":27648141,"url":"https://github.com/tolgee/compose-tolgee","last_synced_at":"2025-04-24T02:05:56.266Z","repository":{"id":272042192,"uuid":"915347780","full_name":"tolgee/compose-tolgee","owner":"tolgee","description":"Compose Multiplatform localization wrapper for Tolgee","archived":false,"fork":false,"pushed_at":"2025-04-22T12:18:43.000Z","size":1796,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T02:05:36.771Z","etag":null,"topics":["compose","compose-multiplatform","i18n","kotlin","kotlin-android","kotlin-library","kotlin-multiplatform","tolgee"],"latest_commit_sha":null,"homepage":"https://datl4g.github.io/compose-tolgee/","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/tolgee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"DatL4g","patreon":"datlag","polar":"DatL4g","custom":["paypal.me/datlag"]}},"created_at":"2025-01-11T16:03:55.000Z","updated_at":"2025-04-22T12:18:46.000Z","dependencies_parsed_at":"2025-01-18T18:39:59.506Z","dependency_job_id":"e5124ec7-b0d8-434e-9671-5219ceb15c95","html_url":"https://github.com/tolgee/compose-tolgee","commit_stats":null,"previous_names":["datl4g/compose-tolgee","jancizmar/compose-tolgee","tolgee/compose-tolgee"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolgee%2Fcompose-tolgee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolgee%2Fcompose-tolgee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolgee%2Fcompose-tolgee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolgee%2Fcompose-tolgee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tolgee","download_url":"https://codeload.github.com/tolgee/compose-tolgee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546077,"owners_count":21448260,"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":["compose","compose-multiplatform","i18n","kotlin","kotlin-android","kotlin-library","kotlin-multiplatform","tolgee"],"created_at":"2025-04-24T02:05:53.470Z","updated_at":"2025-04-24T02:05:56.261Z","avatar_url":"https://github.com/tolgee.png","language":"Kotlin","funding_links":["https://github.com/sponsors/DatL4g","https://patreon.com/datlag","https://polar.sh/DatL4g","paypal.me/datlag","https://github.com/sponsors/DATL4G","https://paypal.me/datlag"],"categories":[],"sub_categories":[],"readme":"# Kotlin Multiplatform and Android package for Tolgee\n\n🚨🚨🚨This package is currently under heavy development and will be released under alpha versions until stable and properly tested by pilot users.🚨🚨🚨\n\n[![Tolgee](https://img.shields.io/badge/Tolgee-f06695?style=for-the-badge)](https://tolgee.io/) ![Compose Multiplatform](https://img.shields.io/badge/Compose%20Multiplatform-Supported-green?style=for-the-badge) ![Jetpack Compose](https://img.shields.io/badge/Jetpack%20Compose-Supported-green?style=for-the-badge)\n\nA flexible Gradle plugin and runtime library for integrating [Tolgee translations](https://tolgee.io) into **Kotlin Multiplatform** and **Compose** projects.\n\n## Gradle plugin\n\nComes with a convenient task to pull your latest translations directly into your resources folder.\n\n### Setup\n\nUsing Version Catalog is highly recommended to keep your versions aligned.\n\n```toml\n[plugins]\ntolgee = { id = \"dev.datlag.tolgee\", version.ref = \"tolgee\" }\n```\n\n**Configuration**\n\nYou can change the plugin behavior to your needs:\n\n```kotlin\ntolgee {\n    // REQUIRED\n    apiKey.set(\"\u003cYOUR TOLGEE APIKEY WITH TRANSLATION READ ACCESS\u003e\") // or use the 'tolgee.apikey=' property instead\n    \n    // more options\n    pull { ... }\n    push { ... }\n    \n    // change compile time behavior\n    compilerPlugin {\n        android {\n            // Replaces Context.getString occurrences with Context.getStringInstant\n            replaceGetString.set(false) // default true\n        }\n    }\n}\n```\n\n### Usage\n\nPull translations from Tolgee using the `pullTranslation` Gradle task.  \nPush local translations to Tolgee using the `pushTranslation` Gradle task.\n\n## Core\n\nThis Kotlin Multiplatform library provides runtime support for Tolgee translations in your app.  \nNo longer creating a new release just to update your strings.\n\n###  Setup\n\nUsing Version Catalog is highly recommended to keep your versions aligned.\n\n```toml\n[libraries]\ntolgee = { group = \"dev.datlag.tolgee\", name = \"core\", version.ref = \"tolgee\" }\n```\n\n### Usage\n\nSimply create a `Tolgee` singleton or multiple instances, using an API Key and/or a content delivery url.\n\n#### Content Delivery\n\nContent Delivery supports JSON only and can be used with any formatting option.\n\n```kotlin\n/** Thread safe: Retrieve the current singleton or create one. */\nval tolgee = Tolgee.instanceOrInit {\n    apiKey = \"\u003cAPI KEY\u003e\"\n    contentDelivery(\"\u003cContentDelivery URL\u003e\") {\n        format(Tolgee.Formatter.ICU) // default formatting\n        format(Tolgee.Formatter.Sprintf) // for sprintf or Java.format formatting\n    }\n}\n\n/** Updates the text automatically when loaded from API or locale changed. */\nval updatingText: Flow\u003cString\u003e = tolgee.translation(\"key\")\n\n/** Returns the text that's currently loaded from API. */\n/** Requires `tolgee.preload` or `tolgee.translation` call else always null. */\nval currentText: String? = tolgee.instant(\"key\")\n```\n\n## Compose\n\n###  Setup\n\nUsing Version Catalog is highly recommended to keep your versions aligned.\n\n```toml\n[libraries]\ntolgee = { group = \"dev.datlag.tolgee\", name = \"compose\", version.ref = \"tolgee\" }\n```\n\n### Usage\n\n```\n@Composable\nfun SimpleText() {\n    Text(text = stringResource(tolgee, Res.string.about))\n}\n\n@Composable\nfun ArgsSupported(vararg args: Any) {\n    Text(text = stringResource(tolgee, Res.string.about, *args))\n}\n```\n\n#### Jetpack Compose?\n\nWhat if you are using Jetpack Compose (Android only) or some explicit strings in your android source?  \nNo problem! This is handled as well.\n\n```kotlin\n@Composable\nfun AndroidOnly() {\n    Text(text = i18n.stringResource(R.string.android_string))\n}\n\n@Composable\nfun AndroidWithArgs(vararg args: Any) {\n    Text(text = i18n.stringResource(R.string.android_string, *args))\n}\n```\n\n## Support the project\n\n[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA)](https://github.com/sponsors/DATL4G)\n[![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge\u0026logo=paypal\u0026logoColor=white)](https://paypal.me/datlag)\n\n### This is a non-profit project!\n\nSponsoring to this project means sponsoring to all my projects!\nSo the further text is not to be attributed to this project, but to all my apps and libraries.\n\nSupporting this project helps to keep it up-to-date. You can donate if you want or contribute to the project as well.\nThis shows that the library is used by people, and it's worth to maintain.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolgee%2Fcompose-tolgee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftolgee%2Fcompose-tolgee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolgee%2Fcompose-tolgee/lists"}