-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Language stuff #108
base: master
Are you sure you want to change the base?
Language stuff #108
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.
How are map-specific locales supposed to be created? I don't see anything changed on the editor side.
@@ -2,7 +2,7 @@ | |||
<Import Project="../UserProperties.props" Condition="Exists('../UserProperties.props')" /> | |||
<PropertyGroup> | |||
<TargetFramework>net48</TargetFramework> | |||
<LangVersion>7.3</LangVersion> | |||
<LangVersion>9</LangVersion> |
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.
What was this bump necessary for?
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.
1>Locale.cs(30,105): Error CS8370 : Feature 'target-typed object creation' is not available in C# 7.3. Please use language version 9.0 or greater.
1>Locale.cs(63,39): Error CS8370 : Feature 'target-typed object creation' is not available in C# 7.3. Please use language version 9.0 or greater.
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.
private static ReadOnlyDictionary<string, Dictionary<string, string>> mapSpecificTranslations = new (new Dictionary<string, Dictionary<string, string>>());
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.
In that case, simply don't use the new style of constructor. We should take a C# version bump more seriously and do a proper upgrade that takes advantage of it, but not now.
Create |
You aren't supposed to ever create the zip manually though, when you build the map from the editor that should be the zip you distribute. There needs to be good editor tooling for creating localizations. How much work would be involved with switching to the localization library most other mods now use? I think that would be a better route than continuing to reinvent the wheel, assuming it covers all our needs. |
To read the localised strings added with Language Helper, it's the same method as reading vanilla keys ( Wherever you need it, add a As for adding the strings to the game, you create a |
Fixes #107