You are not logged in Log in Join
You are here: Home » Members » zoping's Home » MiniI18N: A slight multilingo package for zope application » swpackage_view

Log in
Name

Password

 
 

MiniI18N: A slight multilingo package for zope application

A easy way to multilingo your zope application

Description

This product uses browser's language sets to translate message unless defined favorite_language in cookies

in its ZMI interface, there are interfaces to show untranslated messages and or translated messages,and you can translate it online.

API

i18n is the instance id for MiniI18N class

i18n(s) : return translated message in first language defined in REQUEST.HTTP_ACCEPT_LANGUAGE for s,if s is not translated in that language,return s itself

i18n.change_runmode(mode) : change run mode, the default mode is dev,it mean the untranslated messages list will growing up when it miss translatation to the specified language. in other run mode,the miss translated messages list will not growing.

Programmer Guide

the i18n folder contain predefined languages, each subfolder for a single language, the subfolder name must be the languange name accepted from browser. MiniI18N will search all the msg.txt files under subfolders under i18n folder when its instance is created. the msg.txt format will be describe below.

code with i18n to translate message.

in script:

# get i18n instance,here we get it from container,maybe anywhere. i18n = container.i18n # translate message hint_msg=i18n(Hi,World, This is MiniI18N) print hint_msg

in DTML:

Hi,World,This is MiniI18N)" html_quote>

in Page template:

Translate message online

when i18n run_code in dev,after you program run with specified language,in i18n instance,you can get all untranslated messages list in a textarea box,you can translate it online by add the translated text after : ,and press the translating button (this button also can be translated).

msg.txt format

comment start with #

each line define a message translattion entry.

source message string and target message string is splited by :

\x3A stand for : if it exists in source or target

\x0A stand for \n

\\ stand for \

\x0D stand for \r

dependence

fileUtilities
a set of python functions to load some of zope Objects (include dtml method,file,image,page template,python script,etc SecurtyUtils -- a easy way to setup class security.

download:

http://www.zope.org/Members/zoping/MiniI18N/MiniI18N.tgz

installation:

unpack MiniI18N.tgz at /Products

Create MiniI18N instance

Login on to your zope ZMI.

at your application root folder,choose MiniI18N content type and press add button,and it will add a MiniI18N instance with id i18n

Support:

My email address: [email protected],bug report are welcome,

Latest Release: 1.0.2
Last Updated: 2006-07-14 01:49:02
Author: zoping
License: ZPL
Categories:
Maturity: Stable
  Changes

Available Releases

Version Maturity Platform Released
MiniI18N-1.0.2 Stable   2006-07-14 01:49:02
  MiniI18N-1.0.2.tgz (13 K) All md5
MiniI18N1.0.1 Stable   2006-07-14 01:49:03
  MiniI18N1.0.1.tgz (13 K) All md5
MiniI18N_1.0.0 Stable   2006-07-14 01:49:03
  MiniI18N.1.0.0.tgz (16 K) All md5