Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS X 下支持中文菜单项 #3696

Merged
merged 7 commits into from
Jun 25, 2016
Merged

Mac OS X 下支持中文菜单项 #3696

merged 7 commits into from
Jun 25, 2016

Conversation

Yonsm
Copy link

@Yonsm Yonsm commented Jun 22, 2016

  1. Mac OS X 下支持中文菜单项
  2. 添加菜单分割线

@Cat7373
Copy link
Contributor

Cat7373 commented Jun 22, 2016

能不能做成像 windows 下的这种代码呢?
https://github.com/XX-net/XX-Net/blob/master/code/default/launcher/win_tray.py#L83

@yeahwu
Copy link
Contributor

yeahwu commented Jun 22, 2016

之所以linux和mac没中文菜单,是怕中文冲突吧!

@zhenhappy
Copy link

我之前有有提交过,作者没合并

@yeahwu
Copy link
Contributor

yeahwu commented Jun 22, 2016

嗯,关于中文部分确实不好合并,
就比如以前win中文菜单下“退出”一直用“QUIT”好长时间
有些地方用“登出”而不用“退出”
“重启代理”和“重载代理”等等,都是怕中文冲突!

@Cat7373
Copy link
Contributor

Cat7373 commented Jun 22, 2016

不同的内容最好分成多个 PR 提

@Cat7373
Copy link
Contributor

Cat7373 commented Jun 22, 2016

你现在这种写法以后再想加语言的时候怎么加呢?
逻辑会变得复杂难懂,所以建议改成 Windows 那种代码。

@yeahwu
Copy link
Contributor

yeahwu commented Jun 23, 2016

@zjhzxhz 兄弟,UI是你写的,你来测试一下。关于冲突你来解释一下
@cc941201 @yfdyh000 兄,有空来测试,审核一下。
俺知道你们都在用mac os
https://github.com/Yonsm/XX-Net/archive/master.zip

@yfdyh000
Copy link
Contributor

我不用mac os,没法测试。

@hzxie
Copy link
Contributor

hzxie commented Jun 23, 2016

macOS特意从英文版切换到中文版,然而发现菜单的依旧是英文。
XX-Net改成中文依旧不好用。
2016-06-23 23 21 56

XX-Net.app 提示无法打开:
screen shot 2016-06-23 at 23 18 27

(我知道可以通过信任所有用户的App打开,但是)用户体验不是太好。

以上。请继续改进。

@hzxie
Copy link
Contributor

hzxie commented Jun 23, 2016

对了~ 还有一个Bug。
在启动时为什么需要输入两次密码,应该仍然有需要改进的地方。

@yeahwu
Copy link
Contributor

yeahwu commented Jun 23, 2016

@Yonsm @zjhzxhz 点赞

@guoye-zhang
Copy link
Contributor

@zjhzxhz 如果确定要添加app,我可以贡献一个Developer ID签名。

第一次启动输入两次密码中第一个是导入证书,第二个是创建helper确保以后修改proxy设置不需要输入密码。这两个功能在代码的不同部分,较难合并,除非完全打破模块化设计。

@yeahwu
Copy link
Contributor

yeahwu commented Jun 23, 2016

@cc941201 哎呦,你终于粗来了。要不要添加app?你们讨论说了算,到时呼叫一下 @xxnet 就好!
这次大家终于集齐了,然后来讨论一下更新的问题!你上次说的修改方案,俺测试了一下,不起作用,更新的版本文件夹里,仍然是空的。

@hzxie
Copy link
Contributor

hzxie commented Jun 23, 2016

@cc941201
对于我而言,我觉得有没有App没有太大差别,甚至更喜欢命令行启动。而且在设置了开机自动启动之后更加无所谓有没有App了。不知道其他用户怎么想。
我没有Review代码,你和我解释了一下觉得可以理解。但是普通用户会觉得很莫名其妙。但是也想不出更好的解决方案。
好久不见你,在准备考试吗?

@yeahwu
Copy link
Contributor

yeahwu commented Jun 23, 2016

不像你,天天逛V2EX,:smile:
然后俺也感觉命令行好,简单点好

@Yonsm
Copy link
Author

Yonsm commented Jun 23, 2016

@zjhzxhz 你的XX-Net配置界面和安全提示界面都还是英文的,先解决这个问题再测试

@hzxie
Copy link
Contributor

hzxie commented Jun 23, 2016

@yeahwu
每天起床看一下OSChina和V2EX嘛~ 还能不能让我静静的做个美男子了~

@Yonsm
我都改成中文还是不好使~ 你这边是正常的吗?
那你问问 @cc941201 , 如果他也正常那大概就是正常的吧。

@Yonsm
Copy link
Author

Yonsm commented Jun 23, 2016

希望大家从End User的角度产品化去考虑问题而不是“我喜欢怎么样”;XX-Net.app只是一个扩展并不影响原有设计,不喜欢删除即可;另外XX-Net.app脚本可以copy自身到Applications成为一个独立bundle,并把XX-Net置于app bundle内,成为一个完整独立的app(而不是一个文件夹和一堆散乱的文件)

@Yonsm
Copy link
Author

Yonsm commented Jun 23, 2016

@zjhxhz 你的安全提示界面显示成英文了,先找到原因。另外切换语言需要注销或重启

@yeahwu
Copy link
Contributor

yeahwu commented Jun 23, 2016

@zjhzxhz 你怎么也看OSChina?这tm果然是兄弟呀,是不是也关注Linux.cn哪?
幸好俺还是草榴会员!要不然就掉队鸟

@yeahwu
Copy link
Contributor

yeahwu commented Jun 23, 2016

@Yonsm 这样说来这个app还是可取嘛!可删除,挺好
@cc941201 兄,你哪签名,还有测试和 @Yonsm 一起搞定嘛,然后合并,发个版本

@hzxie
Copy link
Contributor

hzxie commented Jun 24, 2016

@Yonsm
截图是在切换语言前截的~
切换了语言, 也重启了, 菜单依旧是英文.

@guoye-zhang
Copy link
Contributor

@zjhzxhz 在准备毕业。我测试中文没出问题,请看看$LANG环境变量是否为zh_CN
@Yonsm 如果想要把所有东西都丢到app里,可以看这个fork:https://github.com/binarydist/appified-xx-net 但它的缺点是签名麻烦,修改任何一个文件都要重新签名。

发现个Bug:不再提示按钮并没有做到不再提示。另外如果有不再提示,尽量在别的地方提供一个创建的方法吧。

建议执行start时加入-hungup参数,这样执行后不会立即退出,更像一个app

我是赞成添加app的,主要是方便拖到dock中,目前我只有把XX放在这里:
2016-06-25 00 33 07

@yeahwu
Copy link
Contributor

yeahwu commented Jun 24, 2016

@Yonsm 提个建议,能不能先单独提个“MAC OS菜单中文化”?app稍后,只是建议!

@guoye-zhang
Copy link
Contributor

@yeahwu 那个自动更新问题,反斜杠你连续打两个了吗?只打一个是转义符。例如磁盘路径C:\a\b得打成"C:\\a\\b"。还是不行的话就xlog一下路径名看看吧

@yeahwu
Copy link
Contributor

yeahwu commented Jun 24, 2016

@cc941201 俺明天试试吧,虚拟机里测windows也是一种折磨呀!

@Cat7373
Copy link
Contributor

Cat7373 commented Jun 24, 2016

这就是我说的,不同的事分开提PR。。。

@Cat7373
Copy link
Contributor

Cat7373 commented Jun 24, 2016

Python 里不需要处理 /\ 吧,有平台无关的 API 专门处理路径。

@guoye-zhang
Copy link
Contributor

@Cat7373 我印象中也是,但请看下update_from_github.py 167~168行,这里把路径直接当字符串处理,在Win上挂了

@Yonsm
Copy link
Author

Yonsm commented Jun 25, 2016

@yeahwu @cc941201 已暂时删除 XX-Net.app,请先处理现在的pr。后面再考虑.app的事

@Cat7373 -hungup我觉得默认不应该加,如前面有人提到XX-Net是一个一个服务型应用,包装成应用只是为了更方便能在Launch pad、Dock中启动,启动后还是仅留在system tray里面比较合适。个性花需求可以自己定制一下。

另外.app我会考虑也支持一下多语言,另外最好能全部写成 Apple Script,现在是Shell + Apple Script...

@Cat7373
Copy link
Contributor

Cat7373 commented Jun 25, 2016

@Yonsm 不知道 hungup 为什么要 @我。。。
学会用多个分支,就可以同时提交不同的内容。

@yeahwu yeahwu merged commit d441279 into XX-net:master Jun 25, 2016
@guoye-zhang
Copy link
Contributor

@Yonsm 如果想隐藏图标,可以在Info.plist中改LSUIElement。立即退出的坏处是在运行时可以再次点开。

@yeahwu
Copy link
Contributor

yeahwu commented Jun 25, 2016

@cc941201 刚在虚拟机里测试了一下自动更新,有效。下个版本修复!

@guoye-zhang
Copy link
Contributor

@yeahwu 如果要打开自动更新,还要修改一下start.vbs,检测如果文件夹为空则执行default中的版本,保证老版本自动更新程序更新错误仍能执行。

@yeahwu
Copy link
Contributor

yeahwu commented Jun 25, 2016

@cc941201 要不你提个pull吧,一起搞定算了。

@guoye-zhang
Copy link
Contributor

@yeahwu 我真的不会写vbs,也没办法测试。。

@hzxie
Copy link
Contributor

hzxie commented Jun 26, 2016

@cc941201
如果更新不成功,文件夹一定为空吗?
而且更新为什么不成功,下载完了之后不是会校验MD5吗?

@guoye-zhang
Copy link
Contributor

@zjhzxhz 假如我们在3.2.3修复自动更新,3.0.0到3.2.2的自动更新代码还是错的,从它们更新到3.2.3依然会出现文件夹为空。我们唯一能做的是修改start.vbs来绕过这个Bug。

@hzxie
Copy link
Contributor

hzxie commented Jun 26, 2016

为什么更新失败之后文件夹为空呢?

@guoye-zhang
Copy link
Contributor

@zjhzxhz #3549 #3517

严格意义上说不是更新失败,更新是成功了,不过文件位置放错了

@yeahwu
Copy link
Contributor

yeahwu commented Jun 27, 2016

@cc941201 改start.vbs并没有什么用。start.vbs并不会更新
唯一的办法是先发布新版修复,然后等待个把月,再开启自动更新

@guoye-zhang
Copy link
Contributor

@yeahwu start.vbs会更新。
不管等多少月,始终会有用户从硬盘角落找出这些版本,点更新后出问题,然后来提交issue

@zhenhappy
Copy link

系统刚启动的时候locale.getdefaultlocale()是获取不到的,所以导致开机启动不能够显示中文菜单

@yeahwu
Copy link
Contributor

yeahwu commented Jul 4, 2016

是的,不少反应这个问题!
ZhenHappy [email protected]于2016年7月4日 周一12:29写道:

系统刚启动的时候locale.getdefaultlocale()是获取不到的,所以导致开机启动不能够显示中文菜单


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#3696 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AMtfyCbfEhWn18104Gbjtl3sz512_I47ks5qSIw6gaJpZM4I7nYd
.

@zhenhappy
Copy link

@yeahwu 我之前有提交了一个是有解决这个问题的,但是作者没同意合并,所以就不了了之了

@yeahwu
Copy link
Contributor

yeahwu commented Jul 4, 2016

再提交一次,让大家一起看看嘛!辛苦了
ZhenHappy [email protected]于2016年7月4日 周一12:47写道:

@yeahwu https://github.com/yeahwu 我之前有提交了一个是有解决这个问题的,但是作者没同意合并,所以就不了了之了


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#3696 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AMtfyI92X63d7cecv_nIT7VMO9ccmepbks5qSJBWgaJpZM4I7nYd
.

@yeahwu
Copy link
Contributor

yeahwu commented Jul 4, 2016

不好意思,看错了!反应比较多的是xx不显示图标!
俺正准备先删了这个pull,有办法解决吗?
Yeah Wu [email protected]于2016年7月4日 周一12:56写道:

再提交一次,让大家一起看看嘛!辛苦了
ZhenHappy [email protected]于2016年7月4日 周一12:47写道:

@yeahwu https://github.com/yeahwu 我之前有提交了一个是有解决这个问题的,但是作者没同意合并,所以就不了了之了


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#3696 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AMtfyI92X63d7cecv_nIT7VMO9ccmepbks5qSJBWgaJpZM4I7nYd
.

@zhenhappy
Copy link

zhenhappy commented Jul 4, 2016

@yeahwu #2212 不过当时的版本跟现在差得有点远了,不能直接拿来用了,不过可以参考就是了

@zhenhappy
Copy link

@yeahwu 正确的解决方法是读取配置文件里面的语言参数,而不是去判断系统的语言参数

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants