allpy
changeset 1001:6f780722212a
pair-cores/web: add translations
author | Boris Nagaev <bnagaev@gmail.com> |
---|---|
date | Sun, 04 Mar 2012 00:01:37 +0400 |
parents | 08aab01af45b |
children | 93506ab49348 |
files | pair_cores/web/Makefile pair_cores/web/approot/locales/pair-cores-web.xml pair_cores/web/approot/locales/pair-cores-web_ru.xml pair_cores/web/pair-cores.cpp |
diffstat | 4 files changed, 90 insertions(+), 20 deletions(-) [+] |
line diff
1.1 --- a/pair_cores/web/Makefile Sat Mar 03 23:06:17 2012 +0400 1.2 +++ b/pair_cores/web/Makefile Sun Mar 04 00:01:37 2012 +0400 1.3 @@ -6,8 +6,7 @@ 1.4 1.5 .PHONY: environment 1.6 environment: wc 1.7 - mkdir -p approot 1.8 - cd approot && ln -fs ../wc/locales 1.9 + cd approot && ln -fs ../wc/locales wc-locales 1.10 mkdir -p docroot/resources 1.11 cd docroot/resources && ln -fs /usr/share/Wt/resources/*.* . 1.12 cd docroot/resources && rm -fr Wc
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/pair_cores/web/approot/locales/pair-cores-web.xml Sun Mar 04 00:01:37 2012 +0400 2.3 @@ -0,0 +1,30 @@ 2.4 +<?xml version="1.0" encoding="UTF-8"?> 2.5 +<messages nplurals='2' plural="n==1 ? 0 : 1"> 2.6 + 2.7 + <message id='pair.in.Alignment'>Alignment file</message> 2.8 + <message id='pair.in.Delta'>Distance spreading</message> 2.9 + <message id='pair.in.Markup'>Markup file</message> 2.10 + <message id='pair.in.SS'>Ignore cores, owned by one SS element</message> 2.11 + <message id='pair.in.Width'>Min width of a block</message> 2.12 + <message id='pair.in.Blocks3D'> 2.13 + Use blocks3d algorithm for high blocks 2.14 + </message> 2.15 + <message id='pair.in.Blocks3D_timeout'> 2.16 + Bron-Kerbosh (blocks3d) timeout (-1 - unlimited) 2.17 + </message> 2.18 + <message id='pair.in.Error_one_input'> 2.19 + Input alignment or input markup must be specified 2.20 + </message> 2.21 + <message id='pair.in.Pair_timeout'> 2.22 + Bron-Kerbosh (pair cores) timeout (-1 - unlimited) 2.23 + </message> 2.24 + 2.25 + <message id='pair.out.High_blocks'>Text file with high blocks</message> 2.26 + <message id='pair.out.High_html'>HTML file with high blocks</message> 2.27 + <message id='pair.out.Homology'>Homology file</message> 2.28 + <message id='pair.out.Pair_blocks'>Pair cores file</message> 2.29 + <message id='pair.out.Pair_html'>Pair cores HTML file</message> 2.30 + <message id='pair.out.Pymol'>PyMol file</message> 2.31 + 2.32 +</messages> 2.33 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/pair_cores/web/approot/locales/pair-cores-web_ru.xml Sun Mar 04 00:01:37 2012 +0400 3.3 @@ -0,0 +1,37 @@ 3.4 +<?xml version="1.0" encoding="UTF-8"?> 3.5 +<messages nplurals="3" 3.6 + plural="(n%10 == 0 || n%10 >= 5 || n/10%10 == 1) ? 2 : n%10==1 ? 0 : 1"> 3.7 + 3.8 + <message id='pair.in.Alignment'>Выравнивание</message> 3.9 + <message id='pair.in.Markup'>Разметка</message> 3.10 + <message id='pair.in.Width'>Минимальная ширина блока</message> 3.11 + <message id='pair.in.Blocks3D'> 3.12 + Использовать алгоритм blocks3d для вертикальных блоков 3.13 + </message> 3.14 + <message id='pair.in.Blocks3D_timeout'> 3.15 + Ограничение по времени на работу алгоритма Брона-Кербоша <br/> 3.16 + для blocks3d (в секундах, -1 - без ограничения) 3.17 + </message> 3.18 + <message id='pair.in.Delta'> 3.19 + Допустимое расхождение расстояний между атомами 3.20 + </message> 3.21 + <message id='pair.in.Error_one_input'> 3.22 + Входное выравнивание или входная разметка должны быть указаны 3.23 + </message> 3.24 + <message id='pair.in.Pair_timeout'> 3.25 + Ограничение по времени на работу алгоритма Брона-Кербоша <br/> 3.26 + для парных ядер (в секундах, -1 - без ограничения) 3.27 + </message> 3.28 + <message id='pair.in.SS'> 3.29 + Пропускать ядра, входящие в один элемент вторичной структуры 3.30 + </message> 3.31 + 3.32 + <message id='pair.out.High_blocks'>Вертикальные блоки (текст)</message> 3.33 + <message id='pair.out.High_html'>Вертикальные блоки (HTML)</message> 3.34 + <message id='pair.out.Homology'>Файл гомологии</message> 3.35 + <message id='pair.out.Pair_blocks'>Парные блоки (текст)</message> 3.36 + <message id='pair.out.Pair_html'>Парные блоки (HTML)</message> 3.37 + <message id='pair.out.Pymol'>PyMol-скрипт</message> 3.38 + 3.39 +</messages> 3.40 +
4.1 --- a/pair_cores/web/pair-cores.cpp Sat Mar 03 23:06:17 2012 +0400 4.2 +++ b/pair_cores/web/pair-cores.cpp Sun Mar 04 00:01:37 2012 +0400 4.3 @@ -20,7 +20,7 @@ 4.4 task->set_message(""); 4.5 return true; 4.6 } else { 4.7 - task->set_message("Input alignment or input markup must be specified"); 4.8 + task->set_message(WString::tr("pair.in.Error_one_input")); 4.9 return false; 4.10 } 4.11 } 4.12 @@ -40,57 +40,61 @@ 4.13 class PairCoresApp : public WApplication { 4.14 public: 4.15 PairCoresApp(const WEnvironment& env); 4.16 + 4.17 + static Wt::WString tr(const char* key) { 4.18 + return Wt::WString::tr(key); 4.19 + } 4.20 }; 4.21 4.22 PairCoresApp::PairCoresApp(const WEnvironment& env): 4.23 WApplication(env) { 4.24 enableUpdates(true); 4.25 messageResourceBundle().use(Wt::WApplication::appRoot() + 4.26 - "locales/wtclasses"); 4.27 + "wc-locales/wtclasses"); 4.28 + messageResourceBundle().use(Wt::WApplication::appRoot() + 4.29 + "locales/pair-cores-web"); 4.30 TableTask* task = new TableTask(root()); 4.31 // 4.32 TextFileInput* input_markup = new TextFileInput("-m"); 4.33 input_markup->set_required(false); 4.34 - task->add_input(input_markup, "Input pdb markup file"); 4.35 + task->add_input(input_markup, tr("pair.in.Markup")); 4.36 // 4.37 TextFileInput* input_aln = new TextFileInput("-i"); 4.38 input_aln->set_required(false); 4.39 - task->add_input(input_aln, "Input alignment file"); 4.40 + task->add_input(input_aln, tr("pair.in.Alignment")); 4.41 // 4.42 WLineEdit* delta_edit = new WLineEdit("2.0"); 4.43 delta_edit->setValidator(new WDoubleValidator(0, 10)); 4.44 delta_edit->validator()->setMandatory(true); 4.45 LineEditInput* delta = new LineEditInput(delta_edit, "-d"); 4.46 - task->add_input(delta, "Distance spreading"); 4.47 + task->add_input(delta, tr("pair.in.Delta")); 4.48 // 4.49 WLineEdit* width_edit = new WLineEdit("3"); 4.50 width_edit->setValidator(new WIntValidator(3, 9999)); 4.51 width_edit->validator()->setMandatory(true); 4.52 LineEditInput* width = new LineEditInput(width_edit, "-w"); 4.53 - task->add_input(width, "Min width of a block"); 4.54 + task->add_input(width, tr("pair.in.Width")); 4.55 // 4.56 BoolInput* blocks3d = new BoolInput(new WCheckBox(), "--blocks3d"); 4.57 - task->add_input(blocks3d, "Use blocks3d algorithm for high blocks"); 4.58 + task->add_input(blocks3d, tr("pair.in.Blocks3D")); 4.59 // 4.60 BoolInput* ioss = new BoolInput(new WCheckBox(), "-e"); 4.61 ioss->set_value_if_true("True"); 4.62 - task->add_input(ioss, "Ignore cores, owned by one SS element"); 4.63 + task->add_input(ioss, tr("pair.in.SS")); 4.64 // 4.65 WLineEdit* pair_timeout_edit = new WLineEdit("10"); 4.66 pair_timeout_edit->setValidator(new WIntValidator(-1, 30 * 24 * 3600)); 4.67 pair_timeout_edit->validator()->setMandatory(true); 4.68 LineEditInput* pair_timeout = new LineEditInput(pair_timeout_edit, 4.69 "--pair-timeout"); 4.70 - task->add_input(pair_timeout, 4.71 - "Bron-Kerbosh (pair cores) timeout (-1 - unlimited)"); 4.72 + task->add_input(pair_timeout, tr("pair.in.Pair_timeout")); 4.73 // 4.74 WLineEdit* blocks3d_timeout_edit = new WLineEdit("-1"); 4.75 blocks3d_timeout_edit->setValidator(new WIntValidator(-1, 30 * 24 * 3600)); 4.76 blocks3d_timeout_edit->validator()->setMandatory(true); 4.77 LineEditInput* blocks3d_timeout = new LineEditInput(blocks3d_timeout_edit, 4.78 "--blocks3d-timeout"); 4.79 - task->add_input(blocks3d_timeout, 4.80 - "Bron-Kerbosh (blocks3d) timeout (-1 - unlimited)"); 4.81 + task->add_input(blocks3d_timeout, tr("pair.in.Blocks3D_timeout")); 4.82 // 4.83 // outputs 4.84 // 4.85 @@ -100,33 +104,33 @@ 4.86 ViewFileOutput* homology = new ViewFileOutput("-y"); 4.87 homology->set_suggested_gen(boost::bind(name_gen2, "hom")); 4.88 homology->set_selectable(false); 4.89 - task->add_output(homology, "Output homology file"); 4.90 + task->add_output(homology, tr("pair.out.Homology")); 4.91 // 4.92 ViewFileOutput* pair_blocks = new ViewFileOutput("-b"); 4.93 pair_blocks->set_suggested_gen(boost::bind(name_gen2, "blocks")); 4.94 - task->add_output(pair_blocks, "Output pair cores file"); 4.95 + task->add_output(pair_blocks, tr("pair.out.Pair_blocks")); 4.96 // 4.97 ViewFileOutput* pair_html = new ViewFileOutput("-H", 4.98 &FileOutput::unique_name, 4.99 "application/octet-stream", 4.100 "text/html"); 4.101 pair_html->set_suggested_gen(boost::bind(name_gen2, "html")); 4.102 - task->add_output(pair_html, "Output pair cores HTML file"); 4.103 + task->add_output(pair_html, tr("pair.out.Pair_html")); 4.104 // 4.105 ViewFileOutput* pymol = new ViewFileOutput("-p"); 4.106 pymol->set_suggested_gen(boost::bind(name_gen2, "pml")); 4.107 - task->add_output(pymol, "Output PyMol file"); 4.108 + task->add_output(pymol, tr("pair.out.Pymol")); 4.109 // 4.110 ViewFileOutput* high_blocks = new ViewFileOutput("--high-blocks"); 4.111 high_blocks->set_suggested_gen(boost::bind(name_gen2, "blocks")); 4.112 - task->add_output(high_blocks, "Output text file with high blocks"); 4.113 + task->add_output(high_blocks, tr("pair.out.High_blocks")); 4.114 // 4.115 ViewFileOutput* blocks3d_html = new ViewFileOutput("--high-blocks-html", 4.116 &FileOutput::unique_name, 4.117 "application/octet-stream", 4.118 "text/html"); 4.119 blocks3d_html->set_suggested_gen(boost::bind(name_gen2, "html")); 4.120 - task->add_output(blocks3d_html, "Output HTML file with high blocks"); 4.121 + task->add_output(blocks3d_html, tr("pair.out.High_html")); 4.122 // 4.123 task->set_runner(new ForkingRunner("pair-cores")); 4.124 task->set_queue(&queue);