Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix python local weekday name #8478

Merged
merged 1 commit into from
Jul 14, 2017
Merged

fix python local weekday name #8478

merged 1 commit into from
Jul 14, 2017

Conversation

Rechi
Copy link
Member

@Rechi Rechi commented Dec 4, 2015

If you want to get the weekdays locale name in a python script it now display it in the right language. Previously it was always english.

@MartijnKaijser
Copy link
Member

@tamland ping

@tamland
Copy link
Member

tamland commented Dec 6, 2015

Looks sane to me. Perhaps @Montellese wants to have a look as well?

@tamland tamland added Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality Backport: Needed Component: Python labels Dec 6, 2015
@MartijnKaijser MartijnKaijser added this to the K***** 17.0-alpha1 milestone Dec 9, 2015
@MartijnKaijser
Copy link
Member

@Montellese can you give your blessings?

@Montellese
Copy link
Member

I don't have much experience with std::locale but looks ok.

@razzeee
Copy link
Member

razzeee commented Dec 27, 2015

jenkins build this please

@Rechi
Copy link
Member Author

Rechi commented Dec 29, 2015

I don't know why on some systems we aren't using setlocale on all platforms, which support it.
I tested on Linux with setlocale and there it works.

@razzeee
Copy link
Member

razzeee commented Dec 29, 2015

Build is already gone :/
jenkins build this please

@@ -300,6 +302,7 @@ void CLangInfo::CRegion::SetGlobalLocale()
strLocale = lcl.name();
current_locale = current_locale.combine< std::collate<wchar_t> >(lcl);
current_locale = current_locale.combine< std::ctype<wchar_t> >(lcl);
current_locale = current_locale.combine< std::time<wchar_t> >(lcl);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@Rechi
Copy link
Member Author

Rechi commented Jan 5, 2016

Now setlocale is execute on all platforms and after std::locale setting.
I tested on Debian and got the expected result.
I'm not sure if the reordering causes issues.

@razzeee
Copy link
Member

razzeee commented Jan 7, 2016

@tamland & @Montellese please check again

jenkins build this please

@Rechi
Copy link
Member Author

Rechi commented Jan 27, 2016

ping

@phate89
Copy link
Contributor

phate89 commented Feb 2, 2016

I don't know too much about locale but setlocale isn't used in windows because it causes crashes if executed in multiple threads:
#6402

@Rechi
Copy link
Member Author

Rechi commented Mar 2, 2016

@phate89 tested on windows and Kodi isn't crashing. If you want I can also exclude setlocale from Windows, just do be on the save side.

@phate89
Copy link
Contributor

phate89 commented Mar 2, 2016

It doesn't always crash but it crashes when executed from multiple threads.. Or at least is what I understood from that thread. For this reason we always fidef _wsetlocale in windows

@Rechi
Copy link
Member Author

Rechi commented Mar 5, 2016

I've excluded windows from the setlocale section, because it doesn't fix the problem on windows.
Maybe we can also remove the following workaround 1681377?

@MartijnKaijser
Copy link
Member

@tamland @Paxxi ping

@Paxxi
Copy link
Member

Paxxi commented Jan 17, 2017

Haven't touched setlocale in a while but I think it should be safe on windows now that we have unified our crt usage.

@Rechi
Copy link
Member Author

Rechi commented Jan 17, 2017

@Paxxi I can drop _wsetlocale again on windows again, because it doesn't fix the issue.

This allows to use datetime.strftime('%A') and get the weekday name in the language kodi is set to, instead of always getting it in English.

@Paxxi
Copy link
Member

Paxxi commented Jan 17, 2017

You can leave it as is, calling the w methods are preferred as the normal methods are just wrappers for them anyway

@Rechi
Copy link
Member Author

Rechi commented Mar 21, 2017

jenkins build this please

@Rechi
Copy link
Member Author

Rechi commented Mar 21, 2017

Some strange error for Android-X86 occurred.
Try again, jenkins build this please

@razzeee
Copy link
Member

razzeee commented Apr 11, 2017

jenkins build this please

@Rechi
Copy link
Member Author

Rechi commented Jul 9, 2017

any objections?

@Rechi Rechi added the v18 Leia label Jul 14, 2017
@Rechi Rechi added this to the L 18.0-alpha1 milestone Jul 14, 2017
@Rechi Rechi merged commit ee0d877 into xbmc:master Jul 14, 2017
@Rechi Rechi deleted the pythonLocale branch July 14, 2017 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Python Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants