Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Aug 21 17:31:08 -0700 2008 | |
| |
.gitmodules | Fri Feb 06 15:21:47 -0800 2009 | |
| |
README.rdoc | Fri Feb 06 19:27:46 -0800 2009 | |
| |
Rakefile | Thu Aug 21 17:31:08 -0700 2008 | |
| |
app/ | Fri Feb 06 18:23:57 -0800 2009 | |
| |
config/ | Fri Feb 06 15:14:56 -0800 2009 | |
| |
db/ | Thu Aug 21 17:31:08 -0700 2008 | |
| |
doc/ | Thu Aug 21 17:31:08 -0700 2008 | |
| |
i18n_sample.sql | Fri Feb 06 13:56:32 -0800 2009 | |
| |
log/ | Thu Aug 21 17:31:08 -0700 2008 | |
| |
public/ | Fri Feb 06 14:21:27 -0800 2009 | |
| |
script/ | Thu Aug 21 17:31:08 -0700 2008 | |
| |
test/ | Thu Aug 21 17:31:08 -0700 2008 | |
| |
tmp/ | Thu Aug 21 17:31:08 -0700 2008 | |
| |
vendor/ | Fri Feb 06 19:25:21 -0800 2009 |
Db-driven i18n demo app
A sample application that demonstrates usage of two i18n-related plugins:
- i18n_db - a Rails-2.2+ internationalization backend driven by sql and memcached.
- simple_loc_compat - a set of i18n helper methods that mimic those of the excellent Simple Localization plugin which stopped its development in October 2008.
In addition, this sample app contains a convenient ajaxified translations editor and a simple locale list editor.
After checking out, do not forget to run:
git submodule init git submodule update
so that the plugin directories get populated.
There is an SQL file with the sample translations content in the project dir. Create the db and load it, e.g.:
rake db:create mysql i18n_db_admin_development < i18n_sample.sql
Start the application and check out the following local pages (assuming that you aliased i18n_db_admin.local with localhost for this app):
| i18n_db_admin.local/locales: | translator homepage |
| i18n_db_admin.local: | compare with the view template in app/views/pages/index.html.erb |
| i18n_db_admin.local/1/translations: | main locale editor |
| i18n_db_admin.local/2/translations: | translation editor |
| i18n_db_admin.local/admin/locales: | locales list for the admin |
Now create another alias, so that fr.i18n_db_admin.local points to the same IP address. Visit the application at fr.i18n_db_admin.local and see the translations in action.
Run memcached and try the application in production mode - you will see that pretty much everything will be cached. After editing the translations, click the relevant "Reload cache" link at the locales page to make your changes visible to visitors.







