[Dextrose] [PATCH v3 Word] Updated translated word when language to translate is changed. (Ticket #2210)

Ishan Bansal ishan at seeta.in
Wed Oct 13 07:00:24 EDT 2010


Hi James

I have attached the screen shots of the word activity.
If you check the the initialword1.png and initialword2.png you will see that
even after we change the
language from 'Spanish' to 'French' the translated word remains same untill
you retype the new word.
Now if you check the finalword1.png and finalword2.png you will see that the
translated word is updated
simultaneously as the language is changed from 'Spanish' to 'French'

Steps to reproduce-
1. Run word activity and type a text to translate.
2. It will show you the translated word. Now try to change the language
    from 'Spanish' to 'French'.
3. You will notice no changes in the translated text.
4. Make the changes as mentioned below in the patch and again run word
    activity. Try to redo the same process (steps 1-2).
5. You will notice that as the language is changed the translated text is
also changed.

Hope that i have answered all the questions which you had regarding the
patch.
Please let me know in case of any further questions. Thank you for reviewing

the patch. Appreciate it.

Regards

Ishan

On Tue, Oct 12, 2010 at 12:32 PM, Ishan Bansal <ishan at seeta.in> wrote:

> New global variable 'newtotranslate' added to update the translated text
> when
> the language to translate is being changed.
>
> Signed-off-by: Ishan Bansal <ishan at seeta.in>, Anubhav Aggarwal <
> anubhav at seeta.in>
> ---
>  pippy_app.py |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> v1->v2 : Global variable removed and subject updated.
> v2->v3 : Co-author fields added in accordance with the guidelines for patch
> submission
>
> diff --git a/pippy_app.py b/pippy_app.py
> index b9a5a25..f9b0be7 100644
> --- a/pippy_app.py
> +++ b/pippy_app.py
> @@ -49,6 +49,7 @@ class WordsActivity(ViewSourceActivity):
>         self.fromlang = "English"
>         self.tolang   = "Spanish"
>         self.languagemodel = LanguageModel.LanguageModel()
> +        self.newtotranslate = 'none'
>
>         # Main layout.
>         hbox = gtk.HBox(homogeneous=True)
> @@ -151,6 +152,8 @@ class WordsActivity(ViewSourceActivity):
>
>     def lang2combo_cb(self, combo):
>         self.languagemodel.SetLanguages("English",
> self.langs[combo.get_active()])
> +        self.translated.set_text("")
> +        self.totranslate_cb(self.newtotranslate)
>
>     def lang1sel_cb(self, column):
>         # FIXME: Complete the text entry box
> @@ -177,6 +180,7 @@ class WordsActivity(ViewSourceActivity):
>
>     def totranslate_cb(self, totranslate):
>         entry = totranslate.get_text()
> +        self.newtotranslate = totranslate
>         # Ask for completion suggestions
>         if not entry:
>             return
> --
> 1.7.0.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20101013/544f079b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initialword1.png
Type: image/png
Size: 114474 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20101013/544f079b/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initialword2.png
Type: image/png
Size: 114920 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20101013/544f079b/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: finalword1.png
Type: image/png
Size: 86931 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20101013/544f079b/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: finalword2.png
Type: image/png
Size: 87253 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20101013/544f079b/attachment-0007.png>


More information about the Dextrose mailing list