You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
755 B
36 lines
755 B
12 months ago
|
using System;
|
||
|
using System.Globalization;
|
||
|
using PropertyModels.Localilzation;
|
||
|
using StabilityMatrix.Avalonia.Languages;
|
||
|
|
||
|
namespace StabilityMatrix.Avalonia.Controls;
|
||
|
|
||
|
internal class PropertyGridCultureData : ICultureData
|
||
|
{
|
||
|
/// <inheritdoc />
|
||
|
public bool Reload() => false;
|
||
|
|
||
|
/// <inheritdoc />
|
||
|
public CultureInfo Culture => Cultures.Current ?? Cultures.Default;
|
||
|
|
||
|
/// <inheritdoc />
|
||
|
public Uri Path => new("");
|
||
|
|
||
|
/// <inheritdoc />
|
||
|
public string this[string key]
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
if (Resources.ResourceManager.GetString(key) is { } result)
|
||
|
{
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
return key;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// <inheritdoc />
|
||
|
public bool IsLoaded => true;
|
||
|
}
|