DarkTranslationBundle
This Symfony2 bundle allows you to easily translate symfony documentation into other languages., (*1)
What's inside?
- Combined file manager
- Fancy double-editor with combined text-scroll
- Built-in symfony.com theme for docs
- Commands for generating and fetching docs
- File tracking feature
- Visual translation widget
Installation
Add DarkTranslationBundle to your composer.json:, (*2)
{
"require": {
"cursedcoder/dark-translation-bundle": "*"
}
}
Register bundle in your app/AppKernel.php
:, (*3)
<?php
public function registerBundles()
{
$bundles = array(
// ...
new Dark\TranslationBundle\DarkTranslationBundle(),
);
)
Add bundle to your routing.yml
:, (*4)
dark_translation_bundle:
resource: "@DarkTranslationBundle/Resources/config/routing.yml"
Set up an url for your fork and local path for docs that you would like to translate in config.yml
:, (*5)
# app/config.yml
dark_translation:
repositories:
# you should preset url for your fork here, example 'lang_tag: fork_url'
ru: 'https://github.com/cursedcoder/symfony-docs-ru'
source:
base_dir: %kernel.root_dir%/../docs
from: %kernel.root_dir%/../docs/symfony-docs
to: %kernel.root_dir%/../docs/symfony-docs-ru # change lang_tag here
build:
path: %kernel.root_dir%/../docs/build
You need to create an empty file named info.dat
to your base_dir
folder. This file will be used for tracking changes in your translations., (*6)
Then run command:, (*7)
php app/console dark-translation:fetch-docs en ru
replace ru
with your lang-tag., (*8)
And do not forget about assets:, (*9)
php app/console assets:install web/ --symlink
Documentation Building
Build all the html sources with sphinx in order to see how docs look like.
Be sure to have sphinx installed on your local machine. If not, run:, (*10)
easy_install -U sphinx
easy_install -U sphinxcontrib-phpdomain
Now you are ready to generate the html sources with:, (*11)
php app/console dark-translation:build-docs
Demo
You can see a production demo here., (*12)