如何从Alfresco中提取Language Pack

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

转载于:https://my.oschina.net/GrayChan/blog/12632

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值