SirJohnK / LocalizationResourceManager.Maui

Enhanced .NET MAUI version of the XCT LocalizationResourceManager.
MIT License
144 stars 12 forks source link

Translate Text, X0..X9 bindable parameters #34

Open stephenquan opened 2 weeks ago

stephenquan commented 2 weeks ago

Enhance Translate markup extension by:

Examples:


<!-- Weather is the string resource "The weather today is {0}." -->
<!-- Temperature is from your view model, e.g. "32 degrees celsius" -->
<!-- Outputs "The weather today is 32 degrees celsius."
<Label Text={localization:Translate Weather, X0={Binding Temperature}} />

<!-- Greeting is the string resource "Hello {0}, the answer to life the universe and everything is {1}!" -->
<!-- Name is "Arthur Dent" -->
<!-- Answer is 42 -->
<!-- Outputs "Hello Arthur Dent, the answer to life the universe and everything is 42! -->
<Label Text="{localization:Translate Greeting, X0={Binding Name}, X1={Binding Answer}}" />

N.B. These changes supersede the TranslateBinding markup extension introduced in https://github.com/SirJohnK/LocalizationResourceManager.Maui/pull/16