private static void ReportL10NMissingString(string id, string englishText)
{
if (ApplicationUpdateSupport.ChannelName.StartsWith("Developer"))
{
//It would be a nice improvement to l10n to allow us to write directly to the source-code TMX file, so that the
//developer just has to check it in. But for now, we can write out a TMX element to the "local" TMX which the developer
//can put in the distribution one. We prefix it with CopyToDistributionTmx_, which he will have to remove, because
//otherwise the next time we look for this string, it would get found and we would lose the ability to point out the
//problem to the developer.
LocalizationManager.GetDynamicString("Bloom", "CopyToDistributionTmx_" + id, englishText);
var longMsg =
String.Format(
"Dear Developer: Ignore this if you are looking at a 3rd-party book that we don't ship with Bloom."+
" Please add this dynamic string to the english.tmx file: Id=\"{0}\" English =\"{1}\". " +
"The code at this time cannot add this for you, but we have created an element in your local TMX which you can copy over." +
" Search for CopyToDistributionTmx_, and remember to remove that from the ID. It needs to be " +
"added to the en.tmx, so that it can show up in the list of things to be localized even " +
"when the user has not encountered this part of the interface yet.",
id,
englishText);
NonFatalProblem.Report(ModalIf.None, PassiveIf.Alpha, "Missing l10n: " + englishText, longMsg);
}
else
{
NonFatalProblem.Report(ModalIf.None, PassiveIf.Alpha, "Missing l10n: " + englishText,
"Please report that " + id + " needs to be " +
"added to the en.tmx, so that it can show up in the list of things to be localized even " +
"when the user has not encountered this part of the interface yet.");
}
}