i18n - 2. The Documentation Files
The purpose of this chapter is to introduce you to the Fink documentation files, how to access them, and how to send changes to the Fink website and activate them.
2.1 Requirements
To work on the documentation files as a member of a translation team, you need:
- A CVS client to allow you to download the documentation from the Fink xml tree.
- A UTF-8 compatible text editor--a dedicated XML editor is a plus, since many of the files on the Fink website are generated from XML files.
- A checkout of the Fink xml tree, as per the instructions below.
- Working knowledge of Fink is also beneficial.
Note: "team member" is defined as someone who translates but is not ultimately responsible for uploading files to the Fink website.
Team leaders must meet the above requirements, but should also have:
- A SourceForge account (free registration).
- Commit access to the Fink documentation tree. To get this, send a message to the fink-18n mailing list, letting them know your SourceForge username. One of the i18n Core Team will make the arrangements for you to have CVS access to the documentation section.
Note: a "team leader" is here defined as a person who is responsible for actually uploading changed files to the Fink website and activating those changes.
2.2 Environment Settings
You will want to set up your environment to save you some typing later on. The ensuing discussion assumes that you are using the built-in command-line tools on Mac OS X or another Unix-like OS.
- Team leaders only: Modify your login files to add the CVS_RSH environment
variable.
- If you are using
bash
orzsh
add the following:export CVS_RSH=ssh
to your.profile
. - If you're using
tcsh
add the following:setenv CVS_RSH ssh
to your.cshrc
.This will tell
cvs
to use ssh to gain access to the files. This is required.
- If you are using
- All members: Create a file called .cvsrc in your home directory with the
following line in it:
cvs -z3
By doing this, CVS will use level 3 compression by default (it's a good thing!)
After these operations make sure to start a new terminal window to make sure your CVS_RSH environment is set.
2.3 Acquiring Files to Work on
For now, you must check out the xml branch of the web site:
- Open a terminal
- Create a directory somewhere to contain the Fink xml branch, e.g:
mkdir -p ~/Documents/Fink-i18n
- Move to that directory:
cd ~/Documents/Fink-i18n
- For non-leader team members (or leaders awaiting access):
Login to fink.cvs.sourceforge.net anonymously:
-
cvs -d:pserver:anonymous@fink.cvs.sourceforge.net:/cvsroot/fink login
- Push the enter key (no password, anonymous as default)
- Check out the xml module:
cvs -d:pserver:anonymous@fink.cvs.sourceforge.net:/cvsroot/fink co xml
- You don't have to do the login step above, but can go right
to
cvs -d:ext:yourusername@fink.cvs.sourceforge.net:/cvsroot/fink co xml
where yourusername is of course your SourceForge username. You may get a message about the DSA key of the server being unknown. Go ahead and answer yes. - In this case you should enter your SourceForge passphrase at the prompt.
-
2.4 File Standards
There are two different file standards you will have to be concerned with as a translator:
- Static (PHP only)
These are documents whose organization (e.g. item numbering) isn't expected to change much on a day-to-day basis. In this case the document just has a PHP file, which you will translate.
- Dynamic (XML generates PHP and HTML)
These documents (e.g. the FAQ) are updated and restructured more often, so they need the facility to be reorganized dynamically. Such documents use an XML file as the basis by which PHP and HTML files are generated, via a script. As a translator, your responsibility is to translate the XML file.
In addition, you will have to translate or modify a few other files, such as Makefile, nav.xx.inc, constants.xx.inc. Without them, the pages either will not appear on the web site or will not appear correctly.
All files are utf-8 encoded, consequently you should not change the encoding unless it is wrong (i.e. not utf-8), or use any html entities but those already in the English files.
2.5 Update to latest revision
Since other translators will change some files (don't be afraid about that, CVS can take good care of it) after you checked out the files, it is a good idea that you update your working copy to the latest revision frequently. For updating, you can:
- Move to the directory that contains the files you checked out,
e.g:
cd ~/Documents/Fink-i18n/xml
- Update it, e.g:
cvs -d:pserver:anonymous@fink.cvs.sourceforge.net:/cvsroot/fink update -dP
for team members without commit access, orcvs update -dP
for team leaders.
You may find a letter in front of one or more of the filenames when you do this. Consult the Appendix for more information, as well as the cvs man page.
2.6 Initial Translation
The files to translate, in order of priority, are:
Title (English version file)
- Constants files: (e.g.
xml/web/constants.*.inc
) (see below) - Static PHP files (e.g.
xml/web/*.en.php
) - Documentation navigation files (e.g.
xml/web/doc/nav.*.inc
) (same handling as constants.*.inc) - Document Index (
xml/doc/doc.en.xml
) - User's Guide (
xml/users-guide/uguide.en.xml
) - Advanced (
xml/advanced/advanced.en.xml
) - FAQ (
xml/faq.en.xml
) - Running X11 (
xml/x11/x11.en.xml
) - CVS Access (
xml/cvsaccess/cvs.en.xml
) - ReadMe (
xml/fink-readme/readme.en.xml
) - Internationalization (
xml/multilingual/multilingual.en.xml
) - ReadMe (
xml/fink-readme/readme.en.xml
) - Security (
xml/security/security.en.xml
) - Packaging Tutorial (
xml/quick-start-pkg/quick-start-pkg.en.xml
) - Packaging (
xml/packaging/packaging.en.xml
) - Porting (
xml/porting/porting.en.xml
) - News (
xml/news/news.xml
)
Be sure to check also the subdirectories in xml/web
for php, constants or navigation files to translate.
Do not translate or modify any php file in xml/web
and its subdirectories which contains "Generated from" near the beginning of the file. You will find the corresponding xml file to translate or modify in the xml
tree.
The constants.*.inc
files, as well as the nav.*.inc
files, are intended to deal
with hard coded items in the PHP include files. They are mostly menu
items and such, located on top and left of the pages. You should
separate them from the scripts and create a constants.xx.inc file for your language. To do this, just issue the following command in a terminal window:
cp constants.fr.inc constants.xx.inc
where xx is your language code (e.g.: de for German language). Next, you'll want to translate the single quoted part of the define lines into your language. In case you don't understand French, here is the translation into English:
Don't forget to change the locale, i.e. en_US to de_DE for German language.
/* The Sections. Used in Menu Navigation Bar */ define (FINK_LC_ALL, 'en_US'); /* The Sections. Used in Menu Navigation Bar */ define (FINK_SECTION_HOME, 'Home'); define (FINK_SECTION_DOWNLOAD, 'Download'); define (FINK_SECTION_PACKAGE, 'Packages'); define (FINK_SECTION_HELP, 'Help'); define (FINK_SECTION_FAQ, 'F.A.Q.'); define (FINK_SECTION_DOCUMENTATION, 'Documentation'); define (FINK_SECTION_MAILING_LISTS, 'Mailing Lists'); /* The Home Subsections. Used in Menu Navigation Bar */ define (FINK_SECTION_HOME_INDEX, 'Index'); define (FINK_SECTION_HOME_NEWS, 'News'); define (FINK_SECTION_HOME_ABOUT, 'About'); define (FINK_SECTION_HOME_CONTRIBUTORS, 'Contributors'); define (FINK_SECTION_HOME_LINKS, 'Links'); /* The word 'Sections'. Used in Menu Navigation Bar */ define (FINK_SECTIONS, 'Sections'); /* Used in FAQ/Documentation Sections: */ /* Contents as Table of contents, Next as next page */ /* Q as question, A as anwer */ define (FINK_CONTENTS, 'Contents'); define (FINK_NEXT, 'Next'); define (FINK_Q, 'Q'); define (FINK_A, 'A'); /* Printer */ define (FINK_PRINTER, 'Printer'); define (FINK_PRINT_VERSION, 'Print Version'); /* Footer */ define (META_KEYWORDS, 'Mac OS X, Fink, Debian, Macintosh, Apple, UNIX, Open Source, download, free software, port, development, package management'); define (META_DESCRIPTION, 'The Fink project wants to bring the full world of Unix Open Source software to Darwin and Mac OS X. We modify Unix software so that it compiles and runs on Mac OS X and make it available for download as a coherent distribution.'); define (HEADER_HOSTED_BY, 'Hosted by {img}'); define (FOOTER_AVAILABLE_LANGUAGES, 'Available Languages'); define (FOOTER_GENERATED_DYNAMICALLY, 'Generated dynamically from'); define (FOOTER_DATABASE_LAST_UPDATED, 'Last updated on %a, %d %B %Y, %R %Z'); define (FOOTER_LAST_CHANGED, 'Last changed by {author} on %a, %d %B %Y, %R %Z');
Note: the first lines of Footer section have been splitted for display purpose, do not split them in the file.
When you translate, you normally follow the steps as below (suppose you are translating the Running X11 document into French):
- Copy the xml file
cp x11.en.xml x11.fr.xml
- Edit the line to declare it is French and its encoding is UTF-8
<?xml version='1.0' encoding='utf-8' ?> ... <document filename="index" lang="fr" > ...
- Very important notice: Check that the cvsid line near the beginning of the file is not splitted.
- Save as UTF-8. Be aware that the encoding must be utf-8 and take care not to change anything but true text.
- Once you are done, or just to test it, edit the
Makefile
to include your language as:LANGUAGES_AVAILABLE = en ja fr
then type
make
in the directory. This should generate your PHP (and possibly some other) files as well as other files matching the languages in the Makefile.
Note: If you see some misspelling or errors in the English file, don't change it, but instead report it instead to the fink-i18n list, so that the master English file is changed.
2.7 Check Your Work
Before your work gets uploaded onto the Fink website, you should check how the documents look.
- The easy way: Open the HTML and PHP files in your web browser. PHP files won't look exactly like you see them on the website, however.
- The best way: You can use your built in web server to view
your documents as they will appear as it will on Fink's website.
Assuming that you are using the built-in server:
- Edit
/etc/httpd/httpd.conf
, e.g. via:sudo pico /etc/httpd/httpd.conf
- Look for a line that says:
#LoadModule php libexec/httpd/libphp4.so
and remove the # - Look for a line that says:
#AddModule mod_php4.c
and remove the # - If you are running a version of Apache older than the built-in
one for Panther then you may also have to look for a line that
looks like
AddType application/x-httpd-php .php
and put a # in front of it. - Save the file and exit your editor.
- Start Personal Web Sharing in System Preferences--if it's already running then turn it off and back on again.
- The easiest way to make everything visible is to move your
checkout of the
xml
Tree into theSites
folder in your Home folder. You can then open the homepage in your web browser at the following URL:http://127.0.0.1/~USERNAME/xml/web/index.php
whereUSERNAME
should be replaced by your username.
- Edit
2.8 When You Get Commit Access (Team Leaders)
Once you have been given commit access, you should
- Set up an SSH key for your SourceForge account.
- Set the key up on your machine following the instructions from SourceForge.
- Type in the terminal:
cat ~/.ssh/id_dsa.pub | pbcopy
This will copy the contents of the file directly to your pasteboard, to avoid spurious linebreaks. Make sure not to copy anything else to the pasteboard until you're done. - Log in to your account on SourceForge.
- Select "Account Options"
- Go to the "Host Access Information" area, and click on "Edit SSH Keys for Shell/CVS"
- Click on the form and use Cmd-A, Cmd-V
- Click the button.
- Check out the
xml
tree using your username.- If you checked out the whole
xml
tree initially, then you should rename your local copy. You can use the Finder for this. - Move to that directory in a terminal window:
cd ~/Documents/Fink-i18n
- Do the checkout of the xml tree:
cvs -d:ext:yourusername@fink.cvs.sourceforge.net:/cvsroot/fink co xml
where yourusername is of course your SourceForge username. Enter your passphrase where prompted. - Copy the files that you were working on from your old tree to the new one. Feel free to use the Finder, making sure that they go in the same subfolder as they were initially.
- If you checked out the whole
2.9 Committing the Changes (Team Leaders)
Now you need to send your changes to the main server. To do this you
need to make sure that you have commit access. You also should make sure
that you are always using the latest version of XSLT in unstable tree,
which is libxslt-1.1.4-1
from Fink as the time of
writing this document.
The procedure is different according to the nature - static or dynamic - of the documents:
- Static: (PHP files only) To commit these documents do the
following:
- Open a terminal.
- Move to the directory that contains the file you want to check
in, e.g:
cd ~/Documents/Fink-i18n/xml/web
if you created your
xml
tree underDocuments/Fink-i18n/
in your home folder, and you want to commit a PHP file from the xml/web directory. - If the file is a new one that you've created, then you need to
add it to the list of files, e,g.:
cvs add download.ru.php
Give your SourceForge passphrase at the prompt.If the file already exists, you can skip to the next step.
- Commit the file, e.g. in the prior example:
cvs ci -m "message" download.ru.php
where once again message should indicate what you've done. Give your SourceForge passphrase at the prompt.Note: you can commit multiple files at once.
- Dynamic: (XML and PHP) After you've modified the XML
file, do the following:
- Open a terminal
- Move to the directory that contains the file you've added or
modified, e.g.
cd ~/Documents/Fink-i18n/xml/faq
if you've been working on the FAQ. - Now run
make check
To ensure that the file is valid. - If the XML file is a new one that you've created, then you
need to add the XML file and its Makefile (assuming, of course,
that you edited it to create the files for your language) to the
list of files, e,g.:
cvs add faq.ru.xml Makefile
You'll need to give your SourceForge passphrase.If the file already exists, you can skip to the next step.
- Commit the files, e.g.:
cvs ci -m "message" faq.ru.xml Makefile
where message is a descriptive message about what you've done. Enter your SourceForge passphrase at the prompt. - Now run
make && make install
- If you get an error message telling you that a directory
foo
is missing underxml/scripts/installer/dmg
, then move to it with:cd ../scripts/installer/dmg
and create the directory with:mkdir -p foo
Then return to the previous directory and rerunmake && make install
- Move into your copy of the Fink xml tree, e.g:
cd ~/Documents/Fink-i18n/xml
if you created your
xml
tree underDocuments/Fink-i18n/
in your home folder. - If the XML file was new, you'll need to do some more CVS
adding. For example, if you have been working on the FAQ, then,
you'll want to run (e.g.):
cvs add web/faq/index.en.php web/faq/general.ru.php \ web/faq/relations.ru.php web/faq/usage-fink.ru.php \ web/comp-general.ru.php web/faq/comp-packages.ru.php \ web/faq/usage-general.ru.php web/faq/usage-packages.ru.php \ web/faq/upgrade-fink.ru.php web/faq/mirrors.ru.php \ web/faq/faq.ru.html web/faq/header.ru.inc \ scripts/installer/dmg/faq.ru.html
For other documents, the files will of course be different--use whatever gets created for your language when you runmake install
. - Don't forget to add and commit any file you've created (be it constants.xx.inc, header.xx.inc, nav.xx.inc, etc.)
If the file already exists, you can skip to the next step.
- Commit the whole tree:
cvs ci -m "message"
Where once again message is a descriptive log message (you may want to use the same one as when you committed the XML file). Enter your SourceForge passphrase at the prompt.
The reason that you have to do two commits in this case is that it's required to ensure that the files show the correct creation time and person who last modified them.
2.10 Update our website
Want to see your efforts from our website right now? Just do the following:
- Open a terminal
- log in web server via ssh:
ssh username@shell.sourceforge.net
You'll need to give your SourceForge passphrase. - Move to the directory which contains our web pages:
cd /home/groups/f/fi/fink/htdocs
- update the website from CVS:
./update.sh
Important note: when you do this you will activate everything that's been placed inweb/xml
. - log out from web server:
exit
- See your efforts:
open /