{"id":36294876,"url":"https://github.com/smarty-gettext/tsmarty2c","last_synced_at":"2026-01-11T10:03:31.540Z","repository":{"id":20818357,"uuid":"91001647","full_name":"smarty-gettext/tsmarty2c","owner":"smarty-gettext","description":"Smarty Gettext Translation String Ripper","archived":false,"fork":false,"pushed_at":"2021-12-24T11:58:17.000Z","size":69,"stargazers_count":3,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-18T22:50:36.198Z","etag":null,"topics":["gettext","smarty","tsmarty2c","xgettext"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/smarty-gettext.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":"2017-05-11T16:38:33.000Z","updated_at":"2024-03-09T08:07:40.000Z","dependencies_parsed_at":"2022-08-26T21:40:08.007Z","dependency_job_id":null,"html_url":"https://github.com/smarty-gettext/tsmarty2c","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/smarty-gettext/tsmarty2c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarty-gettext%2Ftsmarty2c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarty-gettext%2Ftsmarty2c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarty-gettext%2Ftsmarty2c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarty-gettext%2Ftsmarty2c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smarty-gettext","download_url":"https://codeload.github.com/smarty-gettext/tsmarty2c/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarty-gettext%2Ftsmarty2c/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28299709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T08:21:30.231Z","status":"ssl_error","status_checked_at":"2026-01-11T08:21:26.882Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gettext","smarty","tsmarty2c","xgettext"],"created_at":"2026-01-11T10:03:30.728Z","updated_at":"2026-01-11T10:03:31.535Z","avatar_url":"https://github.com/smarty-gettext.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tsmarty2c.php - the command line utility\n\n`tsmarty2c.php` - A command line utility that rips gettext strings from smarty source files and converts them to `.pot` (PO-Template).\n\nThis utility will scan templates for `{t}...{/t}` placeholders for translation strings\nand output a `.pot` file (`.po` template).\n\nUsage:\n\n    ./vendor/bin/tsmarty2c.php -o template.pot \u003cfilename or directory\u003e \u003cfile2\u003e \u003c...\u003e\n\nIf a parameter is a directory, the template files within will\nbe parsed, recursively.\n\nIn output special PO tags are added that inform about location of extracted translation. Most of the PO edit tools can respect that information.\n\nIf you wish to scan also `.php` or `.phtml` files for native gettext calls, you may wish to combine result of `tsmarty2c` and `xgettext` calls:\n\n```\n./vendor/bin/tsmarty2c.php -o smarty.pot ...\nxgettext --add-comments=TRANSLATORS: --keyword=gettext --keyword=_  --output=code.pot ...\nmsgcat -o template.pot code.pot smarty.pot\nrm -f code.pot smarty.pot\n```\n\nBy default `tsmarty2c` scans for `.tpl` files, if you wish to use other files, you can use `xargs` in unix:\n\n```\nfind templates -name '*.tpl.html' -o -name '*.tpl.text' -o -name '*.tpl.js' -o -name '*.tpl.xml' | xargs tsmarty2c.php -o smarty.pot\n```\n\nSee how it's done in [Eventum](https://github.com/eventum/eventum/blob/master/localization/Makefile) project.\n\n## Installing\n\n1. as package depdencency:\n\n       composer require --dev smarty-gettext/tsmarty2c\n       ./vendor/bin/tsmarty2c.php\n\n2. directly from this repository\n\n       git clone https://github.com/smarty-gettext/tsmarty2c\n       cd tsmarty2c\n       composer install --no-dev\n       ./bin/tsmarty2c.php\n\n## Developing\n\n1. clone this repository\n2. [get composer](https://getcomposer.org/download/)\n3. install composer dependencies: `php composer.phar install`\n4. start using it: `php bin/tsmarty2c.php`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarty-gettext%2Ftsmarty2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarty-gettext%2Ftsmarty2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarty-gettext%2Ftsmarty2c/lists"}