UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 
(KHTML, like Gecko) Safari/312
IP: 65.37.49.4
URI: http://wesnoth.slack.it/?WescampInstructions
 - - - - -
||Introduction||

Once you have written a campaign and made sure it is translation-friendly (by 
adding underscores and the appropriate textdomain commands, which are
described on the previous page), the Wesnoth translation team will shoulder the 
technical burden of adding translations to your campaign.  The goal is to
not require a tremendous amount of technical knowledge from user campaign 
writers.  However, some familiarity with the terminal and command line is
required.  This guide was written by a Mac OS X user, so hopefully it will be 
explicit enough for anybody.

In a user campaign, the scenario cfg files, some custom units, 
//campaignname//.cfg, and some macros contain translatable text.  You will be 
shown how
to send those files to the wescamp project on www.berlios.de and how to 
download the completed translation files.

||Preliminary Steps||

1. You must register yourself at http://www.berlios.de which is like a German 
version of Sourceforge.  Remember your password because you're going to
need it later.

2. Send torangan your www.berlios.de username so he can add you to the project 
(so you can have write access to the project).  Chances are you will have
already been contacted by him if you are reading this, or else go to the BFW 
forum and send a private message to torangan.

3. Once you are added to the project, your campaign files will be added to the 
project.  Torangan will download the latest version of your campaign from
the campaign server and add the files.  You can see the project here: 
http://developer.berlios.de/projects/wescamp-i18n/ .  You can browse through all
the wescamp files from that page or by clicking this link: 
http://svn.berlios.de/viewcvs/wescamp-i18n/ .

||Installing Subversion||

If you are familiar with the terminal, then this part won't be so bad.  
Subversion, also known as SVN, is a program that manages multi-user file 
directories
(like this project).  It's just like CVS with more features (if you know what 
CVS is).  You will have to install it.  I have no knowledge of how SVN for 
Windows
works, but from what I can tell SVN appears to work well on Windows, and you 
can even get a GUI version.

SVN can be downloaded from here: 
http://subversion.tigris.org/project_packages.html .  Scroll down and find your 
OS.  For Mac users, I recommend
getting the binary package that does not require Fink, because that's what I 
used and it worked.  Get the package and install it, according to the
instructions that come with the download.

After installation, you can test out SVN by opening the Terminal and typing 
'svn'.  You should get a friendly message about typing 'svn help'.  There's no
application icon or anything - it's just a new command for your command line.

||Basic Terminal Help||

We're coming to the part where the Terminal knowledge is required.  This 
section is for Terminal newbies.  Others can skip down.  You might want to
backup your
campaign at this point.

 - For the very new: the Terminal is located in /Applications/Utilities (for 
Mac OS X)
 - Type in 'pwd' to see your current directory.
 - Type in 'ls' to list the contents of the current directory.
 - Type in 'cd //directory//' to change to that directory (which must be a 
subdirectory of your current directory.
 - For example, if you are currently in your home directory, typing 'cd 
Preferences' will change to the Preferences subdirectory.
 - The slash / character is the root (or top) level directory on your computer. 
 Typing 'cd /' brings you to the top level.
 - The tilde ~ character is a shortcut for your home folder.
 - For example, 'cd ~/Library' will send you to your home directory's Library 
subdirectory.
 - Another way of saying this is that if my home folder is called //scott//, 
then ~ = /Users/scott/

||Your Campaign - Initial Setup||

My instructions from NOW ON will use the Liberty campaign as an example and Mac 
OS X file locations to describe exactly how I use svn.  There could
be better ways to do it, but my way makes sense to me.  Your way will, of 
course, have to make sense to you.

User campaigns are stored in ~/Library/Preferences/Wesnoth/data/campaigns.  I 
have the file Liberty.cfg and the Liberty folder there.  I decided to keep
the SVN files in a separate folder.  The reason for this is that SVN uses 
invisible metafiles inside the folders and when I upload the campaign to the
campaign server, I don't want to upload those files.

Download the initial copy of the SVN archive by typing the following in the 
terminal:
 cd ~/Library/Preferences/Wesnoth/data/campaigns
 svn checkout svn+ssh://svn.berlios.de/svnroot/repos/wescamp-i18n/Liberty-po
It will ask for your berlios.de password one or more times (it asks me 3 times).

This creates a local copy of the wescamp directory.  Your data/campaigns 
directory should now have the following:
 Liberty.cfg
 Liberty (a folder)
 Liberty-po (a folder)

||Updating Wescamp||

When I make changes to Liberty, I only work with my local copy just like I did 
before.  When I'm done, I need to copy the changed files over to the
Liberty-po directory and then send those changes to berlios.de.

Here is a shell script you can use to automate the process.  Copy this text 
into a text editor and call it something simple like 'commit' (save it in the 
data/
campaigns directory):
 #!/bin/csh -f

 set libpath = '~/Library/Preferences/Wesnoth/data/campaigns/Liberty'
 set wescamp = '~/Library/Preferences/Wesnoth/data/campaigns/Liberty-po'

 echo copying campaign text files into local repository...
 cp -f $libpath/scenarios/*.cfg $wescamp/Liberty/scenarios/
 cp -f $libpath/units/*.cfg $wescamp/Liberty/units/
 cp -f ~/Library/Preferences/Wesnoth/data/campaigns/Liberty.cfg $wescamp

 echo committing scenario and unit files to project...
 cd $wescamp
 svn commit -m "scenario update" $wescamp/Liberty/scenarios
 svn commit -m "units update" $wescamp/Liberty/units
 svn commit -m "campaign config update" $wescamp/Liberty.cfg

 echo finished.
Then all you have to do is type the following:
 cd ~/Library/Preferences/Wesnoth/data/campaigns
 ./commit
which will run the following commands as a shell script (or batch file, if that 
helps).  You can also type in each command individually (don't type in the #!/
bin... command or echo commands).  You will need to type in your berlios.de 
password one or more times (it asks me 3 times).

||Updating your Translations||

A similar process is used to download updated translations and move the files 
over to your campaign folder.  Here is a shell script to do the job.  Call it
something simple, like 'get' and save it in the /data/campaigns directory.
 #!/bin/csh -f

 set libpath = '~/Library/Preferences/Wesnoth/data/campaigns/Liberty'
 set wescamp = '~/Library/Preferences/Wesnoth/data/campaigns/Liberty-po'

 echo checking out latest translation...
 cd $wescamp
 svn checkout 
svn+ssh://svn.berlios.de/svnroot/repos/wescamp-i18n/Liberty-po/Liberty/translations

 echo copying translation files into campaign folder...
 cp -Rf $wescamp/Liberty/translations/* $libpath/translations/

 echo finished.

You will again be asked for your berlios.de password one or more times (3 for 
me).  Technically you don't need to send the secure version of the command
(there's an anonymous checkout command you could use), but this will make sure 
you have write access for the whole tree and is more consistent with
everything else you have been doing.

||Summary||

This page showed you how to set up a wescamp/SVN repository on your local 
computer.  A method was presented for pulling translations down from
wescamp and sending your updated text files to wescamp.  Other methods exist 
that use your campaign folder as the local SVN repository, but this is how I
do it.

Here are some final notes.

1. Once you send your updated cfg files to wescamp, contact the translation 
team via torangan.  They may get automatic commit notifications from
www.berlios.de, but you will ensure they don't miss your campaign.

2. After you commit the updated cfg files, DO NOT CHANGE A SINGLE CHARACTER of 
your text strings.  Doing so invalidates the translation for that string.
I change the date and version number for each release, but this must be done 
BEFORE commiting the cfg text files.  You should publish immediately after
getting the new translation.

3. In my example, the only files with translatable text were in the ./scenarios 
directory, the ./units directory, and Liberty.cfg itself.  YOUR campaign,
especially if you use the template by Invisible Philosopher, may have other 
files that contain translatable text like a utils.cfg or deaths.cfg file.  You 
should
adapt the process to commit ALL files that contain translatable text.

||See Also||

* WesCamp




_______________________________________________
Wesnoth-wiki-changes mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/wesnoth-wiki-changes

Reply via email to