Code review comment for lp:~mikemc/ubuntu-sso-client/cross-platform-translations-1074116

Revision history for this message
Brian Curtin (brian.curtin) wrote :

134 + if fallback:
135 + g_func = translation.get_gettext(TEST_DOMAIN, fallback)
136 + else:
137 + g_func = translation.get_gettext(TEST_DOMAIN)

There's nothing functionally wrong with this, but it's a bit repetitive. Would something like the below part work?

args = [TEST_DOMAIN]
args.append(fallback) if fallback else None
gfunc = translation.get_gettext(*args)

** I don't know if that's readable to everyone so I'm not marking this "Needs Fixing". I prefer to avoid if/else blocks that only choose one line or a very similar other line.

review: Approve

« Back to merge proposal