Foxtable(狐表)用户栏目专家坐堂 → 为什么狐表的菜单可以翻译成功我自已做的翻译不成功呢?


  共有22761人关注过本帖树形打印复制链接

主题:为什么狐表的菜单可以翻译成功我自已做的翻译不成功呢?

帅哥哟,离线,有人找我吗?
dm168
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
为什么狐表的菜单可以翻译成功我自已做的翻译不成功呢?  发帖心情 Post By:2012/11/9 13:43:00 [显示全部帖子]

英文
Dim dr As DataRow
If e.Form.Controls("English_2").Checked = True
For Each tb As Table In Tables '表
For Each cl As col In tb.cols
dr = DataTables("Language").find("[Chinese] = '" & cl.Caption & "'")
If dr IsNot Nothing
cl.Caption = dr("English")
End If
Next
tb.BuildHeader()
Next
For Each frm As Winform.Form In Forms '窗口
dr = DataTables("Language").find("[Chinese] = '" & frm.text & "'")
If dr IsNot Nothing
frm.text = dr("English")
End If
Next
For Each rt As RibbonMenu.Tab In RibbonTabs '菜单工能区
dr = DataTables("Language").find("[Chinese] = '" & rt.text & "'")
If dr IsNot Nothing
rt.text = dr("English")
End If
For Each gp As RibbonMenu.Group In RibbonTabs(rt.name).Groups '菜单功能组
dr = DataTables("Language").find("[Chinese] = '" & gp.text & "'")
If dr IsNot Nothing
gp.text = dr("English")
End If
For Each itm As RibbonMenu.RibbonItem In RibbonTabs(rt.name).Groups(gp.name).Items '菜单项目
Dim itms As String = RibbonTabs(rt.name).Groups(gp.name).Items(itm.name).text
dr = DataTables("Language").find("[Chinese] = '" & itms & "'")
If dr IsNot Nothing
RibbonTabs(rt.name).Groups(gp.name).Items(itm.name).text = dr("English")
End If
Next
Next
Next
SaveConfigValue("LangC", "English")
End If
Functions.Execute("Form_Translation")



 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/9 15:05:00 [显示全部帖子]

我发现是快速访问栏,快捷菜单,程式菜单和配置栏不能译,这几个要怎么做呢?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目8.rar

[此贴子已经被作者于2012-11-9 15:12:59编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/9 16:43:00 [显示全部帖子]

ApplicationMenu 程式菜单无法实现吗?

 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/9 17:14:00 [显示全部帖子]

我这样写总是出错好像是语法有问题又不知是什么地方出错
Dim dr As DataRow
If e.Form.Controls("English_1").Checked = True
For Each tb As Table In Tables
For Each cl As col In tb.cols
dr = DataTables("表B").find("[cn] = '" & cl.caption & "'")
If dr IsNot Nothing
cl.Caption = dr("en")
End If
Next
tb.BuildHeader()
Next
For Each rt As RibbonMenu.Tab In RibbonTabs '菜单工能区
dr = DataTables("表B").find("[cn] = '" & rt.text & "'")
If dr IsNot Nothing
rt.text = dr("en")
End If
For Each gp As RibbonMenu.Group In RibbonTabs(rt.name).Groups '菜单功能组
dr = DataTables("表B").find("[cn] = '" & gp.text & "'")
If dr IsNot Nothing
gp.text = dr("en")
End If
For Each itm As RibbonMenu.RibbonItem In RibbonTabs(rt.name).Groups(gp.name).Items '菜单项目
Dim itms As String = RibbonTabs(rt.name).Groups(gp.name).Items(itm.name).text
dr = DataTables("表B").find("[cn] = '" & itms & "'")
If dr IsNot Nothing
RibbonTabs(rt.name).Groups(gp.name).Items(itm.name).text = dr("en")
End If
Next
Next
Next
For Each q As object In QAT.Items
dr = DataTables("表B").find("[cn] = '" & q.text & "'")
q.text = dr("en")
Next
For Each c As object In ConfigBar.Items
dr = DataTables("表B").find("[cn] = '" & c.text & "'")
c.text = dr("en")
Next

SaveConfigValue("语言类别", "cn")
End If
Functions.Execute("窗口翻译")

[此贴子已经被作者于2012-11-9 17:16:37编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/9 17:36:00 [显示全部帖子]

解决了,少了 if isnot nothing 但是程式菜单还是无法实现不知要怎么做?

 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/10 12:23:00 [显示全部帖子]

这是导航栏在翻译句语句不成功,请问是什么地方不对啊?


 

Dim dr As DataRow
For Each c As Winform.Control In Forms(Vars("Fname")).Controls
     If Typeof c Is WinForm.NavBar Then
        Dim bar As WinForm.NavBar =  Forms(Vars("Fname")).Controls(c.name)
        For Each pg As WinForm.NavPage In bar.NavPages
            dr = DataTables("Language").find("[English] = '" & pg.ButtonText & "'")
            If dr IsNot Nothing
                pg.ButtonText = dr(getConfigValue("LangC", "Chinese"))
            End If
        Next
    End If
next
[此贴子已经被作者于2012-11-10 12:24:21编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/10 16:11:00 [显示全部帖子]

这个要怎么做我不会啊!!!能给个例子吗?
你msgbox()看一下循环是否进去,还有就是一些变量的值,是否是你预期的值。

 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/10 16:22:00 [显示全部帖子]

我这样在命令窗口测试,什么也没显示,这是什么问题呢?

Dim dr As DataRow
For Each c As Winform.Control In Forms(Vars("Fname")).Controls
If Typeof c Is WinForm.NavBar Then
Dim bar As WinForm.NavBar = Forms(Vars("Fname")).Controls(c.name)
For Each pg As WinForm.NavPage In bar.NavPages
output.show(pg.ButtonText)
Next
End If
Next


 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/12 14:56:00 [显示全部帖子]

有两个问题,1.导航栏和页面集在其它窗口无法被翻译。只是启动窗口能成功

2.其它控件不知要怎么加入到For Each c As Winform.Control In Forms(Vars("当前窗口名称")).Controls中下面这样总是出错,求助将其它控件加入到For Each c As Winform.Control In Forms(Vars("当前窗口名称")).Controls中的语法
Dim dr As DataRow
For Each c As Winform.Control In Forms(Vars("当前窗口名称")).Controls

Dim ct As String = Forms(Vars("当前窗口名称")).Controls(c.name).text
dr = DataTables("表B").find("[En] = '" & ct & "'")
If dr IsNot Nothing
Forms(Vars("当前窗口名称")).Controls(c.name).text = dr(getConfigValue("LangC", "Cn"))
End If
dr = DataTables("表B").find("[cn] = '" & ct & "'")
If dr IsNot Nothing
Forms(Vars("当前窗口名称")).Controls(c.name).text = dr(getConfigValue("LangC", "En"))
End If



If Typeof c Is WinForm.TreeView Then
Dim trv As WinForm.TreeView = Forms(Vars("当前窗口名称")).Controls(c.name)
For Each nd As WinForm.TreeNode In trv.AllNodes
dr = DataTables("表B").find("[en] = '" & nd.text & "'")
If dr IsNot Nothing
nd.text = dr(getConfigValue("语言类别", "cn"))
End If
Next
End If
If Typeof c Is WinForm.NavBar Then
Dim bar As WinForm.NavBar = Forms(Vars("当前窗口名称")).Controls(c.name)
For Each nb As WinForm.NavPage In bar.NavPages
dr = DataTables("表B").find("[en] = '" & nb.ButtonText & "'")
If dr IsNot Nothing
nb.Buttontext = dr(getConfigValue("语言类别", "cn"))
End If
dr = DataTables("表B").find("[cn] = '" & nb.ButtonText & "'")
If dr IsNot Nothing
nb.Buttontext = dr(getConfigValue("语言类别", "en"))
End If
Next
End If
If Typeof c Is WinForm.TabControl Then
Dim tc As WinForm.TabControl = Forms(Vars("当前窗口名称")).Controls(c.name)
For Each pg As WinForm.TabPage In tc.TabPages
dr = DataTables("表B").find("[en] = '" & pg.Text & "'")
If dr IsNot Nothing
pg.text = dr(getConfigValue("语言类别", "cn"))
End If
dr = DataTables("表B").find("[cn] = '" & pg.Text & "'")
If dr IsNot Nothing
pg.text = dr(getConfigValue("语言类别", "en"))
End If
Next
End If
Next

[此贴子已经被作者于2012-11-12 14:57:16编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
dm168
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:111 积分:1083 威望:0 精华:0 注册:2012/9/14 17:23:00
  发帖心情 Post By:2012/11/13 10:06:00 [显示全部帖子]

这个问题解决了了大功告成了 For Each f As object In forms 这里出错,要怎么修改?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目4.table


Dim dr As DataRow
For Each f As object In forms
output.show(1)
For Each c As Winform.Control In f.Controls
If TypeOf c Is Winform.NavBar Then
Dim bar As WinForm.NavBar = f.Controls(c.name)
For Each nb As WinForm.NavPage In bar.NavPages
dr = DataTables("Language").find("[English] = '" & nb.ButtonText & "'")
If dr IsNot Nothing
nb.Buttontext = dr(getConfigValue("LangC", "Chinese"))
End If
dr = DataTables("Language").find("[Chinese] = '" & nb.ButtonText & "'")
If dr IsNot Nothing
nb.Buttontext = dr(getConfigValue("LangC", "English"))
End If
Next
Else If Typeof c Is WinForm.TreeView Then
Dim trv As WinForm.TreeView = f.Controls(c.name)
For Each nd As WinForm.TreeNode In trv.AllNodes
dr = DataTables("Language").find("[English] = '" & nd.text & "'")
If dr IsNot Nothing
nd.text = dr(getConfigValue("LangC", "Chinese"))
End If
dr = DataTables("Language").find("[Chinese] = '" & nd.text & "'")
If dr IsNot Nothing
nd.text = dr(getConfigValue("LangC", "English"))
End If
Next
Else If TypeOf c Is WinForm.TabControl Then
Dim tc As WinForm.TabControl = f.Controls(c.name)
For Each pg As WinForm.TabPage In tc.TabPages
dr = DataTables("Language").find("[English] = '" & pg.Text & "'")
If dr IsNot Nothing
pg.text = dr(getConfigValue("LangC", "Chinese"))
End If
dr = DataTables("Language").find("[Chinese] = '" & pg.Text & "'")
If dr IsNot Nothing
pg.text = dr(getConfigValue("LangC", "English"))
End If
Next

Else
Dim ct As String = f.Controls(c.name).text
dr = DataTables("Language").find("[English] = '" & ct & "'")
If dr IsNot Nothing
f.Controls(c.name).text = dr(getConfigValue("LangC", "Chinese"))
End If
dr = DataTables("Language").find("[Chinese] = '" & ct & "'")
If dr IsNot Nothing
f.Controls(c.name).text = dr(getConfigValue("LangC", "English"))
End If
End If
Next
Next

[此贴子已经被作者于2012-11-13 10:15:20编辑过]

 回到顶部
总数 46 1 2 3 4 5 下一页