Alfresco 3.4.c仍没有开始支持中文(日文支持的不错了),所以只能靠自己做翻译了.
但Alfresco也没有提供完整的英文语言包来做为翻译的母板,所以也只能靠自己来提取了.(也许提供了,只是我没有找到).
首先应该知道,所有的语言包文件的文件名应该包括语言的代码的,比如"*****_it_IT.properties".
其次,语言包文件不是集中存放的,而是放在各个目录下的.而且是有重名的,所以找到文件后,不仅要记录文件名,而且要记录路径.
最后,英文语言包文件是没有包括语言代码的,所以只能找到其它的语言文件再找出对应的英文语言包文件.
我在Ubuntu下用BASH编写了一个脚本,用于提取语言文件.
#!/bin/bash
#defind the root of Alfresco
root_dir=/opt/alfresco-3.4.c
#defind the destination
dest_dir=./alfresco
#if dest_dir is existed, remove it and create a new one
#Caution, every thing below the folder will be erased!!!
if [ -e $dest_dir ]
then
rm -r $dest_dir
fi
mkdir $dest_dir
#find out all the Italian translation files, include "_it_IT" string
for it_file in $(find $root_dir -name "*_it_IT*")
do
it_dir=$(dirname $it_file)
it_dir=${it_dir//$root_dir/$dest_dir}
if ! [ -e $it_dir ]
then
mkdir -p $it_dir
fi
us_file=${it_file//_it_IT/}
if ! [ -e $us_file ]
then
us_file=${it_file//_it_IT/en_US}
fi
if ! [ -e $us_file ]
then
us_file=$it_file
fi
cp $us_file $it_dir
let "i=$i+1"
done
tar -cf alfresco.tar $dest_dir
echo $i