From bd44e8f9bee44ae2411c94a5f84e02bfe18def2b Mon Sep 17 00:00:00 2001 From: facundo Date: Thu, 3 May 2018 23:12:52 -0300 Subject: [PATCH 1/8] test of gettext is done. The first translation is uploaded --- main.cpp | 13 ++++++++++++- main.pot | 22 ++++++++++++++++++++++ traslate/es_AR/main.mo | Bin 0 -> 485 bytes traslate/es_AR/main.po | 23 +++++++++++++++++++++++ traslate/main.pot | 22 ++++++++++++++++++++++ xgettext | 0 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 main.pot create mode 100644 traslate/es_AR/main.mo create mode 100644 traslate/es_AR/main.po create mode 100644 traslate/main.pot create mode 100644 xgettext diff --git a/main.cpp b/main.cpp index ff922ed..409c5ea 100644 --- a/main.cpp +++ b/main.cpp @@ -25,6 +25,12 @@ #include #include +#include +#include +#include +#include +#define _(STRING) gettext(STRING) + using namespace Bastet; using namespace std; using namespace boost; @@ -32,10 +38,15 @@ using namespace boost::assign; int main(int argc, char **argv){ + +setlocale(LC_ALL, ""); +bindtextdomain("main", "/usr/share/locale"); +textdomain("main"); + Ui ui; while(1){ - int choice=ui.MenuDialog(list_of("Play! (normal version)")("Play! (harder version)")("View highscores")("Customize keys")("Quit")); + int choice=ui.MenuDialog(list_of(_("Play! (normal version)"))("Play! (harder version)")("View highscores")("Customize keys")("Quit")); switch(choice){ case 0:{ //ui.ChooseLevel(); diff --git a/main.pot b/main.pot new file mode 100644 index 0000000..54ab400 --- /dev/null +++ b/main.pot @@ -0,0 +1,22 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-03 19:48-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.cpp:49 +msgid "Play! (normal version)" +msgstr "" diff --git a/traslate/es_AR/main.mo b/traslate/es_AR/main.mo new file mode 100644 index 0000000000000000000000000000000000000000..9b034af21877cc6c6ecd29c2f89a3dc17496287a GIT binary patch literal 485 zcmZvZK~KUk6vwC0%Z?uO;^A?F#OeS^urMRyFeu2x$<@@YjGEDswj=UE{8)YkKZ|cb z@ZvxHrLXP3?d$8$(ZQF4+DA^2Gvp9yBZWfb7&s^^~DRnnrJ zM5_fRZ270XSY%Ad7Q{2A4Y&Sl)FaJ5Uy;w0YZAy_rD g(D=0$Y(l>*q2xog(sG@LJY^b-zpXlKKB40L0x$K3NdN!< literal 0 HcmV?d00001 diff --git a/traslate/es_AR/main.po b/traslate/es_AR/main.po new file mode 100644 index 0000000..fa2f43f --- /dev/null +++ b/traslate/es_AR/main.po @@ -0,0 +1,23 @@ +# Spanish translations for PACKAGE package +# Traducciones al español para el paquete PACKAGE. +# Copyright (C) 2018 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# facundo , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-03 19:48-0300\n" +"PO-Revision-Date: 2018-05-03 19:52-0300\n" +"Last-Translator: facundo \n" +"Language-Team: Argentinian\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: main.cpp:49 +msgid "Play! (normal version)" +msgstr "Jugar! (version normal)" diff --git a/traslate/main.pot b/traslate/main.pot new file mode 100644 index 0000000..3b88ba4 --- /dev/null +++ b/traslate/main.pot @@ -0,0 +1,22 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-26 19:38-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.cpp:39 +msgid "Play! (normal version)" +msgstr "" diff --git a/xgettext b/xgettext new file mode 100644 index 0000000..e69de29 From ad87cac6b711c0b7d4d974f684eb20aacdb3c664 Mon Sep 17 00:00:00 2001 From: facundo Date: Sat, 5 May 2018 19:57:39 -0300 Subject: [PATCH 2/8] more translation is added in Ui.cpp --- Ui.cpp | 27 ++++++++++++++++++++++----- main.cpp | 3 ++- main.pot | 18 +++++++++++++++++- traslate/es_AR/main.mo | Bin 485 -> 970 bytes traslate/es_AR/main.po | 40 ++++++++++++++++++++++++++++++++++++++-- 5 files changed, 79 insertions(+), 9 deletions(-) diff --git a/Ui.cpp b/Ui.cpp index 867f33a..704cbd6 100644 --- a/Ui.cpp +++ b/Ui.cpp @@ -28,9 +28,16 @@ #include #include +#include +#include +#include +#include +#define _(STRING) gettext(STRING) + using namespace std; using namespace boost; + namespace Bastet{ Score &operator +=(Score &a, const Score &b){ @@ -302,6 +309,12 @@ namespace Bastet{ } void Ui::RedrawStatic(){ + + setlocale(LC_ALL, ""); + bindtextdomain("main", "/usr/share/locale"); + textdomain("main"); + + erase(); wrefresh(stdscr); _wellWin.RedrawBorder(); @@ -309,15 +322,15 @@ namespace Bastet{ _scoreWin.RedrawBorder(); wattrset((WINDOW*)_nextWin,COLOR_PAIR(17)); - mvwprintw(_nextWin,0,0," Next block:"); + mvwprintw(_nextWin,0,0,_(" Next block:")); wrefresh(_nextWin); wattrset((WINDOW*)_scoreWin,COLOR_PAIR(17)); - mvwprintw(_scoreWin,1,0,"Score:"); + mvwprintw(_scoreWin,1,0,_("Score:")); wattrset((WINDOW*)_scoreWin,COLOR_PAIR(18)); - mvwprintw(_scoreWin,3,0,"Lines:"); + mvwprintw(_scoreWin,3,0,_("Lines:")); wattrset((WINDOW*)_scoreWin,COLOR_PAIR(19)); - mvwprintw(_scoreWin,5,0,"Level:"); + mvwprintw(_scoreWin,5,0,_("Level:")); wrefresh(_scoreWin); } @@ -333,6 +346,10 @@ namespace Bastet{ time.tv_sec=0; time.tv_usec=delay[_level]; + + setlocale(LC_ALL, ""); + bindtextdomain("main", "/usr/share/locale"); + textdomain("main"); //assumes nodelay(stdscr,TRUE) has already been called BlockPosition p; @@ -376,7 +393,7 @@ namespace Bastet{ break; } else if(ch==keys->Pause){ - MessageDialog("Press SPACE or ENTER to resume the game"); + MessageDialog(_("Press SPACE or ENTER to resume the game")); RedrawStatic(); RedrawWell(w,b,p); nodelay(stdscr,TRUE); diff --git a/main.cpp b/main.cpp index 409c5ea..002ee5a 100644 --- a/main.cpp +++ b/main.cpp @@ -46,7 +46,8 @@ textdomain("main"); Ui ui; while(1){ - int choice=ui.MenuDialog(list_of(_("Play! (normal version)"))("Play! (harder version)")("View highscores")("Customize keys")("Quit")); + int choice=ui.MenuDialog(list_of(_("Play! (normal version)"))(_("Play! (harder version)"))(_("View highscores"))(_("Customize keys"))(_("Quit"))); + switch(choice){ case 0:{ //ui.ChooseLevel(); diff --git a/main.pot b/main.pot index 54ab400..16836b6 100644 --- a/main.pot +++ b/main.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-03 19:48-0300\n" +"POT-Creation-Date: 2018-05-05 19:31-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,6 +17,22 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +#: main.cpp:49 +msgid "Customize keys" +msgstr "" + +#: main.cpp:49 +msgid "Play! (harder version)" +msgstr "" + #: main.cpp:49 msgid "Play! (normal version)" msgstr "" + +#: main.cpp:49 +msgid "Quit" +msgstr "" + +#: main.cpp:49 +msgid "View highscores" +msgstr "" diff --git a/traslate/es_AR/main.mo b/traslate/es_AR/main.mo index 9b034af21877cc6c6ecd29c2f89a3dc17496287a..7b959bc782bb5388ad1591f55cbb152bdfaa9fdf 100644 GIT binary patch delta 603 zcmX|+zfK!L5XQ&+a{?#?B84Q1qH&c_P@q7;kp_Vq3t1N%ESeOX^W?m6cWdq58gRoi zScr6~Ql&_dmq-!u456aUGw^L>JkqD%&hF@&Z||o6R4@Oo%v=*{0eTIU&@yxbg?d^c zS_GHDC*T`!4qP8|6MT+-XUrD(7QF^%z!4bczk*BPH?Rx+gy45cE7L^J@K6K8;1*Z~ zKY%a5eQ*{01g?V~oCUvwVeSVQ=6-?joD|yse&Hf~E>xHgq2{5-5K)_G3J8XeLLZ8o za$fT1%p|7~?Ri(4Tn~j$<-*Z{3?z%_Ko{a7iZgXl<99t}yJC4D)@f6$jpA3k;vBc* z-Mu;+%k}1Ay~U+rE6(S_WluO&xzI\n" "Language-Team: Argentinian\n" "Language: es_AR\n" @@ -18,6 +18,42 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: main.cpp:49 +msgid "Customize keys" +msgstr "Personalizar claves" + +#: main.cpp:49 +msgid "Play! (harder version)" +msgstr "Jugar! (version dificil)" + #: main.cpp:49 msgid "Play! (normal version)" msgstr "Jugar! (version normal)" + +#: main.cpp:49 +msgid "Quit" +msgstr "Salir" + +#: main.cpp:49 +msgid "View highscores" +msgstr "Ver mejores puntuaciones" + +#: Ui.cpp:325 +msgid " Next block:" +msgstr "proxima pieza:" + +#: Ui.cpp:329 +msgid "Score:" +msgstr "Puntos:" + +#: Ui.cpp:331 +msgid "Lines:" +msgstr "Lineas:" + +#: Ui.cpp:333 +msgid "Level:" +msgstr "Nivel:" + +#: Ui.cpp:396 +msgid "Press SPACE or ENTER to resume the game" +msgstr "Presione SPACE o ENTER para reanudar el juego" \ No newline at end of file From ddb6681f91bb3c874121c491009042cb311d1fcf Mon Sep 17 00:00:00 2001 From: facundo Date: Sun, 6 May 2018 20:41:24 -0300 Subject: [PATCH 3/8] more lines of Ui.cpp are translated --- Ui.cpp | 12 ++++++------ traslate/es_AR/main.mo | Bin 970 -> 1273 bytes traslate/es_AR/main.po | 10 +++++++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Ui.cpp b/Ui.cpp index 704cbd6..f09de28 100644 --- a/Ui.cpp +++ b/Ui.cpp @@ -528,15 +528,15 @@ namespace Bastet{ void Ui::HandleHighScores(difficulty_t diff){ HighScores *hs=config.GetHighScores(diff); + setlocale(LC_ALL, ""); + bindtextdomain("main", "/usr/share/locale"); + textdomain("main"); + if(hs->Qualifies(_points)){ - string name=InputDialog(" Congratulations! You got a high score \n Please enter your name"); + string name=InputDialog(_(" Congratulations! You got a high score \n Please enter your name")); hs->InsertHighScore(_points,name); }else{ - MessageDialog("You did not get into\n" - "the high score list!\n" - "\n" - " Try again!\n" - ); + MessageDialog((_("You did not get into\n the high score list! \n \n Try again!\n"))); } } diff --git a/traslate/es_AR/main.mo b/traslate/es_AR/main.mo index 7b959bc782bb5388ad1591f55cbb152bdfaa9fdf..72224bdbabbd9d112457bdc08bf9a01c93a9acb4 100644 GIT binary patch delta 609 zcmYk&F-sgl6u|L0Jw3g|gi9b=C_G7F5duk@CI^WzX-*3p!DjAm+#6kIba(cMO|D5L z2!aU+`2>M9iIugLeh5E-jg4@H;D63b$iUklZ)fJcw|i0PPxdaKl)o$16fsMDC2GVK z5!b7dQg87!KEz#ogkNwR4~BljXXHPI{=o(Eb1dUE#`8D$7;mwzR8LKfDAguu;369* zqxTK^_>_Et+wtNoR`5B_;0v6__xKXmaSZn{o;$>N?iiQwH`3FkG zA`gfv5&sHv3DZ(rdCO-;sJH#Jb?C5<2Gpa;eS3JVmQASgYBd=tNt` zyOUp~jnblgFsW_Xpj!-Om}juB~Mh%Fpp6{FHA_Som8Yn-re(ZeHZ|BP+S zF(Eg?y;Q6#(&fb%wKzi`7dXHr_A$l?4_LtqYVV5LyCXOM!}`0Y5A^4Bw67mkCjk+$ VA`a-mn(j=tGx=lXY)n?T&o3;M6$JnQ diff --git a/traslate/es_AR/main.po b/traslate/es_AR/main.po index d210bb5..92a75b1 100644 --- a/traslate/es_AR/main.po +++ b/traslate/es_AR/main.po @@ -56,4 +56,12 @@ msgstr "Nivel:" #: Ui.cpp:396 msgid "Press SPACE or ENTER to resume the game" -msgstr "Presione SPACE o ENTER para reanudar el juego" \ No newline at end of file +msgstr "Presione SPACE o ENTER para reanudar el juego" + +#: Ui.cpp:532 +msgid " Congratulations! You got a high score \n Please enter your name" +msgstr " Felicitaciones! Obtuvo un puntaje alto \n Por favor ingrese su nombre" + +#: Ui.cpp:539 +msgid "You did not get into\n the high score list! \n \n Try again! \n" +msgstr "No ingresaste en la lista de puntajes altos! \n \n Inténtalo de nuevo! \n" \ No newline at end of file From be2f78ce7c4ea6a9f8ca1de449f5383c510723f9 Mon Sep 17 00:00:00 2001 From: facundo Date: Tue, 8 May 2018 20:09:06 -0300 Subject: [PATCH 4/8] you add more translations --- Ui.cpp | 43 ++++++++++++++++++--------- traslate/es_AR/main.mo | Bin 1273 -> 2155 bytes traslate/es_AR/main.po | 64 +++++++++++++++++++++++++++++++++++------ 3 files changed, 85 insertions(+), 22 deletions(-) diff --git a/Ui.cpp b/Ui.cpp index f09de28..52392ba 100644 --- a/Ui.cpp +++ b/Ui.cpp @@ -118,13 +118,18 @@ namespace Bastet{ } Curses::Curses(){ + + setlocale(LC_ALL, ""); + bindtextdomain("main", "/usr/share/locale"); + textdomain("main"); + if(initscr()==NULL){ - fprintf(stderr,"bastet: error while initializing graphics (ncurses library).\n"); + fprintf(stderr,(_("bastet: error while initializing graphics (ncurses library).\n"))); exit(1); } if(!has_colors()){ endwin(); - fprintf(stderr,"bastet: no color support, sorry. Ask the author for a black and white version."); + fprintf(stderr,(_("bastet: no color support, sorry. Ask the author for a black and white version."))); exit(1); } @@ -536,17 +541,24 @@ namespace Bastet{ string name=InputDialog(_(" Congratulations! You got a high score \n Please enter your name")); hs->InsertHighScore(_points,name); }else{ - MessageDialog((_("You did not get into\n the high score list! \n \n Try again!\n"))); + MessageDialog("You did not get into\n" + "the high score list! \n" + "\n" + " Try again!\n" + ); } } void Ui::ShowHighScores(difficulty_t diff){ HighScores *hs=config.GetHighScores(diff); string allscores; + setlocale(LC_ALL, ""); + bindtextdomain("main", "/usr/share/locale"); + textdomain("main"); if(diff==difficulty_normal) - allscores+="**Normal difficulty**\n"; + allscores+=(_("**Normal difficulty**\n")); else if(diff==difficulty_hard) - allscores+="**Hard difficulty**\n"; + allscores+=(_("**Hard difficulty**\n")); format fmt("%-20.20s %8d\n"); for(HighScores::reverse_iterator it=hs->rbegin();it!=hs->rend();++it){ allscores+=str(fmt % it->Scorer % it->Score); @@ -556,15 +568,20 @@ namespace Bastet{ void Ui::CustomizeKeys(){ Keys *keys=config.GetKeys(); + + setlocale(LC_ALL, ""); + bindtextdomain("main", "/usr/share/locale"); + textdomain("main"); + format fmt( - "Press the key you wish to use for:\n\n" + "Press the key you wish to use for:)\n\n" "%=1.34s\n\n"); - keys->Down=KeyDialog(str(fmt % "move tetromino DOWN (soft-drop)")); - keys->Left=KeyDialog(str(fmt % "move tetromino LEFT")); - keys->Right=KeyDialog(str(fmt % "move tetromino RIGHT")); - keys->RotateCW=KeyDialog(str(fmt % "rotate tetromino CLOCKWISE")); - keys->RotateCCW=KeyDialog(str(fmt % "rotate tetromino COUNTERCLOCKWISE")); - keys->Drop=KeyDialog(str(fmt % "DROP tetromino (move down as much as possible immediately)")); - keys->Pause=KeyDialog(str(fmt % "PAUSE the game")); + keys->Down=KeyDialog(str(fmt % _("move tetromino DOWN (soft-drop)"))); + keys->Left=KeyDialog(str(fmt % _("move tetromino LEFT"))); + keys->Right=KeyDialog(str(fmt % _("move tetromino RIGHT"))); + keys->RotateCW=KeyDialog(str(fmt % _("rotate tetromino CLOCKWISE"))); + keys->RotateCCW=KeyDialog(str(fmt % _("rotate tetromino COUNTERCLOCKWISE"))); + keys->Drop=KeyDialog(str(fmt % _("DROP tetromino (move down as much as possible immediately)"))); + keys->Pause=KeyDialog(str(fmt % _("PAUSE the game"))); } } diff --git a/traslate/es_AR/main.mo b/traslate/es_AR/main.mo index 72224bdbabbd9d112457bdc08bf9a01c93a9acb4..065dec7e3aafa15d9bb94da544083c5e2488bbe4 100644 GIT binary patch literal 2155 zcmaKs&vV;E6vqV=Xw8p8`4P&L;pIe}se;oEGeIS^s;#t6UCXtdlphCXEp6mYt!@7wVdnTUveF;b7&Pb zw}#iy+@8Qy89Pv3FQ9j^9baeg;BtkOlxuQ!{I1-$=Rj-;f~hN+X=aO@S)rs^rH@rX znX<%aD6%1$L}^YH>g1dmPFz~9X{riMl8v}WZGPXDR|+dw zE*=P(5z;*#ip0>GObTtdpYJRAW=CSm|{Fu+Fm51w4QEIXpYJ_SYd}4 zK0ss0KTD2?$<+PN^5b=Gcx4(FX>G)J+q7oXf%Q|Z#??p1ThUJcQCqip<7VH}$|BuM zJ5+DQ^;>tFz34xN;ystR#f*+thdi--n@wXQ9Ts#L{`;kmkiXsVUYanc; zlNXxh{tn921SH4htJ%JEg=UZ2Ym!#CX|sBz;?WMzMItOqkOB@N#{*kT6cv)jg|zID z6U$M{kg}^AHbIX+p|m-QjHDV3H220@-4`Q9W5FLVr|5>5X_=)|K8k!M>LvS3-_G2@ z?kedDooPyPHsQwW#jSn_6)m)VogHGh%f=#ARj(~hP``?GOs>1Fw-)mjTN~J9LspF;xW?e0H4ZaWLQ*Ok&NBV*djzGR=mCx=p)5}r&BeVeY9l0M?CKn68=ndMBISyV zK((k1>WGx#xPX7i8~am8Hq-LMA0>`nr*jktO-b@htC_s@QfkBN;cg6p7s&if+{>fQ zPwwnBqi!QCCB8h;h`LezW>`vj*&g25+YNivh+5Q*TJi2<6M8rzn~j+2al79QyUmy$ G`{ZBSg+~_v delta 527 zcmX}oze@u#6bJCMw%S(fPf&*rPaPaY)U}HR6%|TRa1mTWFSOBXqL*Bu9qb|qf*@2u z@Gt179UYzgC!7UcT!apS-?XLgczk%dm%QA4O?HxvkLlP0L!^-zWuCU>ku@}x&fTPg`lQdylM zTNYH7r81eK4g~qq*ab@A>Bdn|BVOWCVXa+>y+#%fL}0YyzO3_riaxIj!wPaRi(^=8 y_ Date: Tue, 8 May 2018 20:47:55 -0300 Subject: [PATCH 5/8] you add more translations Ui.cpp --- Ui.cpp | 6 +++--- traslate/es_AR/main.mo | Bin 2155 -> 2345 bytes traslate/es_AR/main.po | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Ui.cpp b/Ui.cpp index 52392ba..1c75ca9 100644 --- a/Ui.cpp +++ b/Ui.cpp @@ -536,16 +536,16 @@ namespace Bastet{ setlocale(LC_ALL, ""); bindtextdomain("main", "/usr/share/locale"); textdomain("main"); - + string prueba = _(" You did not get into \n the high score list! \n \n Try again!\n"); if(hs->Qualifies(_points)){ string name=InputDialog(_(" Congratulations! You got a high score \n Please enter your name")); hs->InsertHighScore(_points,name); }else{ - MessageDialog("You did not get into\n" + MessageDialog(prueba/*_("You did not get into\n" "the high score list! \n" "\n" " Try again!\n" - ); + )*/); } } diff --git a/traslate/es_AR/main.mo b/traslate/es_AR/main.mo index 065dec7e3aafa15d9bb94da544083c5e2488bbe4..e30fc8302fa149dfbcd0d69fd9c46b9413ac61f6 100644 GIT binary patch delta 730 zcmYk(ze^lJ6u|NE?lk6%KXQp)5)|JRA^`(xVIdqrIE!n<^FMh*8Ji#LVz$HvGX&m3;6KtXuvWqY9D;Dq+t8C&YF48Zus1~q|72LzTX&dvK z8?ERc>Vm@$k`KH@hD;f`%rcD@w2FFKbfCWn%4-0H41w0I5u=rH+EJ47F;1!?H|T8y4RKgr*T zV@6v}D30u%xjQ-W_@8T6Pl9^P;OFktn*~`5TT=C_5`<1_)`=guP_p9cR_cDOF420} zw9@b+S710RajY~yidXaeppZR&m%2<>WGUp$TGK{eX7Y$RU8 dh0(orlGUUfILnMisFQ=1-3*y?JlRu9{RbJ$T8sby delta 540 zcmXxh!Ab&A6vpw>)odm!ZLB84C|9`=vXum3P%WYe+LX|?o!~17ZEKU!BHtjlzCh5T zO{;We(5^6ii28ribnx8YjC1GQbMHI`<813ANZuO}k_B==u8}tr420**YUtw(9^wL? z;Sx4*4zF+TuaNnQ&YcNl7ZL)-FWEXR+Z|7X7a0B_-HNzCPQH^wP8M~+g&sfHH zq_+7?*8B{E=7p%nH?fXQT*Vj6<0q=l53aMmg`U|KR#B&}-6`ftHXBXWeO3bzkkh1g wu}JE(P%CO4qL^h=bN}IUq0{0}qD|?4mNQ@9E={_-vODcPxwk~`E4Al-0aimMkN^Mx diff --git a/traslate/es_AR/main.po b/traslate/es_AR/main.po index dd1fbd3..95e6abd 100644 --- a/traslate/es_AR/main.po +++ b/traslate/es_AR/main.po @@ -66,6 +66,10 @@ msgstr "Nivel:" msgid "Press SPACE or ENTER to resume the game" msgstr "Presione SPACE o ENTER para reanudar el juego" +#:Ui.cpp:539 +msgid " You did not get into \n the high score list! \n \n Try again!\n" +msgstr " No ingresaste en la lista de puntajes altos! \n \n Intentalo de nuevo! \n" + #: Ui.cpp:541 msgid " Congratulations! You got a high score \n Please enter your name" msgstr " Felicitaciones! Obtuvo un puntaje alto \n Por favor ingrese su nombre" From e3d1c9b4a7ee0a7a6b845811adb364d175e1bc6b Mon Sep 17 00:00:00 2001 From: facundo Date: Wed, 9 May 2018 12:09:13 -0300 Subject: [PATCH 6/8] The last translation is done and the code is verified --- Ui.cpp | 10 +++++----- traslate/es_AR/main.mo | Bin 2345 -> 2435 bytes traslate/es_AR/main.po | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Ui.cpp b/Ui.cpp index 1c75ca9..7f8c4a6 100644 --- a/Ui.cpp +++ b/Ui.cpp @@ -536,16 +536,16 @@ namespace Bastet{ setlocale(LC_ALL, ""); bindtextdomain("main", "/usr/share/locale"); textdomain("main"); - string prueba = _(" You did not get into \n the high score list! \n \n Try again!\n"); + if(hs->Qualifies(_points)){ string name=InputDialog(_(" Congratulations! You got a high score \n Please enter your name")); hs->InsertHighScore(_points,name); }else{ - MessageDialog(prueba/*_("You did not get into\n" + MessageDialog((_(" You did not get into \n the high score list! \n \n Try again!\n")));/*_("You did not get into\n" "the high score list! \n" "\n" " Try again!\n" - )*/); + ));*/ } } @@ -568,13 +568,13 @@ namespace Bastet{ void Ui::CustomizeKeys(){ Keys *keys=config.GetKeys(); - setlocale(LC_ALL, ""); bindtextdomain("main", "/usr/share/locale"); textdomain("main"); + string traslate = _("Press the key you wish to use for:"); /* content is passed to the variable traslate to use the translation function */ format fmt( - "Press the key you wish to use for:)\n\n" + traslate + "\n\n" "%=1.34s\n\n"); keys->Down=KeyDialog(str(fmt % _("move tetromino DOWN (soft-drop)"))); keys->Left=KeyDialog(str(fmt % _("move tetromino LEFT"))); diff --git a/traslate/es_AR/main.mo b/traslate/es_AR/main.mo index e30fc8302fa149dfbcd0d69fd9c46b9413ac61f6..43e909b14e5e4d327b4b08ab5bac02a0b3b434c2 100644 GIT binary patch delta 596 zcmXZZ-z$Sr7{KxK&ircfV`DQv+Oc9+5*IF3Vi&XBzlN9qMx|5m>3f- zrN%LaO}L9OJi>N-L_fY`GyY%{JvBg^Y>XQ`1-Hf z!#K(T3n-23AV0OoBn=&6C!V6LzrsPh!vXw8&QyI3m30x6`XQ8y#BqL+i~J9{sh4Q0JpMP-QO#wo49-{n;=L89m1Bd&Pb*^iifyiLtF<)f z+OfiktZ^KjOBualw)9peuQ$_9O6M{U`pS1n}Wt2;d delta 506 zcmXBQze~eF6u|L!Nva)+)zq5$+YC|)3buoT5Tu}kixj(b76)#K|$>P#vAbQ4m4=zUFc7K9|eo?p->Cz8k)~&ZQ6~a*iC3%jC78Bi1aDO{`)L zkFkztIEjxqg$a(~CvM;`j^MhT8lb-4LS5fX4dsYInTa+!*hl^F7V~(A0Y2d_+ALbc zJuKh}Y9U>m!7KFf9uK(0D{k`~u&EZ%!6sgyC!xp(1Fh%}b;IIldO!u4k{zT;gH8)- zq5iEy^stSq*uxAyBTZiDbX|gafiG;~N>*eZ&vClJ;D&*2^ngp4U=6>K3k*XGn;^&2 r$6>Fx*3jZL^w47TX1t8 Date: Wed, 9 May 2018 15:38:14 -0300 Subject: [PATCH 7/8] modifies translation --- traslate/es_AR/main.mo | Bin 2435 -> 2434 bytes traslate/es_AR/main.po | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/traslate/es_AR/main.mo b/traslate/es_AR/main.mo index 43e909b14e5e4d327b4b08ab5bac02a0b3b434c2..566f070d92225483867001811de16f15b39885f8 100644 GIT binary patch delta 246 zcmXBMJrBWf5XbQ&9%^A|QZTcEX1DPQ zya9>9wAhh=pE#z@0lPjLw;R@(VnyB-Q`` delta 247 zcmXBMzY76z7{~F4I6nr4D?bMLTHK_IolP09EC$OBN2EJBOiED}i``$KY~(+%nQih9 z_zRTsKI-Xt)$=@`XQi+8-D}wtk+CL{!V9+XidoFZL^4=K9a~t$E^;CZq-0G?;}&zc z#~^>k3f{1cZ;WCo{?8e4Y5W2vgF1^Ac5s6Qd}1Cy7(C1-L=>7>L+f-1JtBsuX095~ g+^Iculs%eyDyb}QqI&k6K5+XJ$9I%}I%@au7gr}Fi~s-t diff --git a/traslate/es_AR/main.po b/traslate/es_AR/main.po index 1910c33..c9ae32b 100644 --- a/traslate/es_AR/main.po +++ b/traslate/es_AR/main.po @@ -72,7 +72,7 @@ msgstr " No ingresaste en la lista de puntajes altos! \n \n Intental #: Ui.cpp:541 msgid " Congratulations! You got a high score \n Please enter your name" -msgstr " Felicitaciones! Obtuvo un puntaje alto \n Por favor ingrese su nombre" +msgstr " Felicitaciones! Obtuviste puntaje alto, por favor ingresa tu nombre" #: Ui.cpp:559 msgid "**Normal difficulty**\n" From fac3dc6b7bbd2096d5f145bdffc0ce54d48ff56a Mon Sep 17 00:00:00 2001 From: fernandoblanco Date: Mon, 28 May 2018 23:10:41 -0300 Subject: [PATCH 8/8] se agrega archivo README_ES de documentacion para traduccion --- README_ES.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 README_ES.md diff --git a/README_ES.md b/README_ES.md new file mode 100644 index 0000000..ddb888f --- /dev/null +++ b/README_ES.md @@ -0,0 +1,30 @@ + TRANSALTION TO SPANISH LANGUAGE +you should follow the following steps. + +1.INSTALL gettext + +http://archive.linuxfromscratch.org/lfs-museum/5.1-pre1/LFS-BOOK-5.1-PRE1-HTML/chapter06/gettext.html + +2. + +# xgettext --keyword=_ --language=C --add-comments --sort-output -o main.pot main.cpp + +3. + +# msginit -l es_AR.UTF-8 -o traslate/es_AR/main.po -i main.pot + +4. + +# msgfmt -c -v -o traslate/es_AR/main.mo traslate/es_AR/main.po + +5. +# sudo cp -v main.mo /usr/share/locale/es_AR/LC_MESSAGES/ +6. + +Insert the following lines in all the functions that there is text on + +setlocale(LC_ALL, ""); + +bindtextdomain("main", "/usr/share/locale"); + +textdomain("main");