[publican-list] Fwd: Publican create_site and default langs

Ruediger Landmann r.landmann at redhat.com
Thu Aug 26 23:05:10 UTC 2010


  On 08/26/2010 05:56 PM, Gaël Chamoulaud wrote:
> Hi Everybody,
>
> I did exactly what you described and it sounds good about the localization.
>
> $ publican create_site --site_config foomaster.cfg --db_file foomaster.db
> --toc_path html/docs
>
> I created two Publican Article, one in fr-FR and another one in en-US:
>
> $ publican create --type Article --name Home_Page --lang en-US
> $ publican create --type Article --name Home_Page1 --lang fr-FR

You can only have one Home Page, which you can translate into as many 
languages as you need.

To illustrate:

================
1. Create the home page in your default language:

publican create --type Article --name Home_Page --lang fr-FR

2. Change into the the directory that holds the article you just created:

cd Home_Page

3. Write the content of your home page by editing the XML files in 
Home_Page/fr-FR/

4. Generate translation templates for the article:

publican update_pot

5. Generate an English translation for the article:

publican update_po --langs en-US

6. Translate the content of your home page into English by editing the 
PO files in Home_Page/en-US

7. Build the home page in both French and English:

publican build --publish --formats html-single --embedtoc --langs all

8. Publish both the French and English home pages on your site:

publican install_book --site_config /path/to/config/file/foomaster.cfg 
--lang fr-FR
publican install_book --site_config /path/to/config/file/foomaster.cfg 
--lang en-US

Where /path/to/config/file/foomaster.cfg is the path to the site config 
file, here named "foomaster.cfg".
================

The structure is now ready for you to publish books and articles to it. 
The tables of contents will be empty in both languages until you publish 
at least one book or article to the site. For example:

================
1. Change into the directory that holds the book:

cd Guide_de_configuration_Foomaster

2. Build the book:

publican build --formats html-single,html,pdf,epub --langs fr-FR 
--publish --embedtoc

3. Install the book on the site:

publican install_book --site_config /path/to/config/file/foomaster.cfg 
--lang fr-FR

Where /path/to/config/file/foomaster.cfg is the path to the site config 
file, here named "foomaster.cfg".
================

You should now see "Guide de configuration Foomaster" available on the 
French version of the menu, and available on the English version of the 
menu under an "untranslated" heading.

Hope this helps!

Cheers
Rudi














More information about the publican-list mailing list