Novell Home

HOWTO: Translate miru directory server

From Developer Community

Rosetta Web Based Translation

The miru directory server project has been registed with Launchpad in order to gain advantage of the Rosetta service which shares message catalogues with over 380 projects. Rosetta is now the official repository of translated files and as such obsoletes this article.


Contents

Introduction

Standard gettext() stuff, apparently. Language and locales are supported, from your language to translate to find the locale code, e.g. en_GB for British English and you are ready to begin. Please refer to the gettext manual.


Translating Console Messages

The system console, the black background and white text when you switch on the computer, is a legacy affair with only locale support for character sets. This means for each language the text has to be encoded in the supported locale of the video adapter, no PC adapters appear to support UTF-8 as an encoding scheme. To support mismatched video adapters the system allows separate configuration of the console language and the web management interface. For example, a Japanese web interface with a US video adapter requires an English console.

Download translation template file:

https://forgesvn1.novell.com/viewsvn/miru-ocean/trunk/ocean/lang/console.pot (SVN HEAD)


Ensure your LANG variable is set appropriately

# setenv LANG ja_JP.SJIS

Start a new .po file from the pot file in SVN

# cp lang/messages.pot root-fs
# chroot root-fs msginit
ユーザが翻訳に関するフィードバックをあなたに送ることができるように,
新しいメッセージカタログにはあなたの email アドレスを含めてください.
またこれは, 予期せぬ技術的な問題が発生した場合に管理者があなたに連絡が取れる
ようにするという目的もあります.
あなたの電子メールアドレスを見つけられませんでした.
あなたの電子メールアドレスを入力してください.
email@address
Please visit your translation team's homepage at
  http://www.iro.umontreal.ca/translation/HTML/team-ja.html
  http://www.iro.umontreal.ca/contrib/po/HTML/teams.html
  http://www.iro.umontreal.ca/contrib/po/HTML/translators.html
  http://www.iro.umontreal.ca/contrib/po/HTML/index.html
and consider joining your translation team's mailing list
  <translation-team-ja@lists.sourceforge.net>

ja.po を生成.


Update the file with translated text, for example.

#: rc.initial:31
msgid "miru directory server console setup"
msgstr ""

Fill in the msgstr value for the translation.

#: rc.initial:31
msgid "miru directory server console setup"
msgstr "みるのディレクトル・サーバーのセットアップのコンソール"


On completion sign up to the miru-ocean-dev mailing list and post the new console.po file to miru-ocean-dev@forge.novell.com for inclusion in the next release.


Converting Character Encoding

If you have created a messages.po file in UTF-8 you can convert to the video adapter locale using msgconv, for example.

# setenv LANG ja_JP.SJIS
# msgconv -o sjis.po messages.po

Configuring Ocean Console

To configure the console copy the language code to the file /etc/console.lang

$ echo 'ja' > /etc/console.lang


Translating Web Management Interface

All messages for the web interface are to be in UTF-8. The language is configurable via the interface and stored in config.xml.

Download translation template file:

https://forgesvn1.novell.com/viewsvn/miru-ocean/trunk/ocean/lang/web.pot (SVN HEAD)

Translate then sign up to the miru-ocean-dev mailing list and post the new web.po file to miru-ocean-dev@forge.novell.com.


Developer

  1. Write code.
  2. Re-merge multiline text to single lines. ➊
  3. Wrap display text with calls to _(). ➋
  4. Generate translation template files. ➌
  5. Create new English reference translation files and compile message catalogues. ➍

➊ Due to PHP/gettext multiple line strings are not treated as single entities. This means translation is not plausible. Therefore multiple line strings have to be merged into single line strings. For example.

before:

echo "Hello:\n" .
     "How are you?";

after:

echo "Hello:\nHow are you?";

➋ In order to be translated every string needs to be passed to gettext, wrap strings in gettext() or the shortened form _().

before:

echo "Hello:\nHow are you?";

after:

echo _("Hello:\nHow are you?");

➌ Generate console.pot & web.pot template file. An ocean environment needs to exist in FreeSBIE first because the extraction tool xgettext does not support the chroot environment necessary to work with ocean.

# cd /usr/local/ocean/lang
# ./create_pot.sh

➍ Generate console.po & web.po reference for English, and compiled console.mo & web.po for all languages.

# ./build.sh


Keeping Up

Changes to message locations in source code due to code changes can be propogated to the po file through msgmerge with the new pot file.

$ msgmerge console.ja.po console.pot -o new-console.ja.po
$ msgmerge web.ja.po web.pot -o new-web.ja.po


Reserved Words

Some words or phrases cannot be translated because they are product names or international standard technical names. It might be recommended in the future for tooltips or a reference dictionary with explanation of these terms with translations.

AD / Active Directory - Microsofts Kerberos 5 & LDAP directory service.
B - Byte.
DHCP - Dynamic Host Configuration Protocol.
DNS - Domain Name Service.
GB - Gigabyte.
GID - Group ID.
GUI - Graphical User Interface.
HTTP - HyperText Transport Protocol.
HTTPS - Secure HyperText Transport Protocol.
IP - Internet Protocol.
KB - Kilobyte.
Kerberos - Standard network authentication protocol.
LAN - Local Area Network.
LDAP - Lightweight Directory Access Protocol.
MAC - Media Access Control address.
MB - Megabyte.
NTP - Network Time Protocol
OPT - Optional interface: standard for m0n0 extra interfaces.
PXE - Preboot EXecution Environment.
SCP - Secure CoPy.
SSH - Secure SHell.
SSID - Service Set IDentifier.
TFTP - Trivial File Transfer Protocol.
UID - User ID.
VLAN - Virtual LAN.
WINS - Windows Internet Naming Service.


Translatable Terms

This section is where translators can highlight terms which translations actually do exist.

bytes
Kilobytes
Megabytes
Gigabytes

Novell® Making IT Work As One

© 2008 Novell, Inc. All Rights Reserved.