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:
Log into swete using the default admin account. By default the admin account password is "password".
Change the admin password to something else for security reasons:
Select> " " (in the upper right menu).
Fill in the resulting form with your new password.
Click thelink on the top-left menu. This should take you to the dashboard as shown below:
Click thebutton in the webpages section.
Fill in the New Site form as follows:
Enter "Wikipedia French" in the Site Name field.
Enter "http://en.wikipedia.org/" in the Website URL field.
Select "English" in the "Source Language" field.
Select "French" in the "Target Language" field.
Leave the Publish Host field as its default value.
Append "wikipedia-fr/" to the Publish basepath field so that it is "/path/to/swete-server/wikipedia-fr/"
At this point the form should appear as shown below:
Click thebutton at the bottom of the form.
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.
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 "Websites block as shown below:" link in the top left, to return to the Dashboard. You should now see your new site listed in the
Click on the "
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.
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
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.
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 "" link, and a string that says "String capturing is currently turned off". Click the " " 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 " " in your web browser to reload the page.
After you have finished refreshing the homepage, turn string capturing back off by clicking the "" link on the top toolbar. Then click " " to return to the details page for our site in the administration console.
You can view the strings that have been captured in the system at any time by clicking on the "" 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.
The process for manually translating strings that have been captured is as follows:
Go to the "Strings" section by clicking the " " link in the top left menu bar.
Filter the set of strings as necessary using searching and sorting to find the strings that you want to translate.
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.
Click the "" 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.
Fill in the translation form. Translations are automatically saved as you tab out of the field.
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:
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").
Expand the "More Details" section at the bottom of the form.
In the "Google API Key" field, enter your Google API key.
Click the "" 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:
Click the "" link on the top-left toolbar.
Check the box beside a few strings that we want to translate.
Click the "" 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.
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:
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.
You may need to refresh your browser to see the changes as your browser may have the page cached from before it was translated.
You should see the Wikipedia main page translated into French using your translations.