Simple Website Translation Engine

Web Lite Solutions Corp.

Setting Up Your First Website

Once you have SWeTE installed, you can go ahead and set up a proxy website. As an example, let's set up Wikipedia as our first translated website. We'll create a French version of Wikipedia using SWeTE. The steps are as follows:

  1. Log into swete using the default admin account. By default the admin account password is "password".

  2. Change the admin password to something else for security reasons:

    1. Select admin > "Change Password" (in the upper right menu).

    2. Fill in the resulting form with your new password.

  3. Click the Dashboard link on the top-left menu. This should take you to the dashboard as shown below:

  4. Click the Create New Website button in the webpages section.

  5. Fill in the New Site form as follows:

    1. Enter "Wikipedia French" in the Site Name field.

    2. Enter "http://en.wikipedia.org/" in the Website URL field.

    3. Select "English" in the "Source Language" field.

    4. Select "French" in the "Target Language" field.

    5. Leave the Publish Host field as its default value.

    6. Append "wikipedia-fr/" to the Publish basepath field so that it is "/path/to/swete-server/wikipedia-fr/"

    7. At this point the form should appear as shown below:

      Click the Save button at the bottom of the form.

    8. After saving, you should see a message that says "Record Successfully Saved", and you will be returned to the Edit form for that site you just created.

Testing Your Website

Now that you've created a website in the administration console, it is time to test it out to make sure that it works. Click on the "Dashboard" link in the top left, to return to the Dashboard. You should now see your new site listed in the Websites block as shown below:

Click on the "French" link to go to our proxy site's URL: http://yourdomain.com/swete-server/wikipedia-fr/. You should see the wikipedia homepage here exactly as it appears on the actual Wikipedia site (i.e. http://en.wikipedia.org/).

If you do not see this, then you may have some problems with either your server settings or your site settings. Some common errors include:

  • A 404 Not Found Error. If you see a 404 error, then your server probably doesn't have mod_rewrite installed or it is not configured to work with your website.

  • A blank white page. Likely there is a server error. You should check your error log to see what the error is before proceeding.

If you see the Wikipedia home page, you are ready to proceed to the next step: Translating Website Content

Translating Website Content

At this point you may be underwhelmed by the results as you now just have a proxy version of Wikipedia working at your own local address. You may be wondering why none of the content has been translated into French. SWeTE doesn't translate website content automatically. You need to first capture the strings in the website and then either have the strings translated by a professional translator, translate them yourself, or submit them to Google to be translated by a machine. Once the strings have been translated, then SWeTE will be able to apply the translations to webpages that it displays.

In any case, the first step you must take is to capture the strings that you would like to translate.

Capturing Strings

In order to capture the strings that you would like to translate, first return to the dashboard. In the Webpages block, to the right of the "Wikipedia French" listing, you should see an "Actions" button with the following icon:

Click on this icon to reveal a contextual menu of actions you can perform on this site:

Click on the "Capture Strings" option in this menu.

This should take you to a page with a toolbar at the top, and the Wikipedia homepage at the bottom. The toolbar contains an "Exit" link, and a string that says "String capturing is currently turned off". Click the "Turn On" link to the right to turn it on.

Remember to turn string capturing back off after you have finished capturing all of the strings. Capturing strings is an expensive operation as it requires quite a bit of extra processing by SWeTE so you should keep it turned off unless you are in the process of capturing strings.

Once string capturing is turned on, you can start navigating the site. Each time you load a page, the strings on it will be parsed and imported into SWeTE for translation. For now, let's just load the homepage. Because string capturing was disabled when we first loaded it, we'll need to reload the page. You can do this by clicking "Refresh" in your web browser to reload the page.

After you have finished refreshing the homepage, turn string capturing back off by clicking the "Turn off" link on the top toolbar. Then click "Exit" to return to the details page for our site in the administration console.

Reviewing the Captured Strings

You can view the strings that have been captured in the system at any time by clicking on the "Strings" link in the top left menu bar. This will show you all of the strings that have been captured by the system.

You can search this list by keyword, webpage URL, website, whether it has been translated, or by many other criteria. You can also select one or more strings from this list to translate, either manually or automatically using the Google Translation API.

Translating Strings Manually

The process for manually translating strings that have been captured is as follows:

  1. Go to the "Strings" section by clicking the "Strings" link in the top left menu bar.

  2. Filter the set of strings as necessary using searching and sorting to find the strings that you want to translate.

  3. Check the box beside each string that you want to translate. You can check all of the currently shown strings by checking the box in the table header.

  4. Click the "Translate" button on the top menu bar. This will bring up a translation form that allows you to translate all of the strings that were selected.

  5. Fill in the translation form. Translations are automatically saved as you tab out of the field.

Translating Strings with the Google Translation API

SWeTE allows you to use the Google Translation API to translate strings as well. In order to activate this functionality, you must have a Google API Key. For information on obtaining a key, check out the Google Translation API FAQ. If you have a key, you can configure SWeTE to use it by doing the following:

  1. Navigate to the Edit Site form for the website you want to set up. (i.e. Go to the dashboard, click the "Actions" button next to the website in the "Websites" block, and select "Edit").

  2. Expand the "More Details" section at the bottom of the form.

  3. In the "Google API Key" field, enter your Google API key.

  4. Click the "Save" button at the bottom of the form.

Once you have entered your key in the site profile, you can return to the "Strings" section of the application and begin to translate the strings using the Google Translation API. To continue our example site from earlier (Wikipedia), we'll translate the strings in the first page of wikipedia as follows:

  1. Click the "Strings" link on the top-left toolbar.

  2. Check the box beside a few strings that we want to translate.

  3. Click the "Google Translate" button on the top button bar. The will process for a moment and then pop up with a message saying that the translations completed. If there was a problem (e.g. invalid API key), it will let you know.

Checking The Translations

After performing some translations, you should be able to view your proxy (translated) site again, but this time you should see the translations incorporated into the page. You may recall the steps to view your site from earlier:

  1. Click on "Dashboard" in the upper left menu to go to the dashboard. Then click the "French" link next to the Wikipedia site in the "Webpages" block.

  2. You may need to refresh your browser to see the changes as your browser may have the page cached from before it was translated.

  3. You should see the Wikipedia main page translated into French using your translations.