Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
* Create Twig gettext translations parser.
Browse files Browse the repository at this point in the history
* Update translations .POT file.
  • Loading branch information
dannya committed Sep 27, 2014
1 parent 11acbb2 commit 6262c8e
Show file tree
Hide file tree
Showing 6 changed files with 921 additions and 459 deletions.
33 changes: 33 additions & 0 deletions src/cache_templates.php
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));
}
}
}

?>
2 changes: 1 addition & 1 deletion src/classes/specific/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class Config {
// define app constants
public static $app = array('id' => 'commit-digest',
'name' => 'KDE Commit-Digest',
'version' => '1.30');
'version' => '1.40');


// define meta information
Expand Down
12 changes: 12 additions & 0 deletions src/composer.json
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"
}
]
}
2 changes: 1 addition & 1 deletion src/css/frame/dataui.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added src/languages/commit-digest.mo
Binary file not shown.
Loading

0 comments on commit 6262c8e

Please sign in to comment.