Ambrosia
Click Here To Try Darwinia Now!
---Softwarenewsstoregames*utilitiessupport---
-----mainfreebies-----Easy Envelopes Widget
 
 

Localizing Easy Envelopes
A step by step guide to making a country and language-specific localization of EasyEnvelopes.

 

 


Localizing Easy Envelopes to print addresses to your country's specifications is easy! While we have included localizations for a number of countries, we're always looking for more! There are two simple steps to localizing Easy Envelopes:

1 Translate text
Translate the text used in the widget, so that the interface will be readable by speakers of your language.
2 Specify envelope format
Specify the formatting of envelopes in your country or region, so that the mailing and return addresses will be printed in the correct locations.

This is detailed, step-by-step tutorial which will guide you through the process of creating a localization of this widget.

Step 1:

Navigate to your Widgets directory, and find the Easy Envelopes widget. It will be located in either the ~/Library/Widgets directory, or the /Library/Widgets directory. Now, control-click or right-click on the widget, and select Show Package Contents.
Step 2:
Create a copy of one of the directories with the extension .lproj. You should choose a language which you understand (we recommend duplicating the English.lproj directory), because it is going to contain the strings that need to be translated. Rename the new directory in the format: "[Your Language].lproj" -- a list of language designations can be found here.

In your new directory, there should be a file named "localizedStrings.js". Open this file in your text editor of choice. N.B.: In order for it to work properly, the "localizedStrings.js" file MUST be saved in UTF-16 unicode format.

Step 3:
The file you should now be looking at contains some very simple javascript code. You simply need to replace each line of text on the right side of the equals signs with its translated counterpart in whatever language you are translating to. Once you have replaced each string with the translated version, you have completed the first part of the localization process, and the widget should run in the translated language on all macs set to use that language.
Step 4:
Now you will set the layout of envelopes in your country or region, so that Easy Envelopes can format its output properly. You will need to specify the locations of the mailing and return address for both wide(r than they are tall) and tall(er than they are wide) envelopes. Remaining inside the Easy Envelopes package directory, open up the ABPlugin.widgetplugin/Contents/Resources directory.
Step 5:
As in step 2, duplicate one of the .lproj directories and rename it to the language which you are creating a localization for. This directory contains files which designate the locations of the mailing and return addresses for various different types of envelopes.
Step 6:
In this directory, you will need to edit the files "horizontal.plist", "vertical.plist" and "address.plist".

"horizontal.plist" contains the formatting for envelopes that are wider than they are tall, and "vertical.plist" contains the formatting for envelopes that are taller than they are wide. This distinction takes into account rotation of the envelope that may be necessary on certain printers, and will always count the width as the distance from one side of the envelope to the other, and the height as the distance from the top to the bottom. Open up the file "horizontal.plist". It will open either in Apple's Property List Editor, or in a text editor.

Step 7:
You will now enter 4 sets of information:
  • The location and alignment of the mailing address, on the front of the envelope. (MailingAddressFront)
  • The location and alignment of the return address, if it is printed on the front of the envelope. (ReturnAddressFront)
  • The location and alignment of the return address, if it is printed on the back of the envelope. (ReturnAddressBack)
  • The orientation of all the text on the envelope. (TextOrientation)
For each Location field, you may enter one of the following values:
  • TopLeft
  • Top
  • TopRight
  • Left
  • Center
  • Right
  • BottomLeft
  • Bottom
  • BottomRight
For each TextAlignment field, you may enter one of the following values:
  • Left
  • Center
  • Right
For the TextOrientation field, you may enter one of the following values:
  • Horizontal
  • Vertical
If you are using the Property List Editor, MAKE SURE to hit the return key after you enter each value! If you don't, there is a chance that some of your changes will not be saved.
Step 8:
Now, repeat step 7, but in the "vertical.plist" file.
Step 9:
Now, open up the "address.plist" file. This file contains two elements:
  • NameLocation - This determines whether the name will go above or below the rest of the address. Acceptable values are:
    • Top
    • Bottom
  • NameScalingFactor - This changes the size of the name in the address, relative to the size used for the rest of the address. This must be a number, with decimals allowed. 1.0 will print the name the same size as the rest of the address, while larger values will increase the size of the name, and smaller values will decrease it.
  • FirstNameShownFirst - If Yes, then first (personal) name be displayed in front of the last (family) name. If No, the last name will be shown first. In a text editor, the values are <true/> and <false/>.
Step 10:
The last step is optional. You can change the "Done" button on the back of the widget if you like. If you do not want to change the image used on the widget, you do not need to do anything: the default English button will be used. However, if you want to change the image to a translated button, you must do the following:
  • Create two versions of your button: One for normal display, and one to be displayed when the button is being clicked.
  • Name these images "done_btn_normal.png" and "done_btn_clicked.png"
  • In the lproj directory shown, replace the images that are already there with your own images.

Once you have replaced these images, your new buttons should show up in Easy Envelopes next time you open it.
Step 11:
Now, after making sure you have closed the Easy Envelopes Widget if it is running, launch the widget again by double-clicking it in your Widgets directory.

If the proper language is selected in the System Preferences - International Preferences, then the widget should display all your translated text, and print envelopes correctly formatted for your country!

Once you have tested your localization, send it in to us so we can roll it into the next version of Easy Envelopes. Send localizations to: help@AmbrosiaSW.com


Powered by Mac OS X Server

Copyright ©1993-2008 Ambrosia Software, Inc. - All rights reserved worldwide.

464 visits since 7/12/2001
(1 today, 1 this week, 2 this month, 106 this year)