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

Commit 6262c8e

Browse files
committed
* Create Twig gettext translations parser.
* Update translations .POT file.
1 parent 11acbb2 commit 6262c8e

File tree

6 files changed

+921
-459
lines changed

6 files changed

+921
-459
lines changed

src/cache_templates.php

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
include($_SERVER['DOCUMENT_ROOT'] . '/autoload.php');
4+
5+
$themes = array('default', 'neverland');
6+
7+
foreach ($themes as $theme) {
8+
$templateDirectory = BASE_DIR . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $theme;
9+
10+
// define template engine options
11+
$options = array(
12+
'cache' => $templateDirectory . DIRECTORY_SEPARATOR . 'cache',
13+
'auto_reload' => true,
14+
);
15+
16+
// initialise templating engine
17+
$loader = new Twig_Loader_Filesystem($templateDirectory);
18+
$twig = new Twig_Environment($loader, $options);
19+
20+
// enable additional Twig extensions
21+
$twig->addExtension(new Twig_Extensions_Extension_I18n());
22+
$twig->addExtension(new Twig_Extensions_Extension_Text());
23+
24+
// iterate over all your templates
25+
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($templateDirectory), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
26+
// force compilation
27+
if ($file->isFile()) {
28+
$twig->loadTemplate(str_replace($templateDirectory . DIRECTORY_SEPARATOR, '', $file));
29+
}
30+
}
31+
}
32+
33+
?>

src/classes/specific/config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class Config {
2222
// define app constants
2323
public static $app = array('id' => 'commit-digest',
2424
'name' => 'KDE Commit-Digest',
25-
'version' => '1.30');
25+
'version' => '1.40');
2626

2727

2828
// define meta information

src/composer.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "dannya/commit-digest",
3+
"description": "",
4+
"minimum-stability": "stable",
5+
"license": "Affero GPL",
6+
"authors": [
7+
{
8+
"name": "Danny Allen",
9+
"email": "danny@commit-digest.org"
10+
}
11+
]
12+
}

src/css/frame/dataui.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/languages/commit-digest.mo

637 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)