Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Simplify usage of resx files by generating the source code similar to c# but with f# semantics #802
Create a resx code file generator
I propose we create a code file generator similar to
An alternative is to use a resx type provider, but that doesn't have the benefit of recognizing
<data name="InputError" xml:space="preserve"> <value>Wrong input '%s', expected maximum %i characters.</value> </data>
This would translate to:
/// Returns a localized string similar to "Wrong input '%s', expected maximum %i characters." let InputError = sprintf """Wrong input '%s', expected maximum %i characters."""
Which could be called something like this:
let maxChars = 20 let inputStr = Console.ReadLine() if inputStr.Length > maxChars then InputError inputStr maxChars
The existing way of approaching this problem in F# is to use a C# project to do the heavy lifting.
Pros and Cons
The advantages of making this adjustment to F# are:
The disadvantages of making this adjustment to F# are
Estimated cost (XS, S, M, L, XL, XXL): S
Questions and suggestions of this nature have existed before, but I think this version is simple enough to be picked up (I hope ;).
On SO this has been asked before and caused confusion:
And on Github:
Please tick all that apply: