Apache-PageKit

 view release on metacpan or  search on metacpan

eg/contrib/locale/README  view on Meta::CPAN

"You are welcome." on the other.

also all messages form the pkit_validate_input are translated.

use_locale = 'yes' in the global config part of the Config.xml file activates
the use of the locale info you provide. You need the module Locale::gettext
1.01. if reload = 'yes' (from the server config part) then the .mo files
are reread on every request. else only on serverstartup or first usage.

the API:

pkit_gettext($text);
	translate the text $text and return the translated text.
	if the text cant be translated, the original text is returned.

and pkit_gettext_message($text,...);
	this is a shortcut for
$model->pkit_message($model->pkit_gettext($text),...);


what to do?
copy your locale files into the directory
pkit_root/locale/*YOUR_LANG*/LC_MESSAGES/MyPageKit.mo where *YOUR_LANG*
should be replaced with your language shortcut from the ISO 639 standard.

here some i know of.

en English
de German
fr French
es Spanish
ga Irish
it Italian
zu Zulu

and MyPageKit should be replaced with the name of your pkit application.

so for my internal site pkit.brain.de with the dispatch class MyPageKit::MyModel

../htdocs/pkit.brain.de/locale/de/LC_MESSAGES/PageKit.mo
../htdocs/pkit.brain.de/locale/en/LC_MESSAGES/PageKit.mo

the .mo files are created with the msgfmt commandline tool form your PageKit.po
file.
A simple one is here:

######## start of file

domain "PageKit.mo"

#
# Apache::PageKit
#

msgid "You have successfully logged in."
msgstr "Erfolgreich eingeloggt."

msgid "You have successfully logged out."
msgstr "Erfolgreich ausgeloggt."

msgid "Cookies must be enabled in your browser."
msgstr "Im Browser müssen Cookies eingeschaltet sein."

msgid "This page requires a login."
msgstr "Für diese Seite ist ein Login erforderlich."

msgid "Please try again."
msgstr "Bitte nocheinmal versuchen."

msgid "You did not fill out all the required fields. Please fill the <font
color=\"<PKIT_ERRORSTR>\">red</font> fields."
msgstr "Es wurden nicht alle erforderlichen Felder ausgefüllt. Bitte alle
<font color=\"<PKIT_ERRORSTR>\">roten</font> Felder ausfüllen."

#
# MyPageKit::Common
#

msgid "Your login/password is invalid. Please try again."
msgstr "Das Passwort oder der Login ist ungültig. Bitte nocheinmal versuchen"

msgid "You did not fill all of the fields. Please try again."
msgstr "Es wurden nicht all Felder ausgefüllt, bitte nocheinmal versuchen"

#
# MyPageKit::MyModel
#

msgid "Your changes have been made."
msgstr "Die Änderungen wurden vorgenommen."

msgid "The E-mail address, <b>%%VALUE%%</b>, is invalid."
msgstr "Die Emailadresse <b>%%VALUE%%</b> ist ungültig."

msgid "The phone number, <b>%%VALUE%%</b>, is invalid."
msgstr "Die Telefonnummer <b>%%VALUE%%</b> ist ungültig."

msgid "[Session not set]"
msgstr "[Session nicht gesetzt]"

msgid "The login, <b>%%VALUE%%</b>, has already been used."
msgstr "Der Login <b>%%VALUE%%</b>, wird bereits verwendet."

msgid "The E-mail address, <b>%%VALUE%%</b>, is invalid."
msgstr "Die Emailadresse <b>%%VALUE%%</b> ist ungültig."

msgid "The phone number you entered is invalid."
msgstr "Die eingegebene Telefonnummer ist ungültig."

msgid "The passwords you entered do not match."
msgstr "Das eingegebene Passwort ist nicht richtig."

msgid "This message was passed throught pkit_redirect"
msgstr "Diese Nachricht wurde weitergeleitet durch pkit_redirect"

msgid "Another message passed throught pkit_redirect"
msgstr "Eine andere Nachricht weitergeleitet durch pkit_redirect"

msgid "This ERROR message was passed throught pkit_redirect"
msgstr "Diese Fehlermeldung wurde weitergeleitet durch pkit_redirect"

#### end of file.



( run in 2.107 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )