3.9 KiB
3.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-17T16:12:01.659566+00:00 | zai-org/GLM-5-FP8 | 1 | e841c5ffb3f98572 |
Resources
Purpose
This module provides localization support for the PSD (Power Spectral Density) Report component within the DTS Viewer application. It exists to enable XAML-based string lookup for UI elements, allowing the report configuration interface to be localized. The module contains a WPF markup extension for direct XAML binding and a strongly-typed resource class with strings specific to PSD report settings, data selection, and modifications.
Public Interface
TranslateExtension class (public, inherits MarkupExtension)
TranslateExtension(string key)- Constructor accepting the resource key to look up.override object ProvideValue(IServiceProvider serviceProvider)- Returns the localized string for the given_key. Returns#stringnotfound#if the key is null or empty, or#stringnotfound# <key>if the resource lookup fails.
StringResources class (internal sealed)
static ResourceManager ResourceManager { get; }- Returns the cachedResourceManagerinstance for theDTS.Viewer.PSDReport.Resources.StringResourcesresource bundle.static CultureInfo Culture { get; set; }- Gets or sets the current thread'sCurrentUICulturefor resource lookups.static string DataHeader { get; }- Localized string "Data".static string DataSelectionHeader { get; }- Localized string "Data selection".static string GraphsDefaultTitle { get; }- Localized string "Graphs".static string ModificationsHeader { get; }- Localized string "Modify".static string PSDHeader { get; }- Localized string "PSD".static string PSDResultsHeader { get; }- Localized string "Results".static string PSDSettingsHeader { get; }- Localized string "PSD Settings".static string SettingsTitle { get; }- Localized string "Settings".static string TestsDefaultTitle { get; }- Localized string "Tests".
Invariants
- The
TranslateExtensionclass is decorated with[MarkupExtensionReturnType(typeof(string))], guaranteeing it returns a string when used in XAML. - The
ProvideValuemethod never returnsnull; it returns a fallback string beginning with#stringnotfound#on lookup failure. - The
StringResources.ResourceManagerproperty lazily initializes exactly once. - All resource string properties in
StringResourcesareinternaland return non-null values if the.resxfile is properly configured.
Dependencies
- Depends on:
System(forIServiceProvider,String),System.Windows.Markup(forMarkupExtension,MarkupExtensionReturnTypeAttribute),System.Resources(forResourceManager),System.Globalization(forCultureInfo). - Depended on by: XAML files within
DTS.Viewer.PSDReportthat use{local:Translate KeyName}syntax, and any code in that assembly requiring localized strings.
Gotchas
- The
TranslateExtensionclass is defined in namespaceDTS.Viewer.PSDReportbut referencesDTS.Viewer.PSDReport.Resources.StringResources. This namespace structure must be accounted for in XAML namespace declarations. - The
NotFoundconstant value#stringnotfound#is hardcoded and will appear in the UI if a resource key is missing, which may be visible to end users during development. - The
StringResources.Designer.csfile is auto-generated; manual changes will be overwritten. Edit the corresponding.resxfile instead. - The
PSDResultsHeaderresource exists in bothDTS.Viewer.PSDReport.ResourcesandDTS.Viewer.PSDReportResults.Resourceswith the same default value "Results". This duplication may indicate shared terminology but could lead to inconsistency if localized differently.