Permalink
Browse files

增加多语言支持

  • Loading branch information...
1 parent 7e5b38b commit 28ab87f6a49ac5071c3328d49bf153db844e45cc @iptton iptton committed May 23, 2012
Showing with 326 additions and 27 deletions.
  1. +7 −1 Rythem.pro
  2. +5 −2 composer.cpp
  3. +1 −1 composer.ui
  4. +7 −0 main.cpp
  5. +6 −6 mainwindow.cpp
  6. +19 −16 mainwindow.ui
  7. +1 −1 quazip/quazipfile.cpp
  8. BIN rythem_zh_CN.qm
  9. +280 −0 rythem_zh_CN.ts
View
8 Rythem.pro
@@ -138,7 +138,9 @@ OTHER_FILES += \
static/img2.png \
static/img1.png \
logo.rc \
- remove.png
+ remove.png \
+ rythem_zh_CN.ts \
+ rythem_zh_CN.qm
CONFIG(release){
#DEFINES += DEBUGTOFILE
#message("debug")
@@ -151,3 +153,7 @@ RC_FILE = logo.rc
ICON = Rythem2.icns
+TRANSLATIONS = rythem_zh_CN.ts
+CODECFORTR = UTF-8
+
+
View
7 composer.cpp
@@ -101,10 +101,13 @@ void Composer::onSendClicked(){
RyProxyServer::instance()->serverPort()
)
);
- if(pipeData->method == "GET"){
+ ui->response->setPlainText(tr("sending"));
+ if(pipeData->method.toUpper() == "GET"){
manager->get(req);
- }else if(pipeData->method == "POST"){
+ }else if(pipeData->method.toUpper() == "POST"){
manager->post(req,pipeData->requestBodyRawData());
+ }else{
+ ui->response->setPlainText(tr("no support this method:%1").arg(pipeData->method));
}
}
}
View
2 composer.ui
@@ -62,7 +62,7 @@ Host: www.alloyteam.com
<item row="0" column="2">
<widget class="QPushButton" name="sendbtn">
<property name="text">
- <string>send</string>
+ <string>excuse</string>
</property>
</widget>
</item>
View
7 main.cpp
@@ -15,6 +15,8 @@
#include <QThread>
+#include <QTranslator>
+
using namespace rule;
@@ -53,6 +55,11 @@ int main(int argc, char *argv[])
a.setQuitOnLastWindowClosed(false);
appPath = qApp->applicationDirPath();
+ QTranslator translator;
+ bool isLoadSuccess = translator.load("rythem_zh_CN");
+ if(!isLoadSuccess)qDebug()<<"error";
+ QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
+ a.installTranslator(&translator);
#ifdef DEBUGTOFILE
qInstallMsgHandler(myMessageHandler);
View
12 mainwindow.cpp
@@ -224,8 +224,8 @@ MainWindow::MainWindow(QWidget *parent) :
#ifdef Q_WS_MAC
// TODO: mac下需手动设置代理
ui->ActionCapture->setEnabled(false);
- ui->ActionCapture->setText(tr("请手动设置代理"));
- ui->ActionCapture->setToolTip(tr("mac下需手动设置代理为127.0.0.1:8889"));
+ ui->ActionCapture->setText(tr("SetupProxyManually"));
+ ui->ActionCapture->setToolTip(tr("non-windows OS need to set proxy to:127.0.0.1:8889 manually"));
#endif
}
@@ -494,7 +494,7 @@ void MainWindow::toggleProxy(){
#ifdef Q_WS_WIN32
RyWinHttp::init();
if(_isUsingCapture){
- ui->ActionCapture->setText(tr("开始抓包"));
+ ui->ActionCapture->setText(tr("start capture"));
proxySetting.setValue("ProxyEnable",_previousProxyInfo.enable);
if(_previousProxyInfo.enable != 0){
proxySetting.setValue("ProxyServer",_previousProxyInfo.proxyString);
@@ -512,7 +512,7 @@ void MainWindow::toggleProxy(){
//}
*/
}else{
- ui->ActionCapture->setText(tr("停止抓包"));
+ ui->ActionCapture->setText(tr("stop capture"));
_previousProxyInfo.isUsingPac = proxySetting.value("AutoConfigURL","0").toString();
_previousProxyInfo.enable = proxySetting.value("ProxyEnable").toInt();
_previousProxyInfo.proxyString =proxySetting.value("ProxyServer").toString();
@@ -556,9 +556,9 @@ void MainWindow::toggleProxy(){
#endif
_isUsingCapture = !_isUsingCapture;
if(_isUsingCapture){
- ui->ActionCapture->setText(tr("停止抓包"));
+ ui->ActionCapture->setText(tr("stop capture"));
}else{
- ui->ActionCapture->setText(tr("开始抓包"));
+ ui->ActionCapture->setText(tr("start capture"));
}
}
View
35 mainwindow.ui
@@ -40,11 +40,11 @@ background:#dddfe2;
<bool>true</bool>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="inspectorTab">
<attribute name="title">
- <string>查看器</string>
+ <string>Inspector</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@@ -54,7 +54,7 @@ background:#dddfe2;
</property>
<widget class="QTabWidget" name="requestInspectorTabs">
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="requestInspectorTextview">
<attribute name="title">
@@ -68,13 +68,13 @@ background:#dddfe2;
</widget>
<widget class="QWidget" name="tab_7">
<attribute name="title">
- <string>webForms</string>
+ <string>FormView</string>
</attribute>
</widget>
</widget>
<widget class="QTabWidget" name="responseInspectorTabs">
<property name="currentIndex">
- <number>1</number>
+ <number>2</number>
</property>
<widget class="QWidget" name="responseInspectorTextView">
<attribute name="title">
@@ -101,8 +101,8 @@ background:#dddfe2;
<rect>
<x>0</x>
<y>0</y>
- <width>523</width>
- <height>164</height>
+ <width>43</width>
+ <height>40</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -131,7 +131,7 @@ background:#dddfe2;
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
- <string>替换规则</string>
+ <string>Rules</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@@ -147,7 +147,7 @@ background:#dddfe2;
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
- <string>composer</string>
+ <string>Composer</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
@@ -198,10 +198,10 @@ background:#dddfe2;
<normalon>:/remove.png</normalon>:/remove.png</iconset>
</property>
<property name="text">
- <string>清除</string>
+ <string>Clear All</string>
</property>
<property name="toolTip">
- <string>清除所有</string>
+ <string>Clear All</string>
</property>
<property name="iconVisibleInMenu">
<bool>true</bool>
@@ -217,7 +217,10 @@ background:#dddfe2;
<normalon>:/static/img16.png</normalon>:/static/img13.png</iconset>
</property>
<property name="text">
- <string>开始抓包</string>
+ <string>Begein Capture</string>
+ </property>
+ <property name="toolTip">
+ <string>Begein Capture</string>
</property>
</action>
<action name="actionWaterfall">
@@ -229,10 +232,10 @@ background:#dddfe2;
<normaloff>:/static/img11.png</normaloff>:/static/img11.png</iconset>
</property>
<property name="text">
- <string>瀑布图</string>
+ <string>water fall</string>
</property>
<property name="toolTip">
- <string>瀑布图</string>
+ <string>water fall</string>
</property>
</action>
<action name="actionLongCache">
@@ -244,10 +247,10 @@ background:#dddfe2;
<normaloff>:/static/img10.png</normaloff>:/static/img10.png</iconset>
</property>
<property name="text">
- <string>长缓存</string>
+ <string>long cache</string>
</property>
<property name="toolTip">
- <string>被替换内容设置长时间缓存</string>
+ <string>set sessions matching rule with long cache</string>
</property>
<property name="visible">
<bool>true</bool>
View
2 quazip/quazipfile.cpp
@@ -210,7 +210,7 @@ void QuaZipFilePrivate::setZipError(int zipError) const
if(zipError==UNZ_OK)
q->setErrorString(QString());
else
- q->setErrorString(q->tr("ZIP/UNZIP API error %1").arg(zipError));
+ q->setErrorString(QString("ZIP/UNZIP API error %1").arg(zipError));
}
bool QuaZipFile::open(OpenMode mode)
View
BIN rythem_zh_CN.qm
Binary file not shown.
View
280 rythem_zh_CN.ts
@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="zh_CN" sourcelanguage="en">
+<defaultcodec>UTF-8</defaultcodec>
+<context>
+ <name>Composer</name>
+ <message>
+ <location filename="composer.ui" line="14"/>
+ <source>Sender</source>
+ <translation type="unfinished">发送</translation>
+ </message>
+ <message>
+ <location filename="composer.ui" line="36"/>
+ <location filename="composer.ui" line="39"/>
+ <source>request</source>
+ <translation type="unfinished">请求</translation>
+ </message>
+ <message>
+ <location filename="composer.ui" line="42"/>
+ <source>Get / HTTP/1.1
+Host: www.alloyteam.com
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="composer.ui" line="55"/>
+ <location filename="composer.ui" line="58"/>
+ <source>response</source>
+ <translation type="unfinished">返回</translation>
+ </message>
+ <message>
+ <location filename="composer.ui" line="65"/>
+ <source>excuse</source>
+ <translation type="unfinished">执行</translation>
+ </message>
+ <message>
+ <source>send</source>
+ <translation type="obsolete">发送</translation>
+ </message>
+ <message>
+ <location filename="composer.cpp" line="104"/>
+ <source>sending</source>
+ <translation type="unfinished">执行中</translation>
+ </message>
+ <message>
+ <location filename="composer.cpp" line="110"/>
+ <source>no support this method:%1</source>
+ <translation type="unfinished">暂未支持此类型: %1</translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <location filename="mainwindow.ui" line="14"/>
+ <source>Rythem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="141"/>
+ <source>about:blank</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="47"/>
+ <source>Inspector</source>
+ <translation type="unfinished">查看器</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="61"/>
+ <location filename="mainwindow.ui" line="81"/>
+ <source>TextView</source>
+ <translation type="unfinished">文本</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="71"/>
+ <source>FormView</source>
+ <translation type="unfinished">表单</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="91"/>
+ <source>ImageView</source>
+ <translation type="unfinished">图片</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="124"/>
+ <source>HexView</source>
+ <translation type="unfinished">十六进制</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="134"/>
+ <source>Rules</source>
+ <translation type="unfinished">替换规则</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="150"/>
+ <source>Composer</source>
+ <translation type="unfinished">发送器</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="201"/>
+ <location filename="mainwindow.ui" line="204"/>
+ <source>Clear All</source>
+ <translation type="unfinished">清除</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="220"/>
+ <location filename="mainwindow.ui" line="223"/>
+ <source>Begein Capture</source>
+ <translation type="unfinished">开始抓包</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="235"/>
+ <location filename="mainwindow.ui" line="238"/>
+ <source>water fall</source>
+ <translation type="unfinished">瀑布图</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="250"/>
+ <source>long cache</source>
+ <translation type="unfinished">长缓存</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="253"/>
+ <source>set sessions matching rule with long cache</source>
+ <translation type="unfinished">符合替换规则的请示,返回内容设置长时间缓存</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="265"/>
+ <source>Debug</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.ui" line="268"/>
+ <source>debug</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="227"/>
+ <source>SetupProxyManually</source>
+ <translation type="unfinished">请手动设置代理</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="228"/>
+ <source>non-windows OS need to set proxy to:127.0.0.1:8889 manually</source>
+ <translation type="unfinished">非windows系统需手动设置代理为 127.0.0.1:8889</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="241"/>
+ <source>&amp;File</source>
+ <translation type="unfinished">文件(&amp;F)</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="242"/>
+ <source>&amp;import session...</source>
+ <translation type="unfinished">导入会放(&amp;i)...</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="243"/>
+ <source>hide image requests</source>
+ <translation type="unfinished">隐藏图片请求</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="245"/>
+ <source>hide 304s</source>
+ <translation type="unfinished">隐藏304</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="247"/>
+ <source>show matching sessions only</source>
+ <translation type="unfinished">只显示匹配规则的请求</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="249"/>
+ <source>hide connect tunnels</source>
+ <translation type="unfinished">隐藏Connect遂道</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="257"/>
+ <source>select file to open</source>
+ <translation type="unfinished">选择文件</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="497"/>
+ <location filename="mainwindow.cpp" line="561"/>
+ <source>start capture</source>
+ <translation type="unfinished">开始抓包</translation>
+ </message>
+ <message>
+ <location filename="mainwindow.cpp" line="515"/>
+ <location filename="mainwindow.cpp" line="559"/>
+ <source>stop capture</source>
+ <translation type="unfinished">停止抓包</translation>
+ </message>
+</context>
+<context>
+ <name>RyConnectionTableView</name>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="37"/>
+ <source>save selected sessions...</source>
+ <translation type="unfinished">保存选中会话...</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="38"/>
+ <source>&amp;save selected response body...</source>
+ <translation type="unfinished">保存选中会话返回内容(&amp;S)...</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="41"/>
+ <source>auto scroll session list</source>
+ <translation type="unfinished">自动滚动</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="45"/>
+ <source>&amp;save</source>
+ <translation type="unfinished">保存(&amp;S)</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="47"/>
+ <source>&amp;save all sessions</source>
+ <translation type="unfinished">保存所有(&amp;S)</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="49"/>
+ <source>save sessions unselected</source>
+ <translation type="unfinished">保存未选中会话</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="52"/>
+ <source>&amp;remove</source>
+ <translation type="unfinished">删除(&amp;R)</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="54"/>
+ <source>remove selected session</source>
+ <translation type="unfinished">删除选中会</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="56"/>
+ <source>remove all sessions</source>
+ <translation type="unfinished">删除所有会话</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="58"/>
+ <source>remove sessions unselected</source>
+ <translation type="unfinished">删除未选中会话</translation>
+ </message>
+ <message>
+ <location filename="ryconnectiontableview.cpp" line="159"/>
+ <source>save session response body to...</source>
+ <translation type="unfinished">保存所有会话内容...</translation>
+ </message>
+</context>
+<context>
+ <name>RyTableModel</name>
+ <message>
+ <location filename="rytablemodel.cpp" line="79"/>
+ <source>unknown..%1</source>
+ <translation type="unfinished">未知..%1</translation>
+ </message>
+ <message>
+ <location filename="rytablemodel.cpp" line="82"/>
+ <source>unknown..2</source>
+ <translation type="unfinished">未知内容..2</translation>
+ </message>
+</context>
+<context>
+ <name>WaterfallWindow</name>
+ <message>
+ <location filename="waterfallwindow.ui" line="14"/>
+ <source>Network Waterfall Diagram</source>
+ <translation type="unfinished">请示瀑布流</translation>
+ </message>
+ <message>
+ <location filename="waterfallwindow.ui" line="22"/>
+ <source>qrc:/web/waterfall/RythemTimes/index.html</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>

0 comments on commit 28ab87f

Please sign in to comment.