Merge lp:~yuningdodo/ubiquity/fix-lang-trans-page into lp:ubiquity

Proposed by Yu Ning
Status: Rejected
Rejected by: Dimitri John Ledkov
Proposed branch: lp:~yuningdodo/ubiquity/fix-lang-trans-page
Merge into: lp:ubiquity
Diff against target: 25 lines (+4/-0)
2 files modified
ubiquity/frontend/gtk_ui.py (+3/-0)
ubiquity/i18n.py (+1/-0)
To merge this branch: bzr merge lp:~yuningdodo/ubiquity/fix-lang-trans-page
Reviewer Review Type Date Requested Status
Colin Watson (community) Needs Fixing
Review via email: mp+121122@code.launchpad.net

Description of the change

Hi ubiquity developer,

There is a problem in the ubiquity language selection page, that when you select different language the widgets inside the notebook got translated immediately as expected, while the widgets outside the notebook never got updated.

This may not be a big issue, and to fix it we do not need much to change in the code.

Please review my patch and ask me to improve it.

Thanks,
Ning

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

On Fri, Aug 24, 2012 at 06:15:28AM -0000, Yu Ning wrote:
> There is a problem in the ubiquity language selection page, that when
> you select different language the widgets inside the notebook got
> translated immediately as expected, while the widgets outside the
> notebook never got updated.

The language page's cleanup handler calls translate with just_me=False,
which should already have the effect of retranslating all widgets. It's
intentional (for performance) that they aren't retranslated immediately
upon selecting a different language, but they should be retranslated
when you leave the language page.

Therefore, if this patch has any effect, it suggests that perhaps this
segment of code is failing to work properly:

            for toplevel in self.toplevels:
                if toplevel.get_name() != 'live_installer':
                    for c in self.all_children(toplevel):
                        widgets.append((c, None))

Or perhaps something else in that general area.

At any rate, I don't think we should apply this patch directly because I
would expect it to slow down navigation through the language selection
list box quite noticeably; but perhaps this review will help find the
true problem, or perhaps if you can describe the problem a bit more then
we can dig into it (although I'm on vacation for the next week).

 review needs-fixing

review: Needs Fixing
Revision history for this message
Yu Ning (yuningdodo) wrote :

On 08/24/2012 02:34 PM, Colin Watson wrote:
> Review: Needs Fixing
>
> On Fri, Aug 24, 2012 at 06:15:28AM -0000, Yu Ning wrote:
>> There is a problem in the ubiquity language selection page, that when
>> you select different language the widgets inside the notebook got
>> translated immediately as expected, while the widgets outside the
>> notebook never got updated.
> The language page's cleanup handler calls translate with just_me=False,
> which should already have the effect of retranslating all widgets. It's
> intentional (for performance) that they aren't retranslated immediately
> upon selecting a different language, but they should be retranslated
> when you leave the language page.
>
> Therefore, if this patch has any effect, it suggests that perhaps this
> segment of code is failing to work properly:
>
> for toplevel in self.toplevels:
> if toplevel.get_name() != 'live_installer':
> for c in self.all_children(toplevel):
> widgets.append((c, None))
>
> Or perhaps something else in that general area.
>
> At any rate, I don't think we should apply this patch directly because I
> would expect it to slow down navigation through the language selection
> list box quite noticeably; but perhaps this review will help find the
> true problem, or perhaps if you can describe the problem a bit more then
> we can dig into it (although I'm on vacation for the next week).
>
> review needs-fixing
>

Thanks for your review, Colin. If the behavior that not translating all
the widgets is designed to be, then I think we do not need to do any
_fix_ to it.

Revision history for this message
Colin Watson (cjwatson) wrote :

What was the original problem you noticed? Was it just code inspection,
or was there some visible lack of translation in the installer? It is
intended that all widgets be suitably translated before they're actually
seen - just not necessarily immediately when changing language and
before changing page.

Revision history for this message
Yu Ning (yuningdodo) wrote :

On 08/24/2012 03:52 PM, Colin Watson wrote:
> What was the original problem you noticed? Was it just code inspection,
> or was there some visible lack of translation in the installer? It is
> intended that all widgets be suitably translated before they're actually
> seen - just not necessarily immediately when changing language and
> before changing page.
>

Well, in oem projects we may use some other language, such as Chinese,
by default, then the expander label would show some Chinese words, which
would not changed to the language we chosen in that page, that was how
we noticed the problem.

And there is something different as what you described, the expander
label still didn't got translated when you switch to the next page of
language. This may be a bug.

I think I could modify my branch to do some fix as your suggestions.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

obsolete, expander text translation was fixed in a different way by Colin a while back.

Unmerged revisions

5604. By Yu Ning

Fix the problem that some widgets in the language selection page won't got their translatation updated when different language is selected.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubiquity/frontend/gtk_ui.py'
2--- ubiquity/frontend/gtk_ui.py 2012-08-20 05:17:16 +0000
3+++ ubiquity/frontend/gtk_ui.py 2012-08-24 06:14:26 +0000
4@@ -386,6 +386,9 @@
5 self.translate_widgets(lang=lang, widgets=widgets, reget=False)
6 self.set_page_title(current_page, lang)
7
8+ # in case some widgets outside the notebook not get translated.
9+ self.translate_widgets(lang=lang, widgets=None, reget=False)
10+
11 # Allow plugins to provide a hook for translation.
12 for p in pages:
13 # There's no sense retranslating the page we're leaving.
14
15=== modified file 'ubiquity/i18n.py'
16--- ubiquity/i18n.py 2012-08-17 11:50:18 +0000
17+++ ubiquity/i18n.py 2012-08-24 06:14:26 +0000
18@@ -196,6 +196,7 @@
19 'partman-basicfilesystems/text/specify_mountpoint',
20 'grub_device_dialog': 'grub-installer/bootdev',
21 'grub_device_label': 'grub-installer/bootdev',
22+ 'install_progress_text': 'ubiquity/install/checking',
23 # TODO: it would be nice to have a neater way to handle stock buttons
24 'quit': 'ubiquity/imported/quit',
25 'back': 'ubiquity/imported/go-back',

Subscribers

People subscribed via source and target branches

to status/vote changes: