This repository has been archived by the owner on Sep 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create Twig gettext translations parser.
* Update translations .POT file.
- Loading branch information
Showing
6 changed files
with
921 additions
and
459 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,33 @@ | ||
<?php | ||
|
||
include($_SERVER['DOCUMENT_ROOT'] . '/autoload.php'); | ||
|
||
$themes = array('default', 'neverland'); | ||
|
||
foreach ($themes as $theme) { | ||
$templateDirectory = BASE_DIR . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $theme; | ||
|
||
// define template engine options | ||
$options = array( | ||
'cache' => $templateDirectory . DIRECTORY_SEPARATOR . 'cache', | ||
'auto_reload' => true, | ||
); | ||
|
||
// initialise templating engine | ||
$loader = new Twig_Loader_Filesystem($templateDirectory); | ||
$twig = new Twig_Environment($loader, $options); | ||
|
||
// enable additional Twig extensions | ||
$twig->addExtension(new Twig_Extensions_Extension_I18n()); | ||
$twig->addExtension(new Twig_Extensions_Extension_Text()); | ||
|
||
// iterate over all your templates | ||
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($templateDirectory), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { | ||
// force compilation | ||
if ($file->isFile()) { | ||
$twig->loadTemplate(str_replace($templateDirectory . DIRECTORY_SEPARATOR, '', $file)); | ||
} | ||
} | ||
} | ||
|
||
?> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "dannya/commit-digest", | ||
"description": "", | ||
"minimum-stability": "stable", | ||
"license": "Affero GPL", | ||
"authors": [ | ||
{ | ||
"name": "Danny Allen", | ||
"email": "danny@commit-digest.org" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.