MapLocalization

From The Battle for Wesnoth Wiki
Revision as of 18:51, 13 July 2013 by Stikonas (talk | contribs) (Localization: Add a note that script fails to work if golden pixels a absent.)

This page is a work in progress

Like the old maps, the new-style maps can be localized, but the intended method for doing so is quite different.

Overview

However, the workflow for localizing a map is simple: you create an image which contains the localized labels on a transparent background as simple text, no post-processing effects needed. In GIMP, you then add that image to a corresponding .xcf file as a new layer, and run a script. The script creates an overlay image which covers up the english labels, adds your localized labels and applies a bunch of post-processing effects to them in order to make them look identical to the english labels. All you need to do is to check the output and save.

Step-by-step instructions

Preparations

1. If you don't have GIMP, install it.

2. Download the wesnoth-map-localization.scm script and place it into a script directory recognized by GIMP. You can view and configure the script directories in GIMP's preferences (Preferences -> Folders -> Scripts). If you already have GIMP running, you need to use Filters -> Script-Fu -> Refresh Scripts to make it recognize the newly added script. In the Filters menu, you should now see a filter category called "Wesnoth", and inside it "Map Localization". However, we don't need it yet.

3. Download the localization.xcf for the map you're localizing.

Now you're all set to begin.

Localization

1. Open the localization.xcf you've downloaded. It contains a bunch of layers needed by the localization script, but at this point all you need is the layer called "label placement guide". It's a version of the map without any perspective or displacement effects added, and it is the one onto which you need to place the localized layers.

2. Create a new layer which includes the localized labels, positioning them using the aforementioned layer as a guide. The positions or orientation or curving of the labels does not need to match the english labels in any way. Place them in a way which you think looks good.

The requirements for the labels are simple: black text should be pure black, whereas yellow labels on forests should have the RGB value 185,155,85. The script gives you a little bit of leeway so you don't have to stress over very small color deviations, but don't do it intentionally. Background should be transparent.

Note that you can use whatever graphics application you want in creating your labels, as long as you can import the result into GIMP so that it meets the above requirements.

3. Add the layer containing your localized text into the same localization.xcf file and name it "labels". Don't mess with the other layers.

4. Run the script by choosing Filters -> Wesnoth -> Map Localization. The script will create a new image, and produce the output there. This will take a moment, perhaps as much as a minute or more on a slow computer, and for a few seconds it might seem like nothing is happening.

5. You should now have a new image with a single layer called "localized overlay". Inspect that everything's ok by adding the original english map as a new layer underneath the overlay; the english labels should be covered up, the localized labels in place and there should be no glitches anywhere. Save the image (just remember to hide/delete the english map layer first!) and you're done.

Final notes:

If there are labels which you don't need to localize, then first of all, don't bother including them among your localized labels. Then, once you've generated the final overlay, simply erase the parts which cover up the original english label.

The script works if and only if the labels layer contains both black and golden pixels.


Text sizing:

These are the text sizing rules that have been used on the english maps. Depending on your language, you may want to break some of them.

Major geographical features or other large areas which extend beyond the map edges (including forests): 28px small caps, tracking ~200.

Large geographical features: 22px normal or small caps.

Minor geographical features: 18px normal.

Major rivers: 20px, tracking ~200.

Small rivers: 18px, tracking ~200. For names like "R. Weldyn", note that periods are very small in Monotype Corsiva and get very close to the preceding R; I suggest giving the . a size of 24-30px and removing the following space. Other solutions can work too.

Capital cities: 24px normal.

Other major cities: 20px normal.

Small cities: 16px normal.

Large forests: 24px normal.

Small forests: 18px normal.


Text orientation and curving:

In the english maps, names of large geographical areas and rivers are often curved. River names usually follow the shape of the river, and names of large features such as "Heart Mountains" are curved to roughly match the shape of said feature.

All of the above is optional. You do not need to match the english labels in shape and location. If for some reason you need to, you can even omit some labels or add completely new ones.