注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

天高云淡的博客

A bad beginning makes a bad ending.

 
 
 

日志

 
 

Creating a language pack for DirectAdmin  

2010-06-25 12:49:30|  分类: DirectAdmin |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
If you would like to create your own language for the DirectAdmin skins, follow these instructions.

1) make a copy of the current language files to your own new language:

cd /usr/local/directadmin/data/skins/enhanced/lang
cp -R en yours
chown -R diradmin:diradmin *
chmod -R 755 *

Where yours is the name of the language you want to use.

2) go into yours and edit all files to show the text you want your language to have.

3) From the User Panel, go to "Site Summary / Statistics / Logs" and select your new language.


If you want to also change the text in the images to look contain your own language you'll first need to take all of the images with text in /usr/local/directadmin/data/skins/enhanced/images and edit them to look how you want. We won't go into detail on modifying images here.

Once you've made your own copies of the images (similar, but different names, in the same directory), you'll need to rename the image tags in the skins so that when a user accesses the images, the correct files are used. Go into the lang/yours directory, and edit "lf_images". There you will see all of the tags pointing to the old images that you don't want to use. You'll need to change the values of the image tags to something of your own.

Eg: change:

LANG_IMG_SKIN_HEADER=IMG_SKIN_HEADER

to:

LANG_IMG_SKIN_HEADER=IMG_YOURS_SKIN_HEADER

What that will do is replace the image tags a browser is to load to use the IMG_YOURS_SKIN_HEADER instead. Now we also need to link IMG_YOURS_SKIN_HEADERS to your new files. Usually, this is done by adding the IMG_YOURS_SKIN_HEADER to the files_user.conf. BUT since all updates will just end up overwriting this file, a new file will be used:

files_custom.conf

This file should not be included in any skins, and for this reason, will remain intact during skin updates. What it does is overrides all other files as it's checked first. We're not too concerned about it overriding other tags in this case because we're not using the same tag name (so that when you change languages, you'll see different images). The important aspect of it is that we can add custom tags in there without fear of losing them.

Create the files_custom.conf in your skins/enhanced/ directory and add:

IMG_YOURS_SKIN_HEADER=images/header_new.gif

where "images/header_new.gif" is the location of the image. You could actually put it in lang/yours/images/header_new.gif if you wanted, as it would keep things much cleaner. It doesn't really matter though.

Once this is done, you should be able to change languages seamlessly through the User Panel, and also see the different images for the different languages. Updates should not change / destroy anything.

Note about languages: Since we are constantly adding new features, new pages will most likely have new languages files which will not exist until you add them yourself.
  评论这张
 
阅读(548)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017