Available Languages: | Deutsch | English | Français | 中文 (简) (Simplified Chinese) | |
This document is a work in progress.
Welcome to the Fink Website Internationalization Howto. This document is intended to offer guidelines for people who want to contribute to the i18n effort for the Fink website.
The Fink project has undertaken an effort to add full internationalization support to its website, in order to make the site more accessible worldwide. Thanks to Baba Yoshihiko, there is now a framework in which pages in multiple languages can be employed.
We currently have volunteers working on the following languages:
A chart of the organization of the i18n team is available here.
If you wish to help out with the internationalization effort, there are several things that you can do:
Be advised, however, if you are the first person to work on your language: there are quite a few documents that you will have to translate initially. Once this is done, there typically will be small changes made.
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.
To work on the documentation files as a member of a translation team, you need:
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:
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.
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.
export CVS_RSH=sshto your .profile.
setenv CVS_RSH sshto your .cshrc.
This will tell cvs to use ssh to gain access to the files. This is required.
cvs -z3By 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.
For now, you must check out the xml branch of the web site:
mkdir -p ~/Documents/Fink-i18n
cd ~/Documents/Fink-i18n
cvs -d:pserver:anonymous@fink.cvs.sourceforge.net:/cvsroot/fink login
cvs -d:pserver:anonymous@fink.cvs.sourceforge.net:/cvsroot/fink co xml
cvs -d:ext:yourusername@fink.cvs.sourceforge.net:/cvsroot/fink co xmlwhere 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.
There are two different file standards you will have to be concerned with as a translator:
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.
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.
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:
cd ~/Documents/Fink-i18n/xml
cvs -d:pserver:anonymous@fink.cvs.sourceforge.net:/cvsroot/fink update -dPfor team members without commit access, or
cvs update -dPfor 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.
The files to translate, in order of priority, are:
Title (English version file)
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):
cp x11.en.xml x11.fr.xml
<?xml version='1.0' encoding='utf-8' ?> ... <document filename="index" lang="fr" > ...
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.
Before your work gets uploaded onto the Fink website, you should check how the documents look.
sudo pico /etc/httpd/httpd.conf
#LoadModule php libexec/httpd/libphp4.soand remove the #
#AddModule mod_php4.cand remove the #
AddType application/x-httpd-php .phpand put a # in front of it.
http://127.0.0.1/~USERNAME/xml/web/index.phpwhere USERNAME should be replaced by your username.
Once you have been given commit access, you should
cat ~/.ssh/id_dsa.pub | pbcopyThis 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.
cd ~/Documents/Fink-i18n
cvs -d:ext:yourusername@fink.cvs.sourceforge.net:/cvsroot/fink co xmlwhere yourusername is of course your SourceForge username. Enter your passphrase where prompted.
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:
cd ~/Documents/Fink-i18n/xml/web
if you created your xml tree under Documents/Fink-i18n/ in your home folder, and you want to commit a PHP file from the xml/web directory.
cvs add download.ru.phpGive your SourceForge passphrase at the prompt.
If the file already exists, you can skip to the next step.
cvs ci -m "message" download.ru.phpwhere once again message should indicate what you've done. Give your SourceForge passphrase at the prompt.
Note: you can commit multiple files at once.
cd ~/Documents/Fink-i18n/xml/faqif you've been working on the FAQ.
make checkTo ensure that the file is valid.
cvs add faq.ru.xml MakefileYou'll need to give your SourceForge passphrase.
If the file already exists, you can skip to the next step.
cvs ci -m "message" faq.ru.xml Makefilewhere message is a descriptive message about what you've done. Enter your SourceForge passphrase at the prompt.
make && make install
cd ../scripts/installer/dmgand create the directory with:
mkdir -p fooThen return to the previous directory and rerun
make && make install
cd ~/Documents/Fink-i18n/xml
if you created your xml tree under Documents/Fink-i18n/ in your home folder.
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.htmlFor other documents, the files will of course be different--use whatever gets created for your language when you run make install.
If the file already exists, you can skip to the next step.
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.
Want to see your efforts from our website right now? Just do the following:
ssh username@shell.sourceforge.netYou'll need to give your SourceForge passphrase.
cd /home/groups/f/fi/fink/htdocs
./update.shImportant note: when you do this you will activate everything that's been placed in web/xml.
exit
open /
Since the English documentation is the baseline, it must be updated first. Such an update may come from a member of the i18n team (e.g. the English Documentarians) or directly from the core developers.
In order that things go smoothly, the following procedures should be followed:
If a new document is posted, or changes are made in the English documentation, a message should be posted to the fink-18n list informing all translators of the fact. The message will contain the following:
diff -Nru3 -rlast_revision rheadto show the modifications in context.
Note: since committing the XML file automatically produces a message on fink-commits that meets all of these criteria, an easy thing to do is to forward such a message and re-title the subject. However, this will fail if many changes were made.
The English version of the document is committed and activated, and it is translated as below.
Note: When the new document is inside a new directory, you shoould add that new directory to the Makefile located in the xml directory. Otherwise the built process will not complete successfully.
The language team leader (or someone else with CVS access) will commit and activate each document as it becomes ready.
This classification includes:
The base English documentation is committed and activated immediately--whomever changed the XML should commit the HTML and PHP, and do the activation. The translation teams then update their versions, commit all of the files (XML and PHP), then activate the changes.
Never change a dynamically generated php file; change the xml file instead.
Check that the cvsid line near the beginning of an xml file is not splitted.
Notes:
In this case, the English version of the XML file is committed, but not the PHP and HTML files, i.e. stop after step 5 under of Dynamic under 2.9. All translators do their work and commit only their XML file (i.e. the same as for English) within an agreed-upon timeframe. All of the PHP and HTML files will be generated, committed, and activated simultaneously at an agreed-upon time by one person, e.g. someone from the i18n core team.
The current policy is that all documents should be updated according to the prompt update schedule, unless you have a specific reason to do otherwise.
Internationalization is a complicated subject. The resources provided below can serve as a valuable second source of information. You are advised to read them carefully if you wish to delve deeper into this subject.
There are various editors you can use to edit files. This is a short list of recommended editors. Some editors are complicated to use or command line only and thus not suited for everybody. We will try to provide a list of editors suitable for about anyone.
The command line interface is not meant for everyone. The following list of useful tools are often graphical frontends to those command line tools. They are provided for your convenience.
When you are updating your CVS checkout, you may see some letters before the filenames. These represent the following conditions:
You can use
rm file; cvs update file
where file is the offending file, to resolve the conflict, and then apply the changes from the backup of your file that exists under.#file-version, where version is the revision that your file started from.
Copyright (c) 2001 Christoph Pfisterer, Copyright (c) 2001-2020 The Fink Project. You may distribute this document in print for private purposes, provided the document and this copyright notice remain complete and unmodified. Any commercial reproduction and any online publication requires the explicit consent of the author.
Generated from $Fink: multilingual.en.xml,v 1.23 2012/11/11 15:20:15 gecko2 Exp $