Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3115027
  • 博文数量: 685
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5303
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-19 14:17
个人简介

文章分类

全部博文(685)

文章存档

2015年(116)

2014年(569)

分类: Web开发

2014-09-16 14:13:51

原文地址:http://blog.ich8.com/post/3948

修改 modules/admin-full/luasrc/controller/admin/index.lua 文件

–[[
LuCI - Lua Configuration Interface

Copyright 2008 Steven Barth

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

$Id: index.lua 7789 2011-10-26 03:04:18Z jow $
]]–

module(“luci.controller.admin.index”, package.seeall)

function index()
local root = node()
if not root.target then
root.target = alias(“admin”)
root.index = true
end

local page = node(“admin”)
page.target = firstchild()
page.title = _(“Administration”)
page.order = 10
page.sysauth = “root”
page.sysauth_authenticator = “htmlauth”
page.ucidata = true
page.index = true

– Empty services menu to be populated by addons
entry({“admin”, “services”}, firstchild(), _(“Services”), 40).index = true

entry({“admin”, ”Free_Memory”}, call(“Free_Memory”), _(“Free Memory”), 89)
entry({“admin”, “logout”}, call(“action_logout”), _(“Logout”), 90)
end

function action_logout()
local dsp = require “luci.dispatcher”
local sauth = require “luci.sauth”
if dsp.context.authsession then
sauth.kill(dsp.context.authsession)
dsp.context.urltoken.stok = nil
end

luci.http.header(“Set-Cookie”, “sysauth=; path=” .. dsp.build_url())
luci.http.redirect(luci.dispatcher.build_url())
end
function Free_Memory()
luci.util.exec(“echo 3 > /proc/sys/vm/drop_caches”)
luci.http.redirect(luci.dispatcher.build_url(“admin”, “status”, “overview”))
end

 

黑色加粗部分。

 

另在 luci/trunk/luci/luci/po/zh_CN/base.po 最底部添加

msgid “Free_Memory”
msgstr “释放内存”

这样使用中文的时候便能显示中文。



阅读(4994) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~