Examples

Example of Starting a Translation

French will be used for the example:

   git pull
   cd webwml
   mkdir french
   cd french
   cp ../english/.wmlrc ../english/Make.* .
   echo 'include $(subst webwml/french,webwml/english,$(CURDIR))/Makefile' > Makefile
   mkdir po
   git add Make* .wmlrc
   cp Makefile po
   make -C po init-po
   git add po/Makefile po/*.fr.po

Edit the .wmlrc file and change:

Edit Make.lang and change 'LANGUAGE := en' to 'LANGUAGE := fr'. In case you are translating to a language which uses a multi-byte charset, you may have to change some other variables in that file, for more information read ../Makefile.common and perhaps other working examples (translations such as Chinese).

Go to french/po and translate entries in PO files. This should be quite straightforward.

Always make sure you copy the Makefile to each directory you translate. This is necessary because the program make is used to convert the .wml files into HTML, and make uses Makefiles.

When you are done adding and editing pages, do a

   git commit -m "Add your commit message here"
   git push
from the webwml directory. You can now start translating the pages.

Example of Translating a Page

A French translation of the social contract will be used for the example:

   cd webwml
   ./copypage.pl english/social_contract.wml
   cd french

This will automatically add the translation-check header, pointing to the version of the original file which was copied. It also creates the destination directory and Makefile, if missing.

Edit social_contract.wml and translate the text. Do not try to translate any links or change them in any way - if you want to change anything, request it on the debian-www list. When done, type

   git add social_contract.wml
   git commit -m "Translated social contract to french"
   git push

Example of Adding a New Directory

This example shows the French translation adding the intro/ directory:

   cd webwml/french
   mkdir intro
   cd intro
   cp ../Makefile .
   git add Makefile
   git commit -m "added the intro dir to git"
   git push
Make sure a new directory has the Makefile and that it's committed in git. Otherwise, running make will give an error to everyone else trying it.

Example of a Conflict

This example shows a commit that won't work because the copy in the repository has been modified since your last git pull.

You performed some changes to the file foo.wml. Then:

    git add foo.wml
    git commit -m "fixed a broken link"
    git push
 
will output:
To salsa.debian.org:webmaster-team/webwml.git
 ! [rejected]                master -> master (fetch first)
error: failed to push some refs to 'git@salsa.debian.org:webmaster-team/webwml.git'
 

or something like that :)

This means that your changes have not been pushed into the git repository due to conflicts.
You will need to examine what went wrong, solve the conflicts and try to commit/push again.