Qt使用Visual创建新翻译(ts)会出错-(ExitCode 1) [英] Qt creating new translation (ts) using Visual gives error - (ExitCode 1)

查看:893
本文介绍了Qt使用Visual创建新翻译(ts)会出错-(ExitCode 1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS 2010中使用QTranslator.使用以下过程时,出现错误,指出该加载项已退出,并显示错误(退出码1).我已经使用Qt Linguist和Qt Creator完成了整个过程(从代码到可执行翻译的可执行文件).但是,我什至不能在Visual Studio中创建ts文件(将菜单添加到所有应有的位置).任何人有任何想法为什么要这样做?

I am using QTranslator in VS 2010. When using the process below I get an error saying the add-on has exited with an error (Exitcode 1). I have been through the whole process (code to executable with translations working) using Qt Linguist and Qt Creator. However, I cannot even create the ts file in Visual Studio (add on menus all where they should be). Anyone any ideas why please?

为项目创建Qt转换文件 要将新的翻译文件添加到项目中,请选择Qt |创建新的翻译文件.在添加翻译"对话框中,您可以选择用于创建翻译文件的语言.提供了建议的文件名,当您单击确定"时将创建该文件名.转换文件位于Visual Studio的解决方案资源管理器中的转换文件"文件夹中.右键单击翻译文件会显示一个菜单,您可以通过该菜单调用lupdate,lrelease和Qt Linguist.

Creating Qt Translation Files for the Project To add a new translation file to the project, select Qt|Create New Translation File. In the Add Translation dialog, you can choose the language to create a translation file. A suggested file name is provided, and will be created when you click OK. The translation file is placed in the Translation Files folder in Visual Studio's Solution Explorer. Right-clicking on a translation file displays a menu that allows you to invoke lupdate, lrelease, and Qt Linguist.

推荐答案

使用qt加载项版本1.1.11,我遇到了类似的错误.我做了一个翻译(VS 2010文件菜单> Qt>创建新翻译),过了一段时间,当我在进行两次翻译后进行构建时,Qt Add in出现错误ExitCode 1.

With the qt add-in version 1.1.11, I experienced a similar error. I made a translation (VS 2010 File Menu > Qt > Create New Translation) and sometime later when I did a build after having two translations in place it gave the error ExitCode 1 for the Qt Add in.

每次构建后,仅在此错误对话框上单击确定"几天后,我发现输出中列出了该输出源的组合框.

After just clicking Ok on this error dialog for a few days each time I built, I found that listed in the output, there is a combo box for the source of the output.

将此组合框从调试"更改为"Qt Visual Studio加载项",然后您应该在输出中看到错误的来源.对我来说,ts文件之一包含无法解析的行.我删除了ts文件并创建了一个新文件,错误消失了.

Change this combo box from "Debug" to "Qt Visual Studio Add-in", and then you should see the source of the error in the output. For me, one of the ts files had a line that couldn't be parsed. I deleted that ts file and created a new one, and the error went away.

希望有帮助.

这篇关于Qt使用Visual创建新翻译(ts)会出错-(ExitCode 1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆