// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.Framework.Localization { /// /// A locale specific string. /// public struct LocalizedString { /// /// Creates a new . /// /// The name of the string in the resource it was loaded from. /// The actual string. public LocalizedString(string name, string value) : this(name, value, resourceNotFound: false) { } /// /// Creates a new . /// /// The name of the string in the resource it was loaded from. /// The actual string. /// Whether the string was found in a resource. Set this to false to indicate an alternate string value was used. public LocalizedString(string name, string value, bool resourceNotFound) { Name = name; Value = value; ResourceNotFound = resourceNotFound; } public static implicit operator string (LocalizedString localizedString) { return localizedString.Value; } /// /// The name of the string in the resource it was loaded from. /// public string Name { get; } /// /// The actual string. /// public string Value { get; } /// /// Whether the string was found in a resource. If false, an alternate string value was used. /// public bool ResourceNotFound { get; } /// /// Returns the actual string. /// /// The actual string. public override string ToString() => Value; } }