OpenSolaris

You are not signed in. Sign in or register.

FAQ: OpenSolaris ON(OS/Net) translation FAQ

What is OpenSolaris ON(OS/Net) translation ?

OpenSolaris ON(OS/Net) translation is about making the core operating system and networking components in OpenSolaris usable by non-English speaking population by changing the interface language from English to user's target language.

What are the different components in ON ?

OpenSolaris do have many software layers, this FAQ concentrates on ON (OS/Net) libraries and utilities. The following section outlines some of the commands and library functions which can be localized by translating the messages.

Operating System Commands Operating System Libraries Sysadmin Commands BSD Compatibility Commands Software Generation Subsystem Commands
AppcertUtil ac login biff ld
iscsitgtd apptrace pwconv install
md_monitordp assert mkstr
abi_index cstone_piclfrutree rusage
acctadm dak_piclfrutree shutdown
allocate_all devfsadmd_mod ucblinks
appcert errlst
apptrace errmsgs
asa getopt
audioplay getopt_long
audiorecord ib
audit libbsm
audit_binfile libcfgadm
audit_syslog libcontract
auditd libcurses
auths libdb2
autopush libdhcputil
awk libdladm
awk_xpg4 libfruaccess
banner libgss
bart libinetcfg
basename libipmp
bnu libkadm5clnt
bootconfchk libkadm5srv
bsmconv libkdb
bsmrecord libldap
bsmunconv libmeta
busstat libpiclfrudata
cal libpool
cat libprtdiag_psr_cherrystone
cdrw libprtdiag_psr_daktari
cfgadm libprtdiag_psr_desktop
checkeq libprtdiag_psr_desktop_picl
checknr libprtdiag_psr_javelin
chgrp libprtdiag_psr_littleneck
chmod_cmd libprtdiag_psr_lw8_picl
chown libprtdiag_psr_montecarlo
cksum libprtdiag_psr_monto
cmd-inet libprtdiag_psr_ontari
cmp libprtdiag_psr_opl
col libprtdiag_psr_schumacher_picl
comm libprtdiag_psr_serengeti
compress libprtdiag_psr_snowbird
consadm libprtdiag_psr_starcat
coreadm libprtdiag_psr_starfire
cpio libprtdiag_psr_sunfire
cpustat_cmd libprtdiag_psr_tazmo
cputrack_cmd libprtdiag_sun4u
cron_cmd libprtdiag_sun4v
cryptoadm_all libsasl
csh libscf
csplit libshare
ctrun libsldap
ctstat libslp
ctwatch libsmedia
cut libss
datadm libtsol
date libuutil
dc libwanboot
dcs libwanbootutil
dd libwladm
decrypt libzfs
deroff libzonecfg
diff lw8_libfruaccess
diffmk lw8_piclfrutree
digest madv
dladm mpss
du_cmd mpxu_piclfrudr
dumpcs nlspath_checks
ed_cmd pci
eject perror
env picl
eqn picld_pluginutil
etc picldevtree
expand piclenvd_chicago
expr piclenvd_enchilada
fgrep piclenvd_excalibur
file_all piclenvd_grover
filesync piclenvd_taco
find piclenvmon_sun4u
fold piclevent
fruadm piclfcal_leds_lw2plus
fs piclfrutree_lneck
fsstat picllom_blade
fstyp piclmemcfg
generic piclmemcfg_comm
geniconvtbl priv_str_xlate
genmsg psiginfo
getconf psignal
gettent psvcplugin_cstone
gettext psvcplugin_dak
gettxt psvcplugin_lneck
grep psvcpolicy_cstone
grep_xpg4 psvcpolicy_dak
grpck psvcpolicy_lneck
halt regerror_msg
head sata
hostname sbd
htable scsi
id siglist
ifconfig sm_fd
in.dhcpd sm_pcata
in.ftpd_all sm_pcmem
in.routed sm_scsi
in.talkd snowbird_piclenvmond
inetadm snowbird_piclfrutree
inetconv snowbird_piclwatchdog
inetd strerror
iostat strsignal
ipqosconf sysctrl
isaexec sysevent_conf_mod
join sysevent_reg_mod
kadmind ttyname
kbd usb
kclient
kdb5_util
kdestroy
kinit
klist
kmfcfg_msg
kpasswd
kprop
kproplog
krb5-config
krb5kdc
ksslcfg_all
kstat
ktkt_warnd
ktutil
last
ldap_cachemgr
ldapcmd
lgrpinfo
libshare_nfs
locale
lofiadm
logadm
logger
logname
lp
ls
lsvcrun
mailx
man
mesg
mfstscan_all
mipagentconfig_prog
mipagentstat
mixerctl
mkdir_cmd
mkpwdict
mktemp
more
mpstat
msgfmt_all
mv
ncab2clf
ncaconfd
newgrp
newtask
nice
nispasswd
nohup
oawk
pack
passmgmt
passwd
paste
pathchk
pdevfsadm
pdsvclockd
pfexec
pg
picld
pktool_msg
pooladm
poolbind
poolcfg
poold
poolstat
power_all
ppgrep
pprstat
pr
praudit
prcapadm
prcapstat
prcm_daemon
prex
print
profiles
projadd
projdel
projects
projmod
prophist
prtdiag
prtdscp
prtfru_msg
prtpicl
ps
psrinfo
pstmsboot
ptools
pwd
raidctl
ramdiskadm
rcapd
refer
regcmp
renice
rm
rmdir
rmformat
rmmount
rmvolmgr_all
roles
routeadm
scadm_SUNW,Sun-Fire-V240
script
sdiff
sdpadm_msg
sgs
sh
sharectl
sharemgr
sleep
snoop
sort
split
sppptun
ssh
strings
su
sum
svc
svcadm_all
svccfg_all
svcprop
svcs_all
swap
symcheck
symprof
symreport
syseventadm
syseventconfd_msg
syseventd_msg
tabs
talk
tar
tbl
tee
time
tnfdump
tnfxtract
touch
tput
troff
tty
ttymon
tzselect
ufsdump
ufsrestore
ul
uname
uniq
units
unlink
unpack
valtools
vgrind
vi
vmstat
vntsd_msg
volcheck
volrmmount
w
wanboot
wbem_disk
wbem_nfs
wc
who
whodo
wificonfig
wracct
write
wrsmconf_cmd
wrsmstat
xargs
yppasswd
zdump
zfs
zic
zlogin
zoneadm_all
zoneadmd_all
zonecfg
zonename
zpool

OK, What are the pre-requisites for doing the translation ?

If you haven't already, pl. download the Solaris Express community version of OpenSolaris from the following link to install Solaris in your machine.

See Solaris Express community versions download for downloading a Solaris Express distribution of OpenSolaris.

See for installation instructions if you plan to install Solaris in a dual boot environment

Nevada Globalization project have set up a mercurial based codebase of G11N code and messages . Download the message component separately as given in the document.

$ hg clone ssh://anon@hg.opensolaris.org/hg/nv-g11n/messages

This will create a directory called "messages".

Done, show me an example of translating an ON component ?

You can either translate the messages in the already existing locale in the message source path or you may want to translate messages in a new locale which is not existing in the message workspace.

How to translate messages for the already existing locales in the message sources

Given that we already brought over the message workspace as given above in the previous answer, do the following steps. For this example we change a german message

$ cd messages/messages/on/de_DE/usr/lib/locale/__LOCALE__/LC_MESSAGES

Look for Operating System Commands to be translated in the SUNW_OST_OSCMD.po file, Operating System Libraries inside SUNW_OST_OSLIB.po file, Sysadmin commands under SUNW_OST_ADMIN.po BSD Compatibility Commands in SUNW_OST_UCBCMD.po and Software Generation Subsystem Commands in SUNW_OST_SGS.po file

We are picking a specific command cmp from SUNW_OST_OSCMD.po for this example.

# The following lines are contents of SUNW_OST_OSCMD/cmp.po
msgid "%s %s differ: char %lld, line %lld\n"
msgstr "%s %s unterscheiden sich: Zeichen %lld, Zeile %lld\n"
msgid "cmp: cannot open %s\n"
msgstr "cmp: %s kann nicht geöffnet werden.\n"
msgid "cmp: EOF on %s\n"
msgstr "cmp: EOF (Dateiende) bei %s.\n"

if you want to change the msgstr for

msgid "cmp: cannot open %s\n"
msgstr "cmp: %s kann nicht geöffnet werden.\n"

with

msgid "cmp: cannot open %s\n"
msgstr "cmp: %s kann nicht sich öffnen.\n"

Change that and close the .po file, define
$ export SRC=/path/to/message/directory
for example if you have your local message root directory brought over under $HOME/projects, then set SRC like follows
$ export SRC=$HOME/projects/messages
Then do
$ cd $SRC
$ /usr/bin/make
$ /usr/bin/make build

We can see the .mo file is created under $SRC/proto/`mach`/fileroot/usr/lib/locale/de.UTF-8/LC_MESSAGES directory. That newly created .mo file can be copied onto /usr/lib/locale/de.UTF-8/LC_MESSAGES/ directory for 'cmp' utility running in de.UTF-8 locale to acess it. You may have noticed that the proto file is created under de.UTF-8, not de_DE.UTF-8 as one might expect from the location of the original .mo file. This is due to the $SRC/messages/on/makefiles/usr/lib/locale/rootdir.sh which changes the root directory to put in the .mo files created.

The next section describes how to do message translation in a totally new locale which is not there in the message sources

In this example we are taking hi_IN locale as an example. In the sample files and code in this example hi and hi_IN are indicated in red. Pl. substitute this with the language/locale of your choice when following these instructions.

Check that the locale you're going to add support for is already included in the Makefile.master file under the messages directory, like

# List of all our locales - if you need to add/remove any, do it here
ALL_LOCALES = ar_EG ar_SA bg_BG ca cs_CZ da_DK da_DK de_DE de_AT de_CH de_LU el_GR el_CY
en_AU en_CA en_GB en_IE en_MT en_NZ en_US es_ES es_AR es_BO es_CL es_CO es_CR es_EC es_GT
es_MX es_NI es_PA es_PE es_PY es_SV es_UY es_VE et_EE fi_FI fr_FR fr_BE fr_CA fr_CH fr_LU
he_IL hi_IN hr_HR hu_HU is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL nl_BE nn_NO
no_NO no_NY pl_PL pt_PT pt_BR ro_RO ru_RU sh_BA sk_SK sl_SI sq_AL sr_CS sr_SP sr_YU sv_SE
ta_IN th_TH tr_TR zh_CN zh_HK zh_TW iconv

As given in bold, hi_IN locale is already included in the master locale list, if your target locale is not there, add it.

Modify the $SRC/messages/Makefile.trans file to add the following changes highlighted in bold red

# These are default language setting
TARG_LANGUAGE:sh= echo ${TARG_LANGUAGE-'de_DE es_ES fr_FR hi_IN it_IT ja_JP ko_KR sv_SE zh_CN zh_TW'

TARG_LANGUAGE_S:sh= echo ${TARG_LANGUAGES_S-'de es fr hi it ja ko sv zh zh_TW'}

de_DE_LOCALE :sh = echo ${de_DE_LOCALE-'de_DE.ISO8859-1 de_DE.UTF-8'}
es_ES_LOCALE :sh = echo ${es_ES_LOCALE-'es_ES.ISO8859-1 es_ES.UTF-8'}
fr_FR_LOCALE :sh = echo ${fr_FR_LOCALE-'fr_FR.ISO8859-1 fr_FR.UTF-8'}
it_IT_LOCALE :sh = echo ${it_IT_LOCALE-'it_IT.ISO8859-1 it_IT.UTF-8'}
hi_IN_LOCALE :sh = echo ${hi_IN_LOCALE-'hi_IN.UTF-8'}
hi_IN_LOCALE :sh = echo ${hi_IN_LOCALE-'hi_IN.UTF-8'}
ja_JP_LOCALE :sh = echo ${ja_JP_LOCALE-'ja_JP.eucJP ja_JP.PCK ja_JP.UTF-8'}
ko_KR_LOCALE :sh = echo ${ko_KR_LOCALE-'ko_KR.EUC ko.UTF-8'}
pl_PL_LOCALE :sh = echo ${pl_PL_LOCALE-'pl_PL.ISO8859-2 pl_PL.UTF-8'}
pt_BR_LOCALE :sh = echo ${pt_BR_LOCALE-'pt_BR.ISO8859-1 pt_BR.UTF-8'}
ru_RU_LOCALE :sh = echo ${ru_RU_LOCALE-'ru_RU.UTF-8 ru_RU.KOI8-R ru_RU.ISO8859-5 ru_RU.ANSI1251'}
sv_SE_LOCALE :sh = echo ${sv_SE_LOCALE-'sv_SE.ISO8859-1 sv_SE.UTF-8'}
zh_CN_LOCALE :sh = echo ${zh_CN_LOCALE-'zh_CN.EUC zh.GBK zh.UTF-8'}
zh_TW_LOCALE :sh = echo ${zh_TW_LOCALE-'zh_TW.EUC zh_TW.UTF-8 zh_TW.BIG5'}

TARG_LOCALE= \
$(de_DE_LOCALE) \
$(es_ES_LOCALE) \
$(fr_FR_LOCALE) \
$(it_IT_LOCALE) \
$(hi_IN_LOCALE) \
$(hi_IN_LOCALE) \
$(ja_JP_LOCALE) \
$(ko_KR_LOCALE) \
$(sv_SE_LOCALE) \
$(zh_CN_LOCALE) \
$(zh_TW_LOCALE)

$ cd $SRC/messages/common/locale

Here we need to create Makefiles specific to hi, looking at the already existing Makefiles, we can create Makefile for hi. We are only interested in having a UTF-8 code set, so create Makefile.hi and Makefile.hi_IN.UTF-8

Create Makefile.hi like

# For Solaris
LOCALE= hi
CHARSET= UTF-8
SRC_LOCALE= hi_IN

# For java
JAVA_LOCALE= hi_IN
JAVA_LOCALE_S= hi

#
UINICV=

Create Makefile.hi_IN.UTF-8 like

# For Solaris
LOCALE= hi_IN.UTF-8
CHARSET= UTF-8
SRC_LOCALE= hi_IN

# For java
JAVA_LOCALE= hi_IN

#
USEICV=

$ cd ../../on
$ cp -r en_US hi_IN
Do the following modifications for the Java reource bundles copied from the en_US directory. This will change the filenames ending in '_en_US.properties' to files ending in ' ___LOCALE__.properties'.
$ cd $SRC/messages/on
$ cp -r en_US hi_IN
$ cd hi_IN
$ for i in `find . -name "*_en_US.properties"`
> do
> FL=`basename $i`
> CHFL=${FL%_en_US.properties}
> mv $i `dirname $i`/${CHFL}___LOCALE__.properties
> done
$ for i in `find . -name "en_US"
> do
> mv $i `dirname $i`/___LOCALE__
> done
$ for i in `find . -name "*_en_US.java"`
> do
> FL=`basename $i`
> CHFL=${FL%_en_US.java}
> mv $i `dirname $i`/${CHFL}___LOCALE__.java
> cat `dirname $i`/${CHFL}___LOCALE__.java | \
/usr/bin/sed -e '/^public class/s/pmHelpResources /pmHelpResources___LOCALE__ /'  \
-e '/^public class/s/pmResources /pmResources___LOCALE__ /' > /tmp/$$
> mv /tmp/$$ `dirname $i`/${CHFL}___LOCALE__.java 
> done

$ cd hi_IN/usr/lib/locale/__LOCALE__/LC_MESSAGES
Preprocess the .po file to be translated to make the default translation to be ASCII with the following nawk script

index($1,"#") == 1 { print $0 }
$1 == "msgstr" { for (i=0;i<var;i++) print arr[i]; }
$1 == "msgstr" { sub("msgid", "msgstr", arr[0]); }
$1 == "msgstr" { for (i=0;i<var;i++) print arr[i]; }
$1 == "msgid" { var=0; arr[var++]=$0; }
$1 != "msgid" { arr[var++]=$0 }

Save this in a file like modpo.awk and call with the name of the .po file to be translated.

$ nawk -f modpo.awk SUNW_OST_OSCMD.po
This will make the msgid/msgstr equal, then modify SUNW_OST_OSCMD.po, for example for the command cmp which is like follows,

Can be modified like, with an example translation.

# The following lines are contents of SUNW_OST_OSCMD/cmp.po
msgid "%s %s differ: char %lld, line %lld\n"
msgstr "%s %s differ: char %lld, line %lld\n"
msgid "usage: cmp [-l | -s] file1 file2 [skip1] [skip2]\n"
msgstr "usage: cmp [-l | -s] file1 file2 [skip1] [skip2]\n"
msgid "cmp: cannot open %s\n"
msgstr "cmp: %s खोल नहीं सकता। \n"
msgid "cmp: EOF on %s\n"
msgstr "cmp: EOF on %s\n"

$ cd $SRC
$ /usr/bin/make
$ /usr/bin/make build
Will build the message files and the resultant SUNW_OST_OSCMD.mo file can be found under the proto directory. ie, under $SRC/proto/sparc/fileroot/usr/lib/locale/hi_IN.UTF-8/LC_MESSAGES/

How will I translate java property files ?

After creating a working message directory structure, see how this is done for a sample .properties file.

Part of the original untranslated .properties file $SRC/messages/on/en_US/usr/share/lib/locale/com/sun/slp/ClientLib_en_US.properties

no_message =

#Messages logged through SLPConfig.writeLog().

unknown_da_address = Unknown DA address: {0}
periodic_exception = Exception ``{0}'''' during periodic SA reregistering: {1}
sending_da_trace = Sending message ``{0}'''' to DA ``{1}''''
reply_da_trace = Received reply ``{0}'''' from DA ``{1}''''
tcp_send_da_trace = Sending TCP message ``{0}'''' to DA ``{1}''''
tcp_reply_da_trace = Received TCP reply ``{0}'''' from DA ``{1}''''
da_exception_trace = Error ``{0}'''' from DA ``{1}'''': {2}
udp_timeout = UDP timed out: {0}
datagram_io_error = IOException during datagram transaction with address ``{0}'''': {1}

Message file translated for de_DE locale as $SRC/messages/on/de_DE/usr/share/lib/locale/com/sun/slp/ClientLib___LOCALE__.properties

#@EN@
no_message =

#Messages logged through SLPConfig.writeLog().

#@EN@ Unknown DA address: {0}
unknown_da_address = Unbekannte DA-Adresse: {0}
#@EN@ Exception ``{0}'''' during periodic SA reregistering: {1}
periodic_exception = Ausnahme ``{0}'''' w\u00e4hrend planm\u00e4\u00dfiger SA-Neuregistrierung: {1}
#@EN@ Sending message ``{0}'''' to DA ``{1}''''
sending_da_trace = Nachricht ``{0}'''' wird an DA ``{1}'''' gesendet
#@EN@ Received reply ``{0}'''' from DA ``{1}''''
reply_da_trace = Antwort ``{0}'''' von DA ``{1}'''' empfangen
#@EN@ Sending TCP message ``{0}'''' to DA ``{1}''''
tcp_send_da_trace = TCP-Nachricht ``{0}'''' wird an DA ``{1}'''' gesendet
#@EN@ Received TCP reply ``{0}'''' from DA ``{1}''''
tcp_reply_da_trace = TCP-Antwort ``{0}'''' von DA ``{1}'''' empfangen
#@EN@ Error ``{0}'''' from DA ``{1}'''': {2}
da_exception_trace = Fehler ``{0}'''' von DA ``{1}'''': {2}
#@EN@ UDP timed out for address ``{0}''''.
udp_timeout = UDP wegen Zeit\u00fcberschreitung abgebrochen: {0}
#@EN@ IOException during datagram transaction with address ``{0}'''': {1}
datagram_io_error = E/A-Ausnahme w\u00e4hrend Datagramm-Transaktion mit Adresse ``{0}'''': {1}

Similarly the newly created hi_IN property files also may be translated.

How will I change the date and time formats of system commands like cal, diff, ls etc. of my locale ?

Look under (for the hi_IN exmaple in the previous case) $SRC/messages/on/hi_IN/usr/lib/locale/__LOCALE__/LC_TIME for SUNW_OST_OSCMD.po and SUNW_OST_OSLIB.po which contain messages to be changed for doing this.

How will I contribute back the messages I translated ?

Follow these instructions to apply for a hg account for accessing G11N workspace and affiliate with the Nevada G11N project and contribute.