{"id":20504468,"url":"https://github.com/tiknil/twine-flutter","last_synced_at":"2026-05-27T13:35:48.275Z","repository":{"id":57881307,"uuid":"528487774","full_name":"tiknil/twine-flutter","owner":"tiknil","description":"Twine plugin to support arb files","archived":false,"fork":false,"pushed_at":"2022-08-26T10:36:02.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T21:08:40.172Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiknil.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":"2022-08-24T15:39:51.000Z","updated_at":"2022-08-30T10:55:13.000Z","dependencies_parsed_at":"2023-01-16T21:16:00.328Z","dependency_job_id":null,"html_url":"https://github.com/tiknil/twine-flutter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Ftwine-flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Ftwine-flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Ftwine-flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiknil%2Ftwine-flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiknil","download_url":"https://codeload.github.com/tiknil/twine-flutter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242101944,"owners_count":20071977,"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-11-15T19:38:11.342Z","updated_at":"2026-05-27T13:35:43.251Z","avatar_url":"https://github.com/tiknil.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twine Flutter formatter plugin\nThis [twine](https://github.com/scelis/twine) plugin provide a formatter for `.arb` files, used by Flutter projects.\n\n## Features\n\n* Generation of arb files from twine\n* Consumation of localized arb files into twine\n* Support of arb comments\n* Basic support of arb placeholders\n\n## Generation of localizations\nTo generate a localizations `.arb` file use twine `generate-localization-file` command.\n\nExample:\n`twine generate-localization-file twine.txt app_en.arb`\n\n_Input twine file:_\n```\n[[Section A]]\n    [key1]\n        en = Text with comment for translators\n        comment = comment key1\n    [key2]\n        en = Simple text\n```\n\n_Output arb file:_\n```json\n{\n    \"@@locale\": \"en\",\n\n    \"key1\": \"Text with comment for translators\",\n    \"@key1\": {\n        \"description\": \"comment key1\"\n    },\n    \"key2\": \"Simple text\"\n}\n```\n\n## Consumation of localizations\nTo consume a twin localizations file to an `.arb` file use twine `consume-localization-file` command.\nIf you want to consume comments add `-c` option to the twine command.\n\nExample:\n`twine consume-localization-file twine.txt app_en.arb -c`\n\n_Input arb file:_\n```json\n{\n    \"@@locale\": \"en\",\n\n    \"key1\": \"Text with comment for translators\",\n    \"@key1\": {\n        \"description\": \"comment key1\"\n    },\n    \"key2\": \"Simple text\"\n}\n```\n\n_Output twine file:_\n```\n[[Uncategorized]]\n\t[key1]\n\t\ten = Text with comment for translators\n\t\tcomment = comment key1\n\t[key2]\n\t\ten = Simple text\n```\n\n**Warning!** The arb file doesn't contain any reference to sections so all the keys are added to the \"Uncategorized\" section, when the `-a` option of `consume-localization-file` is used.\n\n## Placeholders\nFlutter provides [extended support](https://localizely.com/flutter-arb/) to placeholders in the localization files.\n\nCurrently this plugin support a basic use of placeholders automatically creating an untyped placeholder for every string wrapped with curlty braces.\nAre only supported placeholders with lowercase chars, uppercase chars, digits, `.`, `_` and `-`.\n\nExample:\n\n_Input twine file:_\n```\n[[Section B]]\n    [key3]\n        en = Text with {name} placeholder\n    [key4]\n        en = Text with double placeholders {1} and {2} and a comment\n        comment = comment key4\n\n[[Section C]]\n    [key5]\n        en = Placeholders with punctuation: {p_1}, {p-1}, {p.1}\n```\n\n_Output arb file:_\n```json\n{\n    \"@@locale\": \"en\",\n\n    \"key3\": \"Text with {name} placeholder\",\n    \"@key3\": {\n        \"placeholders\": {\n            \"name\": {}\n        }\n    },\n    \"key4\": \"Text with double placeholders {1} and {2} and a comment\",\n    \"@key4\": {\n        \"description\": \"comment key4\",\n        \"placeholders\": {\n            \"1\": {},\n            \"2\": {}\n        }\n    },\n\n    \"key5\": \"Placeholders with punctuation: {p_1}, {p-1}, {p.1}\",\n    \"@key5\": {\n        \"placeholders\": {\n            \"p_1\": {},\n            \"p-1\": {},\n            \"p.1\": {}\n        }\n    }\n}\n```\n\n## Installation\nInstall this gem:\n\n```ruby\ngem install twine-flutter\n```\n\nThen setup twine to use this plugin as described [here](https://github.com/scelis/twine/blob/main/documentation/formatters.md#plugins) adding the following in a twine configuration file.\n\n```ruby\ngems: twine-flutter\n```\n\n## TODO\n\n* Automatic testing\n* Extended placeholder support","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiknil%2Ftwine-flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiknil%2Ftwine-flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiknil%2Ftwine-flutter/lists"}