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

Localized string key in generated .editorconfig #39602

Open
20chan opened this issue Oct 31, 2019 · 6 comments
Open

Localized string key in generated .editorconfig #39602

20chan opened this issue Oct 31, 2019 · 6 comments
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it New Feature - Editor Config Tenet-Globalization A feature does not work properly in a given locale or does not respect locale settings.
Milestone

Comments

@20chan
Copy link

20chan commented Oct 31, 2019

Version Used:

Visual Studio 2019 16.3.6, Korean, C#

Steps to Reproduce:

  1. Set language to Korean
  2. Generate .editorconfig from Tools->Options

Expected Behavior:

Only localized strings in comments.

Actual Behavior:

Key and value contains localized strings.

#### 명명 스타일 ####

# 명명 규칙

dotnet_naming_rule.interface_should_be_i로_시작.severity = suggestion
dotnet_naming_rule.interface_should_be_i로_시작.symbols = interface
dotnet_naming_rule.interface_should_be_i로_시작.style = i로_시작

full .editorconfig: gist

@20chan
Copy link
Author

20chan commented Nov 4, 2019

I found what was problem.

var namingStylePreferences = optionSet.GetOption(SimplificationOptions.NamingPreferences, language);
var serializedNameMap = AssignNamesToNamingStyleElements(namingStylePreferences);

Here gets options by local language. And it's serializedNameMap was used into raw string.

editorconfig.AppendLine($"dotnet_naming_symbols.{serializedNameMap[symbolSpecification.ID]}.applicable_kinds = {symbolSpecification.ApplicableSymbolKindList.ToEditorConfigString()}");
editorconfig.AppendLine($"dotnet_naming_symbols.{serializedNameMap[symbolSpecification.ID]}.applicable_accessibilities = {symbolSpecification.ApplicableAccessibilityList.ToEditorConfigString(language)}");
editorconfig.AppendLine($"dotnet_naming_symbols.{serializedNameMap[symbolSpecification.ID]}.required_modifiers = {symbolSpecification.RequiredModifierList.ToEditorConfigString(language)}");

20chan added a commit to 20chan/roslyn that referenced this issue Nov 4, 2019
From dotnet#39602

Naming styles parts in .editorconfig contains localized **key**.
`serializedNameMap` should be English, not localized language.
@20chan
Copy link
Author

20chan commented Nov 4, 2019

I submitted a PR here.

@jinujoseph jinujoseph added Area-IDE Bug Tenet-Globalization A feature does not work properly in a given locale or does not respect locale settings. labels Nov 4, 2019
@jinujoseph jinujoseph added this to the 16.5 milestone Nov 4, 2019
@jinujoseph jinujoseph added the 4 - In Review A fix for the issue is submitted for review. label Nov 4, 2019
@sharwell
Copy link
Member

sharwell commented Nov 4, 2019

The localized strings appearing in keys and values are taken from user-modifiable content in the UI. Even if we account for all the default cases, it will be impossible to account for cases where the user has modified options prior to generating the .editorconfig file.

@sharwell
Copy link
Member

sharwell commented Nov 4, 2019

Here is the UI where names can be changed by users:

image

@20chan
Copy link
Author

20chan commented Nov 5, 2019

이미지 004

Right, it was because just default generated keys are in localized language and also sample identifiers are.
But it just makes me confused. I had no idea why it is also localized when I generated .editorconfig fire at first, I didn't change anything at all. Default-generated localized .editorconfig seems like rude for other global programmers.

All codes-stuffs are my mistakes, I closed my PR.
And topic of this issue should be changed or something else.

@sharwell
Copy link
Member

sharwell commented Nov 5, 2019

@20chan This has been reported a few times now. I'm going to check with one of our localization team members and see if there is anything else we can do to improve the experience.

@jinujoseph jinujoseph removed the 4 - In Review A fix for the issue is submitted for review. label Dec 13, 2019
@jinujoseph jinujoseph modified the milestones: 16.5, Backlog Dec 13, 2019
@jinujoseph jinujoseph added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it New Feature - Editor Config Tenet-Globalization A feature does not work properly in a given locale or does not respect locale settings.
Projects
None yet
Development

No branches or pull requests

4 participants