找回密码
 加入
搜索
查看: 4060|回复: 20

请问一下AU3可以根据系统语言来改变程序语言吗?

[复制链接]
发表于 2009-3-5 11:43:46 | 显示全部楼层 |阅读模式
请问一下AU3可以根据系统语言来改变程序语言吗

感谢大家的帮忙!!谢谢!!

[ 本帖最后由 eddielove 于 2009-3-7 00:33 编辑 ]
发表于 2009-3-5 11:54:38 | 显示全部楼层
改变程序语言?
 楼主| 发表于 2009-3-5 13:06:58 | 显示全部楼层
是啊!!像一些软件那样,选择相应语言后界面自动转换为相应语言
发表于 2009-3-5 13:12:33 | 显示全部楼层
理论上来说应该是可以,感觉可以使用外置语言文件的方式来进行,语言文件可以使用 Ini格式
发表于 2009-3-5 13:43:38 | 显示全部楼层
应该是要写成外置语言的
在写个判断系统语言的代码即可,如查看注册表
HKEY_CURRENT_USER\Control Panel\International
下的sLanguage等键值来判断系统语言即可
发表于 2009-3-5 13:45:58 | 显示全部楼层
原帖由 bob 于 2009-3-5 13:43 发表
应该是要写成外置语言的
在写个判断系统语言的代码即可,如查看注册表
HKEY_CURRENT_USER\Control Panel\International
下的sLanguage等键值来判断系统语言即可


同意
AU3的作者应该没有考虑到日文,韩文等系统应用编辑环境
 楼主| 发表于 2009-3-5 17:46:20 | 显示全部楼层
我想使用@OSLang来判断系统语言!然后程序启动就根据这个参数自动显示相应语言,或者在程序打开后自己选择相应语言!请问可以做到选择相应语言后程序界面即时转换为相应语言吗?
发表于 2009-3-5 19:26:15 | 显示全部楼层
1.把程序语言部分写成ini读取
2.读取系统语言 判断用ini哪部分

应该没问题
 楼主| 发表于 2009-3-5 20:44:20 | 显示全部楼层
能不能举个例子!!因为我刚学AU3!!
发表于 2009-3-5 21:37:26 | 显示全部楼层
Script:

MsgBox(0, "语言分支演示", "系统语言编号: " & @OSLang)
;读取ini
Local $var = IniReadSection("Lang.ini", @OSLang)
MsgBox(0, "关键词: " & $var[1][0], "内容: " & $var[1][1])


Lang.ini
[0804]
Lang=中文
 楼主| 发表于 2009-3-5 22:12:32 | 显示全部楼层
好的谢谢!!

另外如果要在程序界面手动选择语言应该怎么做,不根据@OSLang判断?
发表于 2009-3-5 22:58:33 | 显示全部楼层
原帖由 eddielove 于 2009-3-5 22:12 发表
好的谢谢!!

另外如果要在程序界面手动选择语言应该怎么做,不根据@OSLang判断?

恩 @OSLang只作为没有设定时的初始值就可以了...
 楼主| 发表于 2009-3-6 00:28:00 | 显示全部楼层
[0804]
strRecoveryTool=恢复工具
strRecEnv=Windows 恢复环境
strRecEnvTool=系统恢复选项
strStartRep=启动修复
strRstrui=系统还原
strMdsched=Windows 内存诊断工具
strBmrui=Windows Complete PC 还原
strMSDaRTTools=MSDaRT Tools
strERDRegistryEditor=ERD Registry Editor
strERDLocksmith=Locksmith
strERDCrashAnalyzer=Crash Analyzer
strERDFileRestore=File Restore
strERDDiskCmdr=Disk Commander
strERDDiskWipe=Disk Wipe
strERDCompmgmt=Computer Management
strERDExplorer=Explorer
strERDSoutionWizard=Soution Wizard
strERDTcpCfg=TCP/IP Config
strERDHotfixUninstall=Hotfix Uninstall
strERDSFCScan=SFC Scan
strERDSearch=Search
strERDStandaloneSS=Standalone System Sweeper
strERDHelp=ERD Help

帮忙看看是不是这样!??
发表于 2009-3-6 07:19:12 | 显示全部楼层
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 318, 120, 166, 59)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1_text = IniRead("1.ini", @OSLang, "button", "")
$Button1 = GUICtrlCreateButton($Button1_text, 16, 64, 91, 25, $WS_GROUP)
$Label1_text = IniRead("1.ini", @OSLang, "label", "")
$Label1 = GUICtrlCreateLabel($Label1_text, 24, 24, 68, 17)
$Combo1 = GUICtrlCreateCombo("", 128, 24, 145, 25)
GUICtrlSetData($Combo1, "中文|英文")
GUICtrlSetOnEvent(-1, "Combo1Change")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        Sleep(100)
WEnd

Func Button1Click()
        Exit
EndFunc   ;==>Button1Click
Func Combo1Change()
        $lang = GUICtrlRead($Combo1)
        Switch $lang
                Case "中文"
                        $Button1_text = IniRead("1.ini", "0804", "button", "")
                        $Label1_text = IniRead("1.ini", "0804", "label", "")
                        GUICtrlSetData($Button1, $Button1_text)
                        GUICtrlSetData($Label1, $Label1_text)
                Case "英文"
                        $Button1_text = IniRead("1.ini", "0809", "button", "")
                        $Label1_text = IniRead("1.ini", "0809", "label", "")
                        GUICtrlSetData($Button1, $Button1_text)
                        GUICtrlSetData($Label1, $Label1_text)
        EndSwitch
EndFunc   ;==>Combo1Change

Func Form1Close()
        Exit
EndFunc   ;==>Form1Close


1.ini
[0804]
button=按钮
label=标签
[0809]
button=button
label=label
 楼主| 发表于 2009-3-6 11:32:55 | 显示全部楼层
大概明白!是不是首先使用@OSLang判断系统语言读取默认语言,之后设定一个功能项加载INI文件内的所有语言参数,再根据手动选择获取相应语言后改变文字语言!?

好像菜单的不能改变呢??
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 21:51 , Processed in 0.085620 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表