-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged global resx into BlazingCoffee.Shared
- Loading branch information
1 parent
3380bfd
commit c6f2945
Showing
15 changed files
with
524 additions
and
97 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
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,19 +1,20 @@ | ||
@using System.Net.Http | ||
@using System.Net.Http.Json | ||
@using System.Collections.ObjectModel | ||
@using Microsoft.JSInterop | ||
@using Microsoft.AspNetCore.Components.Forms | ||
@using Microsoft.AspNetCore.Components.Authorization | ||
@using Microsoft.AspNetCore.Components.Routing | ||
@using Microsoft.AspNetCore.Components.Web | ||
@using Microsoft.AspNetCore.Components.WebAssembly.Http | ||
@using Microsoft.JSInterop | ||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication | ||
@using Microsoft.AspNetCore.Authorization | ||
@using Microsoft.Extensions.Localization | ||
@using Telerik.DataSource | ||
@using Telerik.Blazor | ||
@using Telerik.Blazor.Components | ||
@using Telerik.Blazor.Services | ||
@using BlazingCoffee.Client | ||
@using BlazingCoffee.Client.Shared | ||
@using BlazingCoffee.Shared | ||
@using BlazingCoffee.Shared.Models | ||
@using Telerik.Blazor.Components | ||
@using Telerik.DataSource | ||
@using Telerik.Blazor | ||
@using System.Collections.ObjectModel | ||
@using Microsoft.AspNetCore.Authorization | ||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication | ||
@using Microsoft.Extensions.Localization | ||
@using BlazingCoffee.Shared.Models |
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,25 +1,28 @@ | ||
using BlazingCoffee.Shared.Resources; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Telerik.Blazor.Resources; | ||
using Microsoft.Extensions.Localization; | ||
using Telerik.Blazor.Services; | ||
|
||
namespace BlazingCoffee.Shared.Localization | ||
{ | ||
public class TelerikLocalizer : ITelerikStringLocalizer | ||
{ | ||
public string this[string name] | ||
private readonly IStringLocalizer<Global> globalLocalizer; | ||
|
||
public TelerikLocalizer(IStringLocalizer<Global> globalLocalizer) | ||
{ | ||
get | ||
{ | ||
return GetStringFromResource(name); | ||
} | ||
this.globalLocalizer = globalLocalizer; | ||
} | ||
|
||
public string this[string name] => GetStringFromResource(name); | ||
|
||
public string GetStringFromResource(string key) | ||
{ | ||
return TelerikMessages.ResourceManager.GetString(key, TelerikMessages.Culture); | ||
var localString = TelerikMessages.ResourceManager.GetString(key, TelerikMessages.Culture); | ||
if (string.IsNullOrWhiteSpace(localString)) | ||
{ | ||
return globalLocalizer.GetString(key); | ||
} | ||
return localString; | ||
} | ||
} | ||
} |
Oops, something went wrong.