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

Enable culture analyzer and fix issues #3678

Merged
merged 23 commits into from
Jul 11, 2022

Conversation

Evangelink
Copy link
Member

I have tried to group changes per project, set of projects.

@Evangelink Evangelink force-pushed the culture-info-analyzers branch 2 times, most recently from 531a497 to ca7d537 Compare May 30, 2022 17:19
@Evangelink Evangelink changed the title Fix culture issues on tests Enable culture analyzer and fix issues May 31, 2022
@Evangelink Evangelink enabled auto-merge (squash) June 2, 2022 16:45
@Evangelink Evangelink changed the title Enable culture analyzer and fix issues [After #3716] Enable culture analyzer and fix issues Jun 2, 2022
@Evangelink Evangelink disabled auto-merge June 2, 2022 18:48
@Evangelink Evangelink changed the title [After #3716] Enable culture analyzer and fix issues Enable culture analyzer and fix issues Jun 2, 2022
@Evangelink Evangelink enabled auto-merge (squash) June 2, 2022 18:48
@@ -478,7 +478,7 @@ private void LoadAndInitialize(DataCollectorSettings dataCollectorSettings, stri

if (!IsUriValid(dataCollectorUri) && !TryGetUriFromFriendlyName(dataCollectorSettings.FriendlyName, out dataCollectorUri))
{
LogWarning(string.Format(CultureInfo.CurrentUICulture, Resources.Resources.UnableToFetchUriString, dataCollectorSettings.FriendlyName));
LogWarning(string.Format(CultureInfo.CurrentCulture, Resources.Resources.UnableToFetchUriString, dataCollectorSettings.FriendlyName));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for changing this from ui culture to current culture?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The analyzer is complaining about it :)

Rule documentation says:

CultureInfo.CurrentUICulture is used only to retrieve localized resources by using an instance of the System.Resources.ResourceManager class.

@nohwnd
Copy link
Member

nohwnd commented Jun 7, 2022

Imho in testhost we are setting current_UI culuture for the process and so I guess not using currentUIculture for formatting changes how messages are written to the screen. Did you do any tests to make sure that is not the case?

@Evangelink
Copy link
Member Author

@nohwnd I haven't done any special test, I was expecting our test suite to catch translation issues. I will try to see if I can run something manually to confirm things are ok.

@nohwnd
Copy link
Member

nohwnd commented Jun 9, 2022

I doubt that will happen, all the tests are in english, and all the computers are running in english.

@Evangelink
Copy link
Member Author

@nohwnd I am too used to roslyn where one CI is running in foreign language to ensure translation are tested.

@Evangelink Evangelink disabled auto-merge June 9, 2022 07:18
@Evangelink Evangelink force-pushed the culture-info-analyzers branch 2 times, most recently from 4ad9320 to ef0d664 Compare June 23, 2022 14:50
@Evangelink
Copy link
Member Author

I have run a couple of manual tests using French culture and I haven't seen any problem. Do you know any special test we can run?

@nohwnd
Copy link
Member

nohwnd commented Jun 30, 2022

I have run a couple of manual tests using French culture and I haven't seen any problem. Do you know any special test we can run?

Does that mean you are able to run on non-english system, and revert the output back to english usnig that env variable and vice versa? That is imho the purpose of that env variable.

@Evangelink
Copy link
Member Author

@nohwnd I confirm that fr-fr is working well on a US machine, and en-us on an FR machine works too.

@Evangelink Evangelink merged commit b2e2126 into microsoft:main Jul 11, 2022
@Evangelink Evangelink deleted the culture-info-analyzers branch July 11, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants