From Alistair Mann / csi18n
Revision as of 14:08, 19 February 2015 by Alistair Mann (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The 'Fire Exit' page can be found at

The code for the page can be found at


Fire Exit demonstrates onscreen what would normally happen off-screen in terms of menus and interactions with the service.

In particular, it provides an HTTP tracker through which the developer can see what's happening on-the-wire.

Csi18n fireexit.jpg

The page itself

The page has four frames.

  • The main frame on the left
  • The translation frame at right and top
  • The service frame at right and middle
  • and the HTTP tracker right and bottom.

Most browsers should allow the frames to be expanded/collapsed to suit.

Main frame

An up arrow at top left redirects the browser to the example sites, and a Question Mark takes the browser to this, the documentation page.

There is a humorous image on the page: clicking 'original' shows it (and clicking 'callout' returns you.) The text on the door, "Fire Exit" is central to the humour: if you didn't understand English, you might miss the joke.

Each door has a bubble over it, with text within drawn from the csi18n service: by default, the service looks for a "Canadian English" translation.

The first bubble is hyperlinked: clicking it starts the user interacting with the service.

At the bottom of the image are links to three programming examples of how to interact with the service: this example page uses PHP with builtins. Simple use of PHP with libcurl or using AJAX is also shown.

Csi18n fireexit translation-frame.jpg

Translation frame

Clicking on the text in the first bubble exposes some of the choices allowed by the csi18n service. Here, Clicking on "show more" exposed a list of two translations competing to be the correct Canadian-English translation for Fire Exit.

The menu is preceded with the newmark in use here - "pk-fireexit".

One could upload a third competing translation with "Offer another"; Edit and Delete should be self-explanatory. To Lock the translation would prevent any reader receiving any translation but the current one until such time as it was unlocked. To bump the translation tells the system to only return the current translation to it's original user (or group of users), again until it's unbumped.

Clicking on history will list the changes the current translation has gone through to reach this point.

Clicking on source will reprint the sourcecode used to generate the translation frame.

Csi18n fireexit service-frame.jpg

Service frame

The service frame provides a means for the user to identify himself to the csi18n service, and a means by which to fake his language.

By default, the credentials start with one of the test accounts. As everyone has access to those accounts, you would be well advised to get your own username, password and APIKey if you want to be sure cheeky scamps are not able to interfere. Clicking 'Join' will start that process.

The service relies on the browser or other client software sending the user's language preference over in a header. For "Fire Exit", this preference is ignored in favour of the Accept-Language menu item. Here, it shows 'en-CA': by changing it to "de", for example, the service will understand you wanto see German. Use 'lat;q=0.8,heb;q=0.4' and the service will understand you to want either Latin or Hebrew, preferably the former.

"Whole list" will be removed. At the moment, it fakes a list of available languages.

Clicking on source will reprint the sourcecode used to generate the translation frame.

Csi18n fireexit tracker-frame.jpg

HTTP Tracker

There are three computers involved with using this page: the user's own computer, the Fire Exit server, and the csi18n server. The user uses his computer to interact with the Fire Exit server, which processes and sends those requests to the csi18n server. That last step, normally hidden from the user, is shown in the http tracker.

Each HTTP request from the Fire Exit server to the csi18n server is detailed with lines in between then and with the latest request at the bottom.

All requests have a red element which reprints the HTTP request (and any body) made to the csi18n server, and a yellow element reprinting the headers received back. Except for deletions, each request will have a green response too: this details the HTTP body received back. This contains the data requested, or an appropriate text response for the status code.