{"id":15663030,"url":"https://github.com/yonaskolb/stringly","last_synced_at":"2025-05-06T02:34:24.860Z","repository":{"id":53003794,"uuid":"215710657","full_name":"yonaskolb/Stringly","owner":"yonaskolb","description":"Manage and generate localization files","archived":false,"fork":false,"pushed_at":"2021-10-26T15:08:19.000Z","size":89,"stargazers_count":18,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T04:49:55.472Z","etag":null,"topics":["cli","generator","localization","strings"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/yonaskolb.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}},"created_at":"2019-10-17T05:33:29.000Z","updated_at":"2023-12-06T07:17:59.000Z","dependencies_parsed_at":"2022-09-08T03:22:10.937Z","dependency_job_id":null,"html_url":"https://github.com/yonaskolb/Stringly","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonaskolb%2FStringly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonaskolb%2FStringly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonaskolb%2FStringly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonaskolb%2FStringly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yonaskolb","download_url":"https://codeload.github.com/yonaskolb/Stringly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234588057,"owners_count":18856856,"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":["cli","generator","localization","strings"],"created_at":"2024-10-03T13:35:16.388Z","updated_at":"2025-01-19T01:57:17.452Z","avatar_url":"https://github.com/yonaskolb.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stringly\n\nStringly generates type safe localization files from a source `yaml`,`json`, or `toml` file. At the moment only outputs for Apple platforms are supported, but a generator for Android's R.strings is easy to add\n\n- ✅ **Multi-language** support\n- ✅ **Named placeholders**\n- ✅ **Plural** support\n- ✅ Compile safe **Swift** accessors\n\n## Usage\n\nSee help\n```\nstringly help\n```\nTo generate all files in all languages\n```\nstringly generate Strings.yml\n```\nTo generate a single file in a certain langage\n```\nstringly generate-file Strings.yml Strings.strings --language de\n```\n\n## Installing\n\nMake sure Xcode 13 is installed first.\n\n### [Mint](https://github.com/yonaskolb/mint)\n```sh\nmint install yonaskolb/stringly\n```\n\n### Swift Package Manager\n\n**Use as CLI**\n\n```shell\ngit clone https://github.com/yonaskolb/Stringly.git\ncd Stringly\nswift run stringly\n```\n\n**Use as dependency**\n\nAdd the following to your Package.swift file's dependencies:\n\n```swift\n.package(url: \"https://github.com/yonaskolb/Stringly.git\", from: \"0.7.0\"),\n```\n\nAnd then import wherever needed: `import StringlyKit`\n\n## Example\n\nGiven a source `Strings.yml`:\n```yml\nauth: # grouping of strings\n  loginButton: Log In # If you don't specify a language it defaults to a base language\n  emailTitle:\n    en: Email # specifying a language\n  passwordTitle: \n    en: Password\n    de: Passwort # multiple languages\n  error: # infinitely nested groups\n    wrongEmailPassword: Incorrect email/password combination\nhome:\n  title: Hello {name} # this is a placeholder. Without a type defaults to %@ on apple platforms\n  postCount: \"Total posts: {postCount:d}\" # the placeholder now has a type %d\n  day: \"Day: {}\" # an unnamed placeholder\n  escaped: Text with escaped \\{braces} # escape braces in text by using \\{\n  articles: # this is a pluralized string\n    en: You have {articleCount:d} # placeholder will be replaced with pluralization\n    en.articleCount: # supports pluralizing multiple placeholders in a single string\n      none: no articles\n      one: one article\n      other: {articleCount:d} articles\n```\n\nThis generates `.swift`, `.strings`, and `.stringsdict` files for multiple languages.\n\nThe Swift file then allows usage like this:\n```swift\nerrorLabel.text = Strings.auth.error.wrongEmailPassword\nwelcomeLabel.text = Strings.home.title(name: \"John\")\npostsLabel.text = Strings.home.postCount(postCount: 10)\nday.text = Strings.home.day(\"Monday\")\narticleLabel.text = Strings.home.articles(articleCount: 4)\n```\n\n## Future Directions\n- Comments and other data for keys\n- Generate files for other platforms like Android `R.string` file or translation specific files\n- Importing of translation files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonaskolb%2Fstringly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyonaskolb%2Fstringly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonaskolb%2Fstringly/lists"}