-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# tal-i18n-extract | ||
|
||
[![Unittests](https://github.com/usox/tal-i18n-extract/actions/workflows/php.yml/badge.svg)](https://github.com/usox/tal-i18n-extract/actions/workflows/php.yml) | ||
|
||
Extract translation keys out of [PHPTAL](https://github.com/phptal/PHPTAL) templates. | ||
|
||
This is a php port of the [I18NFool](https://metacpan.org/dist/I18NFool) CPAN perl-package. | ||
|
||
## Usage | ||
|
||
```php | ||
./bin/tal-i18n-extract path-to-file(s).xhtml | ||
``` | ||
|
||
All found translation keys will be printed out POT-formatted. | ||
|
||
## Beware | ||
|
||
All templates must contain valid xml and have to define the i18n-namespace (see example). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<root xmlns:i18n="http://xml.zope.org/namespaces/i18n"> | ||
<div i18n:translate="">Some string</div> | ||
<div i18n:translate="">Some string with <span i18n:name="placeholder">what?!</span></div> | ||
<div i18n:translate="translation-key">Some string with pre-defined translation-key</div> | ||
<div title="Some title-attribute" i18n:attributes="title">...</div> | ||
<div title="Some title-attribute" i18n:attributes="title pre-defined-attribute-translation-key">...</div> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters