Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

fix regression in ExtensionCore not working when updates are available#8964

Merged
clefebvre merged 1 commit intolinuxmint:masterfrom
eli-schwartz:gettext
Nov 22, 2019
Merged

fix regression in ExtensionCore not working when updates are available#8964
clefebvre merged 1 commit intolinuxmint:masterfrom
eli-schwartz:gettext

Conversation

@eli-schwartz
Copy link
Contributor

@eli-schwartzeli-schwartz commentedNov 17, 2019
edited
Loading

In commit6ac295a, Settings>Applets>Download gained the ability to display the number of available updates, using an ngettext-translated message. However, it has never worked since ngettext was never imported in the file in question, so it simply raised a traceback.

In the same commit,gettext.install() was taught to declarenames="ngettext", but as per the python documentation, thenames= argument requires a sequence (of one or more aliases to declare in the global namespace), not a string. So it tried to check if it could install the gettext functions:{'x', 't', 'e', 'g'}, which was wrong.

The fix is to either importngettext directly, so it can be used as-is, or globally installngettext by passing it as a one-item list to thegettext.install() function. I've done the latter.

mtb-xt and m-aciek reacted with thumbs up emoji
@eli-schwartz
Copy link
ContributorAuthor

@clefebvre
Copy link
Member

Already done in#8959.

@eli-schwartz
Copy link
ContributorAuthor

I... don't even understand that other PR. It seems to be re-doing058e3a1, fixing some gtk deprecation, and switching one incorrect use of gettext.install() for another, none of which has anything to do with the commit message (that claims this is for python 3.8).

@eli-schwartz
Copy link
ContributorAuthor

@clefebvre

When the ngettext call was initially added in6ac295a, I think the person who added it tried to usegettext.install(..., names="gettext"), but that's totally incorrect. Please reopen this PR. I can either leave it to continue explicitly importing ngettext from gettext (it works for me on python 3.8) or switch the gettext.install() call to usenames=["gettext"] as it is required to be a sequence and not a string (well, a string is a sequence too, but you don't exactly get the right answer when you useset('ngettext') instead ofset(['ngettext'])).

I initially used from gettext import ngettext, because I wasn't sure under what circumstances the gettext.install() was guaranteed to have run, BTW. But I'm totally okay with either solution.

@collinsscollinss reopened thisNov 22, 2019
In commit6ac295a,Settings>Applets>Download gained the ability to display the number ofavailable updates, using an ngettext-translated message. However, it hasnever worked since ngettext was never imported in the file in question,so it simply raised a traceback.In the same commit, gettext.install() was taught to declarenames="ngettext", but as per the python documentation, the names=argument requires a sequence (of one or more aliases to declare in theglobal namespace), not a string. So it tried to check if it couldinstall the gettext functions: {'x', 't', 'e', 'g'}, which was wrong.The fix is to either import ngettext directly, so it can be used as-is,or globally install ngettext by passing it as a one-item list to thegettext.install() function. I've done the latter.
@eli-schwartz
Copy link
ContributorAuthor

I've switched to using gettext.install() with the correct sequence.

@clefebvreclefebvre merged commit5174ec9 intolinuxmint:masterNov 22, 2019
@eli-schwartzeli-schwartz deleted the gettext branchNovember 24, 2019 02:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@eli-schwartz@clefebvre@collinss

[8]ページ先頭

©2009-2026 Movatter.jp