Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/unCamelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
triplejumper12 committed Sep 25, 2012
2 parents 448ac60 + f904575 commit de9338d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@
},
"autoload": {
"psr-0": { "Twig_Extensions_": "lib/" }
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"minimum-stability": "dev"
}
15 changes: 11 additions & 4 deletions doc/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ templates. Here is a simple example to get you started::
// iterate over all your templates
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($tplDir), RecursiveIteratorIterator::LEAVES_ONLY) as $file)
{
// force compilation
$twig->loadTemplate(str_replace($tplDir.'/', '', $file));
// force compilation
if ($file->isFile()) {
$twig->loadTemplate(str_replace($tplDir.'/', '', $file));
}
}

Use the standard ``xgettext`` utility as you would have done with plain PHP
Expand All @@ -152,5 +154,10 @@ code:
xgettext --default-domain=messages -p ./locale --from-code=UTF-8 -n --omit-header -L PHP /tmp/cache/*.php
.. _`gettext`: http://www.php.net/gettext
.. _`documentation`: http://fr.php.net/manual/en/function.gettext.php
Another workaround is to use `Twig Gettext Extractor`_ and extract the template
strings right from `Poedit`_.

.. _`gettext`: http://www.php.net/gettext
.. _`documentation`: http://fr.php.net/manual/en/function.gettext.php
.. _`Twig Gettext Extractor`: https://github.com/umpirsky/Twig-Gettext-Extractor
.. _`Poedit`: http://www.poedit.net/

0 comments on commit de9338d

Please sign in to comment.