-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: localize TabBar by settings #286
Fix: localize TabBar by settings
- Loading branch information
Showing
4 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Threading.Tasks; | ||
using Xamarin.Forms; | ||
|
||
namespace DotNetRu.Clients.UI.Localization | ||
{ | ||
public class LocalizableTab : Tab | ||
{ | ||
private string resourceName; | ||
|
||
public string ResourceName | ||
{ | ||
get => this.resourceName; | ||
set | ||
{ | ||
this.resourceName = value; | ||
this.Update(); | ||
} | ||
} | ||
|
||
public void Update() | ||
{ | ||
this.Title = AppResources.ResourceManager.GetString(this.ResourceName); | ||
} | ||
|
||
protected override Task<Page> OnPopAsync(bool animated) | ||
{ | ||
// temporary workaround while https://github.com/xamarin/Xamarin.Forms/issues/8581 not fixed | ||
return base.OnPopAsync(animated: false); | ||
} | ||
} | ||
} |