{"id":27112395,"url":"https://github.com/nikeorever/phrase","last_synced_at":"2025-04-07T01:58:55.005Z","repository":{"id":57716045,"uuid":"302877138","full_name":"nikeorever/phrase","owner":"nikeorever","description":"[Implementation of Paraphrase]A Gradle plugin which generates compile-safe format string builders.","archived":false,"fork":false,"pushed_at":"2020-10-15T14:36:09.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2023-06-29T14:34:27.661Z","etag":null,"topics":["paraphrase"],"latest_commit_sha":null,"homepage":"","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/nikeorever.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":"2020-10-10T10:34:40.000Z","updated_at":"2021-02-28T14:40:51.000Z","dependencies_parsed_at":"2022-08-25T11:01:16.577Z","dependency_job_id":null,"html_url":"https://github.com/nikeorever/phrase","commit_stats":null,"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeorever%2Fphrase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeorever%2Fphrase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeorever%2Fphrase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikeorever%2Fphrase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikeorever","download_url":"https://codeload.github.com/nikeorever/phrase/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247578576,"owners_count":20961270,"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":["paraphrase"],"created_at":"2025-04-07T01:58:53.993Z","updated_at":"2025-04-07T01:58:54.993Z","avatar_url":"https://github.com/nikeorever.png","language":"Kotlin","readme":"Phrase\n===========\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/cn.nikeo.phrase/gradle-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/cn.nikeo.phrase/gradle-plugin)\n\nA Gradle plugin which generates compile-safe format string builders.\n\nThe reason why I created this library\n=====================================\nSince [Paraphrase](https://github.com/JakeWharton/paraphrase) has been in a state of **experimental**, \nand the project is too old, it seems difficult to maintain, so I created this library. \n\nThe goal of this library is consistent with [Paraphrase](https://github.com/JakeWharton/paraphrase)\n\nSample\n=====\n\n**Do** write your format strings like this (**Support Comment**):\n```xml\n\u003c!--This is a comment of greeting string--\u003e\n\u003cstring name=\"greeting\"\u003eHello, {other_name}! My name is {my_name}.\u003c/string\u003e\n```\n\nExecute gradle task 'generate{**variant**}PhraseClasses'\n```shell script\n./gradlew :{module}:generate{variant}PhraseClasses\n```\n\nAfter successful execution, Gradle Plugin will generate a Kotlin File named **Phrase.kt** for you\n```kotlin\n// Automatically generated file. DO NOT MODIFY\npackage cn.nikeo.reparaturapplication\n\nimport android.content.Context\nimport cn.nikeo.phrase.runtime.AbstractPhrase\nimport kotlin.CharSequence\nimport kotlin.Suppress\n\n@Suppress(\"ClassName\")\nclass Phrase_greeting(\n  context: Context\n) : BasePhrase(context = context, stringResId = R.string.greeting) {\n  fun my_name(value: CharSequence): Phrase_greeting {\n    put(\"my_name\", value)\n    return this\n  }\n\n  fun other_name(value: CharSequence): Phrase_greeting {\n    put(\"other_name\", value)\n    return this\n  }\n}\n\n/**\n * This is a comment of greeting string\n *\n * The string resource corresponding to [greeting] is in\n * /home/xianxueliang/AndroidStudioProjects/ReparaturApplication/app/src/main/res/values/strings.xml\n */\nfun greeting(context: Context): Phrase_greeting = Phrase_greeting(context)\n```\n\n**Do** enjoy formatting them like this:\n```kotlin\ntext.text = greeting(this)\n    .my_name(\"Jake Wharton\")\n    .other_name(\"GitHub user\")\n    .format()\n```\nOr\n```kotlin\ngreeting(this)\n    .my_name(\"Jake Wharton\")\n    .other_name(\"GitHub user\")\n    .into(text)\n```\n\nDownload\n--------\n\n#### Top-level build file\n```groovy\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n\n    dependencies {\n        classpath \"cn.nikeo.phrase:gradle-plugin:1.1.2\"\n    }\n}\n```\n\n#### App-module build file\n```groovy\napply plugin: 'com.android.application'\napply plugin: \"cn.nikeo.phrase\"\n```\n\n#### Library-module build file\n```groovy\napply plugin: 'com.android.library'\napply plugin: \"cn.nikeo.phrase\"\n```\nLicense\n-------\n\nApache License, Version 2.0, ([LICENSE](https://github.com/nikeorever/phrase/blob/trunk/LICENSE) or [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0))\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikeorever%2Fphrase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikeorever%2Fphrase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikeorever%2Fphrase/lists"}