I am trying to pull a string from my language file and to include a variable during the execution. The issue is that depending on the language, the variable will be positioned differently. In the case of Hebrew, it seems impossible to put the variable at the end. I cannot use string interpolation due to the fact that I am pulling the string from the resource file. See video Any hints?
The code that I am working with is:
// the {0} should be positioned at the end of the Hebrew string
<data name="BeforeStartingYourMeeting" xml:space="preserve">
<value>{0}פני התחלת הישיבה שלך</value>
</data>
I am trying to use the string later on in the code the following way:
string timeLeft = appointment.Start.Subtract(DateTime.Now).TotalMinutes + " min";
string timeBeforeMeetingLabel = string.Format(Properties.Resources.BeforeStartingYourMeeting, timeLeft);
I have read:
This case is exactly describing my issue:
The thought of the below workaround but I end up with the same issue:
<data name="BeforeStartingYourMeeting" xml:space="preserve">
<value>פני התחלת הישיבה שלך {time}</value>
</data>
The code here shows clearly the issue. Different input strings but same output!!! It looks like it has to do with the display of the string which has to be in the specific RTL format. If I do a copy/past of the generated line into a textpad, the second line is different.