-
Notifications
You must be signed in to change notification settings - Fork 548
[Localization] Add generator error messages #7531
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how the whole "fix a typo" process would work ?
I suspect (hope) there's not need to update all .xlf
files but, beside that, I would not know how to proceed.
It works by editing |
Build failure Test results2 tests failed, 86 tests passed.Failed tests
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍
Couple items we could discuss as a team:
- Should we take that change to improve the error messages?
- That is make sure all sentences start with a capital letter and end with a period.
- Remove error codes from the error message (redundant)
- Always put methods and properties between ' ' (apostrophes)
- This is gonna be tedious but I suggest we consider adding
<comment>
for most errors to tell translators what to avoid translating (e.g: "runtime", "BaseType", "binding", etc.- Background, I dogfooded the French translations of VSMac and a lot of things were translated when they didn't need to be.
- We need guidance on that, the Android team might be facing the same questions and the IDE folks might be able to help us too.
Build failure Test results2 tests failed, 86 tests passed.Failed tests
|
Build failure 🔥 Build failed 🔥 |
Build failure ✅ Build succeeded |
Build failure Test results2 tests failed, 86 tests passed.Failed tests
|
Build failure |
Build failure |
Build failure Test results2 tests failed, 86 tests passed.Failed tests
|
Build failure Test results2 tests failed, 86 tests passed.Failed tests
|
Build failure Test results1 tests failed, 87 tests passed.Failed tests
|
Build failure |
Build failure 🔥 Build failed 🔥 |
build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: should we create src/bgen subdirectory and put every new file there? The src/ directory is getting crowded... this would only be for new files in this PR, but eventually all the bgen source files would go there.
Co-Authored-By: Rolf Bjarne Kvinge <[email protected]>
Build failure ✅ Build succeeded |
Build failure |
Build failure |
Build failure Test results1 tests failed, 87 tests passed.Failed tests
|
sb.Append (ParameterGetMarshalType (new MarshalInfo (this, mi) { IsAligned = aligned, EnumMode = enum_mode } )); | ||
} catch (BindingException ex) { | ||
throw new BindingException (ex.Code, ex.Error, ex, "{0} in method `{1}'", ex.Message, mi.Name); | ||
throw new BindingException (1078, ex.Error, ex, ex.Message, mi.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we go from ex.Code to 1078? Is ex.Code always the same, if it is not, we are going to get the wrong message.
BindingFlags.GetProperty); | ||
|
||
var errorMessage = prop == null ? String.Format (bgen.Resources._default, errorCode) : | ||
(String) prop.GetValue (null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(String) prop.GetValue (null); | |
prop.GetValue (null) as string; |
To avoid cast exceptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cast exceptions are usually easier to diagnose than null reference exceptions, so I think the current code is fine.
internal Resources() { | ||
} | ||
|
||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file isn't code-formatted to our guidelines. Edit->Format->Format Document on Visual Studio does the trick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is auto-generated.
BindingFlags.GetProperty); | ||
|
||
var errorMessage = prop == null ? String.Format (bgen.Resources._default, errorCode) : | ||
(String) prop.GetValue (null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cast exceptions are usually easier to diagnose than null reference exceptions, so I think the current code is fine.
Build failure |
I will be making multiple PRs for localization changes, hopefully one per tool. This PR is copying what android does for localization for more context see: dotnet/android#3900 and https://github.com/xamarin/monodroid/wiki/Localization