Closed mcka-dev closed 4 years ago
This is fixed in code now with https://github.com/perpetualKid/GetText.NET/commit/fe7fd691d0df8e95d84c1d3178b4319fed26c185, still need to publish new package.
Few notes, as documentation isn't yet finished:
Extractor would not be able to find ICatalog replacement forms like T._
but only the standard forms of "GetString", "GetParticularString", "GetPluralString", "GetParticularPluralString".
It does find the strings in your case only because of the WinForms text property assignment (BurnButton.Text =
).
The extractor implementation is now updated to observed conditional expressions only in assignment operations for ".Text", ".HeaderText" or ".ToolTipText" properties, such as button.Text = (condition) ? "TrueText" : "FalseText"
. If you are on Windows Forms platform, you can use GetText.Net.WindowsForms in such instances and don't need "T._" or "catalog.GetString" to translate text properties in Windows Form (i.e. you don't need to write button.Text = (condition) ? catalog.GetString("TrueText") : catalog.GetString("FalseText")
, however there is no harm other that the "TrueText" and "FalseText" would be referenced twice in the catalog template".
For other string assignments which are not any of .Text property mentioned, have the Extractor resolve conditional expression, you would use the traditional pattern such as string test = (condition) ? catalog.GetString("TrueText") : catalog.GetString("FalseText")
I'll work on documentation once I've the package published
Hi in GetText.NET.Extractor v0.9.5.0 error during extraction ?: operator
If there is a degeneracy in the code::
burnButton.Text = enable ? "&Burn" : "&Cancel";
that is extracted as a single word: "&Burn&Cancel"
I expected two words "&Burn" and "&Cancel"
Here are a few screenshots