Documentation

Running Your Own Version of this Site

I18n DB is open source and available under the Apache Software License Version 2. The Eclipse project and a sample WAR file are available at http://hostj2me.com/appdetails.html?id=10503.

Our standard deployment environment is Tomcat+MySQL on Linux. The details in this section describe how to deploy i18n DB in a similar environment.

The Eclipse Project

The i18n DB Eclipse project contains all of the source code, resource files, and JSPs used to create the i18n DB web application. After downloaded the project ZIP file, extract it to a directory. Once extracted, the project can be imported into Eclipse through the normal mechanisms.

The WAR file

If you are not interested in the full project code, you can download a pre packaged version of the web application.

Setting up the Database

i18n DB stores information in four tables.

Table Description
action_log stores information about user events which is used to create the updates list on the dashboard
i18n stores the key pair values
user stores all user account information such as logins and passwords
var_lock stores the lock information which is used to synchronize tasks when running concurrent versions of i18ndb

To create the tables on a MySQL server, execute the following SQL statements.

CREATE DATABASE `foundation-i18n`;

CREATE TABLE  `foundation-i18n`.`user` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `username` varchar(45) NOT NULL,
  `password` varchar(45) NOT NULL,
  `first_name` varchar(45) default NULL,
  `last_name` varchar(45) default NULL,
  `email` varchar(128) NOT NULL,
  `company` varchar(128) default NULL,
  `title` varchar(45) default NULL,
  `status` int(10) unsigned NOT NULL,
  `created` bigint(20) unsigned NOT NULL,
  `modified` bigint(20) unsigned NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE  `foundation-i18n`.`var_lock` (
  `namespace` varchar(45) NOT NULL default '',
  `id` varchar(128) NOT NULL default '',
  `host` varchar(45) NOT NULL default '',
  `expires` bigint(20) unsigned NOT NULL default '0',
  `acquired` bigint(20) unsigned NOT NULL default '0',
  `owner` varchar(45) NOT NULL default '',
  PRIMARY KEY  (`namespace`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE  `foundation-i18n`.`i18n` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `user_id` int(10) unsigned NOT NULL,
  `domain` varchar(45) default 'default',
  `country` varchar(3) default NULL,
  `language` varchar(3) default NULL,
  `key` varchar(45) NOT NULL,
  `text` varchar(2048) NOT NULL,
  `modified` bigint(20) unsigned NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Index_3` (`domain`,`key`,`language`,`user_id`,`country`),
  KEY `FK_i18n_1` (`user_id`),
  CONSTRAINT `FK_i18n_1` FOREIGN KEY (`user_id`)
  REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE  `foundation-i18n`.`action_log` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `action` varchar(45) NOT NULL default '',
  `user_id` int(10) unsigned NOT NULL default '0',
  `what` varchar(512) NOT NULL default '',
  `created` bigint(20) unsigned NOT NULL default '0',
  `hint` varchar(45) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `FK__1` (`user_id`),
  CONSTRAINT `FK__1` FOREIGN KEY (`user_id`) 
  REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

By default, i18n DB expects the resource name (the databaseId variable in the code excerpt below) for the database to be foundation-18n.

public static Connection getConnection() throws NamingException, SQLException
{       
    InitialContext initialContext = new InitialContext();
    Context envCtx = (Context) initialContext.lookup("java:comp/env");
    DataSource dataSource = (DataSource)envCtx.lookup(databaseId);   
        
    return dataSource.getConnection();
}

Configuring an Outgoing Email (SMTP) server

I18n DB sends email during the account create process and when a user requests a password from the Forgot Password page. By default the server will use 127.0.0.1 as the host and 25 as the port number of the SMTP server. To override these values, edit the comp.services.smtp.xml file located in the WEB-INF/classes/prefs/xml directory.

Running i18n DB for the First Time

The class org.astrientfoundation.i18ndb.Manager implements ServletContextListener and performs much of the application initialization in its contextInitialized method. During start up, the Manager class will check for the root user account. If the root user account does not exist, the class will create one with root as the username and password. We strongly recommend that you change this password immediately upon the first login.

Once the server has started, log in as the root user through the My Account page.

Once logged in, the dashboard will display and list a single entry under My Workspace.

Each i18n DB user account can create variants of key value pairs or variants of entire key value pair sets. There are two ways to create an initial key value pair set. A set can be created by importing an existing Java resource bundle key value pair file or by copying an existing key value pair to a new set.

To import a resource bundle file, select import from the right hand menu and select a local file to upload.

To copy an existing key, select the key by navigating through the domains and variants pages and clicking the desired key. When the key details display, select Add Variant and customize the form to reflect the desired domain, locale, key name, and text.

Overview
My Account
Create an Account
Nightly Checkpoints
Browse the Database
Documentation