localeadm

The localeadm utility queries and configures Solaris locales through a command line interface.

Preparation

Check your Solaris Release with cat /etc/release and get a matching DVD or ISO image.

If you're using an ISO image, you have to mount it (insert your path in the first line.

ISOIMG="/share/iso/sol-10-u8-ga-sparc-dvd.iso"
LOFIDEV=$(lofiadm -a ${ISOIMG})
echo LOFIDEV=${LOFIDEV}
mount -F hsfs ${LOFIDEV} /mnt

Note: If you're using the bourne shell (instead of bash or ksh), then use backticks in the second line: LOFIDEV=`lofiadm -a ${ISOIMG}`

Now you can use localeadm.

Examples

List Installed Locales

localeadm -lc

Example output:

Checking for installed packages. This could take a while.
 
[…]
 
-----------------
 
The following regions are installed on maja on Donnerstag,  9. September 2010, 16:44:50 Uhr CEST
 
POSIX (C)
 
Central Europe (ceu)
[ cs_CZ.ISO8859-2, cs_CZ.UTF-8, de_AT.ISO8859-1, de_AT.ISO8859-15, de_AT.UTF-8, de_CH.ISO8859-1, de_CH.UTF-8, de_DE.ISO8859-1, de_DE.ISO8859-15, de_DE.UTF-8, fr_CH.ISO8859-1, fr_CH.UTF-8, hu_HU.ISO8859-2, hu_HU.UTF-8, pl_PL.ISO8859-2, pl_PL.UTF-8, sk_SK.ISO8859-2, sk_SK.UTF-8 ]
 
North America (nam)
[ en_CA.ISO8859-1, en_CA.UTF-8, en_US.ISO8859-1, en_US.ISO8859-15, en_US.UTF-8, es_MX.ISO8859-1, es_MX.UTF-8, fr_CA.ISO8859-1, fr_CA.UTF-8 ]
 
Done.
A copy of this report can be found in /var/sadm/system/data/locales.list

List Installable Locales

localeadm -lc -d /mnt/Solaris_10/Product

Example output:

Checking for installed packages. This could take a while.
 
[…]
 
-----------------
 
The following regions are available to install from /mnt/Solaris_10/Product
 
Australasia (aua)
[ en_AU.ISO8859-1, en_AU.UTF-8, en_NZ.ISO8859-1, en_NZ.UTF-8 ]
 
Central America (cam)
[ es_CR.ISO8859-1, es_CR.UTF-8, es_GT.ISO8859-1, es_GT.UTF-8, es_NI.ISO8859-1, es_NI.UTF-8, es_PA.ISO8859-1, es_PA.UTF-8, es_SV.ISO8859-1, es_SV.UTF-8 ]
 
Central Europe (ceu)
[ cs_CZ.ISO8859-2, cs_CZ.UTF-8, de_AT.ISO8859-1, de_AT.ISO8859-15, de_AT.UTF-8, de_CH.ISO8859-1, de_CH.UTF-8, de_DE.ISO8859-1, de_DE.ISO8859-15, de_DE.UTF-8, fr_CH.ISO8859-1, fr_CH.UTF-8, hu_HU.ISO8859-2, hu_HU.UTF-8, pl_PL.ISO8859-2, pl_PL.UTF-8, sk_SK.ISO8859-2, sk_SK.UTF-8 ]
 
Eastern Europe (eeu)
[ bg_BG.ISO8859-5, bg_BG.UTF-8, et_EE.ISO8859-15, et_EE.UTF-8, hr_HR.ISO8859-2, hr_HR.UTF-8, lt_LT.ISO8859-13, lt_LT.UTF-8, lv_LV.ISO8859-13, lv_LV.UTF-8, mk_MK.ISO8859-5, mk_MK.UTF-8, ro_RO.ISO8859-2, ro_RO.UTF-8, ru_RU.ISO8859-5, ru_RU.ANSI1251, ru_RU.KOI8-R, ru_RU.UTF-8, sh_BA.ISO8859-2, sh_BA.UTF-8, sl_SI.ISO8859-2, sl_SI.UTF-8, sq_AL.ISO8859-2, sq_AL.UTF-8, sr_CS.UTF-8, sr_YU.ISO8859-5, tr_TR.ISO8859-9, tr_TR.UTF-8, kk_KZ.UTF-8, uk_UA.UTF-8 ]
 
Middle East (mea)
[ ar_SA.UTF-8, he, he_IL.UTF-8 ]
 
Northern Africa (naf)
[ ar, ar_EG.UTF-8 ]
 
North America (nam)
[ en_CA.ISO8859-1, en_CA.UTF-8, en_US.ISO8859-1, en_US.ISO8859-15, en_US.UTF-8, es_MX.ISO8859-1, es_MX.UTF-8, fr_CA.ISO8859-1, fr_CA.UTF-8 ]
 
Northern Europe (neu)
[ da_DK.ISO8859-1, da_DK.ISO8859-15, da_DK.UTF-8, fi_FI.ISO8859-1, fi_FI.ISO8859-15, fi_FI.UTF-8, is_IS.ISO8859-1, is_IS.UTF-8, no_NO.ISO8859-1@bokmaal, nb_NO.UTF-8, no_NO.ISO8859-1@nyorsk, nn_NO.UTF-8, sv_SE.ISO8859-1, sv_SE.ISO8859-15, sv_SE.UTF-8 ]
 
South America (sam)
[ es_AR.ISO8859-1, es_AR.UTF-8 , es_BO.ISO8859-1, es_BO.UTF-8 , es_CL.ISO8859-1, es_CL.UTF-8 , es_CO.ISO8859-1, es_CO.UTF-8 , es_EC.ISO8859-1, es_EC.UTF-8 , es_PE.ISO8859-1, es_PE.UTF-8 , es_PY.ISO8859-1, es_PY.UTF-8 , es_UY.ISO8859-1, es_UY.UTF-8 , es_VE.ISO8859-1, es_VE.UTF-8 , pt_BR.ISO8859-1, pt_BR.UTF-8 ]
 
Southern Europe (seu)
[ ca_ES.ISO8859-1, ca_ES.ISO8859-15, ca_ES.UTF-8, el_CY.UTF-8, el_GR.ISO8859-7, el_GR.UTF-8, en_MT.UTF-8, es_ES.ISO8859-1, es_ES.ISO8859-15, es_ES.UTF-8, it_IT.ISO8859-1, it_IT.ISO8859-15, it_IT.UTF-8, mt_MT.UTF-8, pt_PT.ISO8859-1, pt_PT.ISO8859-15, pt_PT.UTF-8 ]
 
Western Europe (weu)
[de_LU.UTF-8, fr_LU.UTF-8, fr_FR.ISO8859-1, fr_FR.ISO8859-15, fr_FR.UTF-8, fr_BE.ISO8859-1, fr_BE.ISO8859-15, fr_BE.UTF-8, nl_BE.ISO8859-1, nl_BE.ISO8859-15, nl_BE.UTF-8, nl_NL.ISO8859-1, nl_NL.ISO8859-15, nl_NL.UTF-8, en_IE.ISO8859-1, en_IE.ISO8859-15, en_IE.UTF-8, en_GB.ISO8859-1, en_GB.ISO8859-15, en_GB.UTF-8] 
 
Japanese (ja)
[ ja, ja_JP.eucJP, ja_JP.PCK, ja_JP.UTF-8 ]
 
Korean (korean)
[ ko, ko_KR.EUC, ko.UTF-8, ko_KR.UTF-8 ]
 
Simplified Chinese (china)
[ zh_CN.EUC, zh, zh_CN.GB18030, zh_CN.GBK, zh.GBK, zh_CN.UTF-8, zh.UTF-8 ]
 
Traditional Chinese (Hong Kong) (hongkong)
[ zh_HK.BIG5HK, zh_HK.UTF-8 ]
 
Traditional Chinese (taiwan)
[ zh_TW, zh_TW.EUC, zh_TW.BIG5, zh_TW.UTF-8 ]
 
Thai (th_th)
[ th, th_TH, th_TH.TIS620, th_TH.ISO8859-11, th_TH.UTF-8 ]
 
Hindi (hi_in)
[ hi_IN.UTF-8 ]
 
Done.

Install all North Americal (nam) and Central Europe (ceu) Locales

localeadm -a nam -d /mnt/Solaris_10/Product
localeadm -a ceu -d /mnt/Solaris_10/Product

Clean Up

If you have finished, you can unmount the ISO image and destroy the lofi device.

umount ${LOFIDEV}
lofiadm -d ${LOFIDEV}