{"id":15029608,"url":"https://github.com/square/phrase","last_synced_at":"2025-04-14T20:53:04.875Z","repository":{"id":13435043,"uuid":"16124098","full_name":"square/phrase","owner":"square","description":"Phrase is an Android string resource templating library","archived":false,"fork":false,"pushed_at":"2023-03-18T23:29:21.000Z","size":165,"stargazers_count":1404,"open_issues_count":6,"forks_count":126,"subscribers_count":44,"default_branch":"master","last_synced_at":"2024-10-29T17:55:10.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/square.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-01-22T00:51:50.000Z","updated_at":"2024-09-06T08:12:24.000Z","dependencies_parsed_at":"2022-07-19T05:32:04.221Z","dependency_job_id":"5844ed3f-3a07-493e-b183-e31d56717d34","html_url":"https://github.com/square/phrase","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fphrase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fphrase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fphrase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fphrase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/square","download_url":"https://codeload.github.com/square/phrase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961034,"owners_count":21189990,"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-09-24T20:11:11.332Z","updated_at":"2025-04-14T20:53:04.855Z","avatar_url":"https://github.com/square.png","language":"Java","funding_links":[],"categories":["Libs","工具库","Utility"],"sub_categories":["\u003cA NAME=\"Utility\"\u003e\u003c/A\u003eUtility"],"readme":"Phrase - Android string formatting\n==================================\n\n[![license](http://img.shields.io/badge/license-apache_2.0-red.svg?style=flat)](https://raw.githubusercontent.com/square/phrase/master/LICENSE.txt) [![maven](https://img.shields.io/maven-central/v/com.squareup.phrase/phrase.svg)](http://maven-repository.com/artifact/com.squareup.phrase) [![build](https://img.shields.io/travis/square/phrase.svg?style=flat)](https://travis-ci.org/square/phrase)\n\n```java\nCharSequence formatted = Phrase.from(\"Hi {first_name}, you are {age} years old.\")\n  .put(\"first_name\", firstName)\n  .put(\"age\", age)\n  .format();\n```\n\nSend your phrase straight into a TextView:\n\n```java\nPhrase.from(\"Welcome back {user}.\")\n  .put(\"user\", name)\n  .into(textView);\n```\n\nComma-separated lists:\n```\nCharSequence formattedList = ListPhrase.from(\", \")\n  .join(1, 2, 3);\n// returns \"1, 2, 3\"\n```\n\nEnglish sentence-style lists:\n```\nListPhrase listFormatter = ListPhrase.from(\n  \" and \",\n  \", \",\n  \", and \");\n\nlistFormatter.join(Arrays.asList(1, 2));\n// returns \"1 and 2\"\n\nlistFormatter.join(Arrays.asList(1, 2, 3));\n// returns \"1, 2, and 3\"\n```\n\nDownload\n--------\n\nYou can download [the latest jar here][jar].\n\nYou can also depend on the .jar through Maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.squareup.phrase\u003c/groupId\u003e\n  \u003cartifactId\u003ephrase\u003c/artifactId\u003e\n  \u003cversion\u003e(insert latest version)\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nor through Gradle:\n\n```groovy\ndependencies {\n  compile 'com.squareup.phrase:phrase:(insert latest version)'\n}\n```\n\nLicense\n-------\n\n    Copyright 2013 Square, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n[jar]: http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy\u0026g=com.squareup.phrase\u0026a=phrase\u0026v=LATEST\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2Fphrase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquare%2Fphrase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2Fphrase/lists"}