-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass localisation where buttons can self-retranslate.
- Loading branch information
Showing
9 changed files
with
99 additions
and
53 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
FunctionZero.Maui.Controls/MarkupExtensions/TranslationService.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace FunctionZero.Maui.Services | ||
{ | ||
public class LanguageProvider | ||
{ | ||
public LanguageProvider(Func<string[]> getLookup, string languageName) | ||
{ | ||
GetLookup = getLookup; | ||
LanguageName = languageName; | ||
} | ||
public Func<string[]> GetLookup { get; } | ||
public string LanguageName { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:tz="clr-namespace:SampleApp.Translations" | ||
x:Class="SampleApp.Mvvm.Pages.Translations.TranslationHomePage" | ||
Title="TranslationHomePage"> | ||
<VerticalStackLayout> | ||
<CollectionView ItemsSource="{Binding AvailableLanguages}" SelectionMode="Single"> | ||
<CollectionView.ItemTemplate> | ||
<DataTemplate> | ||
<Label Text="{Binding Key}"/> | ||
</DataTemplate> | ||
</CollectionView.ItemTemplate> | ||
</CollectionView> | ||
<HorizontalStackLayout> | ||
<Button Text="English" Command="{Binding SetLanguageCommand}" CommandParameter="english"/> | ||
<Button Text="German" Command="{Binding SetLanguageCommand}" CommandParameter="german"/> | ||
</HorizontalStackLayout> | ||
<Label Text="{tz:Lang TextId=E_Welcome}"/> | ||
<Button Text="{Binding DoTheThingCommand.Text}" Command="{Binding DoTheThingCommand}"/> | ||
|
||
</VerticalStackLayout> | ||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using FunctionZero.Maui.MarkupExtensions; | ||
using FunctionZero.Maui.Services; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SampleApp.Translations | ||
{ | ||
public class LangService : BaseLanguageService<LangStrings> | ||
{ | ||
} | ||
} |