Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robbestad/sarpotwigextractor
Module that traverses a given folder, extracts all strings within translate('') and stores every new string in the modules language files. Made for Zend Framework 2
https://github.com/robbestad/sarpotwigextractor
Last synced: 20 days ago
JSON representation
Module that traverses a given folder, extracts all strings within translate('') and stores every new string in the modules language files. Made for Zend Framework 2
- Host: GitHub
- URL: https://github.com/robbestad/sarpotwigextractor
- Owner: robbestad
- Created: 2014-05-05T07:47:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-06T08:45:20.000Z (over 10 years ago)
- Last Synced: 2024-04-13T17:11:01.352Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 148 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#PO Twig Extractor
_BETA!_###Assumptions (!important):
* This module is placed in your /module folder
* You use translate('Word to translate') in your .twig files
* You have at least one set of language files in your module/XXX/language folder
###TODO:
* (Untested) Putting the module in the /vendor folder (Why? So I can upload it on packagist and use it in my composer.json files)
* Creating a better procedure for launching the extractor
#About
I needed a way to extract all my translatable strings from my .twig files.
None of the existing methods worked for me, but this one does.Here's how you run it:
From the console, go to the root of your project:
execute _php Module.php XXX_ (where XXX is the name of your module, for instance Application)
######This is what it does:
It traverses your module/Application/view folder for .twig files and fetches
all the strings within translate('xxx'). It also traverses all your language files
in your module/Application/language folder and compiles a list of already translated
files.The strings that doesn't exist in your language files will be added. You can then open the
language file in Poedit, and you're ready to go.### License
Public domain
### Author
Sven Anders Robbestad, may 2014