Localization Admin

PowerPortalsPro ships a LocalizationAdmin component — a turnkey, SystemAdmin-gated panel for operating the string-localization pipeline at runtime. Drop <LocalizationAdmin /> into a role-gated page and an admin can see how the localization cache is configured and built, rebuild it without restarting the host, machine-translate localization files, and download a merged per-culture snapshot. The framework component does the heavy lifting; your portal supplies the page, the role gate, and the nav link — the same split the Site Admin page uses.

What the panel shows

LocalizationAdmin renders several sections, each backed by the framework's localization services:

  • Configuration — A read-only summary of how the warmup is wired — whether every available table is localized or only a configured set, the tables to localize, the web-resource path pattern, the registered localization directories and files, and the default culture. These mirror the LocalizationOptions your host registers.
  • Translate a file — An embedded LocalizationTranslator that machine-translates a localization file into another culture. It self-gates on availability — rendering nothing when no translation provider is configured, or an install prompt when the managed solution is missing. The Translation documentation page covers it in full.
  • Download merged bundle — One button per culture that has any keys in the cache. Each downloads the merged localization JSON for that culture — the union of every source (Dataverse metadata, web resources, and folder files) resolved into a single file.
  • Sources — A grid of the per-source load records from the most recent warmup, in load order — including how many keys each source contributed and how many of those overrode an earlier value. The quickest way to see why a string resolved the way it did.
  • Reload — Rebuilds the string-localization cache from every configured source without restarting the host. The rebuild is atomic, so readers keep seeing the previous values until the new dictionary is ready.

Wiring it up

Like the Site Admin page, LocalizationAdmin is gated behind the synthetic SystemAdmin role claim stamped by SystemAdminClaimsTransformer — the Site Admin documentation page covers how that claim is configured. Drop the component inside a role-gated page:

Surface it in the nav

Wrap the nav entry in an <AuthorizeView Roles="SystemAdmin"> so non-admins don't see a link they can't follow:

Controlling what gets localized

The Configuration panel reflects the LocalizationOptions your host registers. LocalizeAllAvailableTables switches between localizing every table and only an explicit set added via AddTableToLocalize; the directory, file, and web-resource settings tell the warmup where to find folder-based and web-resource localization sources. The full set of knobs is in the API reference below.

Related: the Translation page

The translate-a-file panel embedded here is the same LocalizationTranslator documented on the Translation page, which walks through configuring a translation provider (e.g. Azure AI Translator) and installing the managed solution that backs it.

API reference

LocalizationOptions drives what the Configuration panel surfaces and what the warmup pulls from. Its members are summarized below.

LocalizationOptions Class

Properties

Name
Type
Default
Description
DefaultCultureCultureInfo
The default culture used when no specific culture is requested.
LocalizationDirectoriesIReadOnlyList<string>
The list of directory paths to scan for localization files.
LocalizationFilesIReadOnlyList<string>
The list of individual file paths to load localization strings from.
LocalizeAllAvailableTablesbool
True
When true (the default), localized strings are loaded from the metadata of every table in the Dataverse environment and LocalizationOptions.TablesToLocalize is ignored. Set to false to restrict localization to the tables registered via AddTableToLocalize(System.String) / IEnumerable{System.String}). Recommended for any portal that supports multiple languages: set this to false and register only the tables your portal actually surfaces. Loading metadata for every table makes the localization warmup noticeably slower and inflates the string cache with labels, choices, and view names you'll never display — and that cost is paid per installed language. When you opt into the subset, register every table whose labels appear in the UI (grids, forms, subgrids, charts), because a displayed table that isn't localized renders its raw keys instead of labels. account, contact, and adx_externalidentity are seeded into the list by default.
TablesToLocalizeIReadOnlyList<string>
The Dataverse table names whose metadata (labels, choices, views) should be exported as localized strings. Ignored when LocalizationOptions.LocalizeAllAvailableTables is true.
UrlCultureStrategyUrlCultureStrategy
PathPrefix
Controls whether (and how) the active culture is reflected in the request URL. Defaults to UrlCultureStrategy.PathPrefix (default culture bare, other cultures under a /{culture} prefix). See Options.UrlCultureStrategy for the available modes. Only has an effect on multi-culture sites.
Name: DefaultCulture
Type: CultureInfo
Description: The default culture used when no specific culture is requested.
Name: LocalizationDirectories
Type: IReadOnlyList<string>
Description: The list of directory paths to scan for localization files.
Name: LocalizationFiles
Type: IReadOnlyList<string>
Description: The list of individual file paths to load localization strings from.
Name: LocalizeAllAvailableTables
Type: bool
Default: True
Description: When true (the default), localized strings are loaded from the metadata of every table in the Dataverse environment and LocalizationOptions.TablesToLocalize is ignored. Set to false to restrict localization to the tables registered via AddTableToLocalize(System.String) / IEnumerable{System.String}). Recommended for any portal that supports multiple languages: set this to false and register only the tables your portal actually surfaces. Loading metadata for every table makes the localization warmup noticeably slower and inflates the string cache with labels, choices, and view names you'll never display — and that cost is paid per installed language. When you opt into the subset, register every table whose labels appear in the UI (grids, forms, subgrids, charts), because a displayed table that isn't localized renders its raw keys instead of labels. account, contact, and adx_externalidentity are seeded into the list by default.
Name: TablesToLocalize
Type: IReadOnlyList<string>
Description: The Dataverse table names whose metadata (labels, choices, views) should be exported as localized strings. Ignored when LocalizationOptions.LocalizeAllAvailableTables is true.
Name: UrlCultureStrategy
Type: UrlCultureStrategy
Default: PathPrefix
Description: Controls whether (and how) the active culture is reflected in the request URL. Defaults to UrlCultureStrategy.PathPrefix (default culture bare, other cultures under a /{culture} prefix). See Options.UrlCultureStrategy for the available modes. Only has an effect on multi-culture sites.

Methods

Name
Parameters
Type
Description
AddLocalizationDirectorystring relativeDirectoryPath
void
Adds a directory path to scan for localization files.
AddLocalizationFilestring relativeFilePath
void
Adds a single localization file path to the list.
AddTablesToLocalizeIEnumerable<string> tables
void
Adds a collection of Dataverse table names to localize.
AddTableToLocalizestring tableName
void
Adds a single Dataverse table name to localize.
Name: AddLocalizationDirectory
Parameters: string relativeDirectoryPath
Type: void
Description: Adds a directory path to scan for localization files.
Name: AddLocalizationFile
Parameters: string relativeFilePath
Type: void
Description: Adds a single localization file path to the list.
Name: AddTablesToLocalize
Parameters: IEnumerable<string> tables
Type: void
Description: Adds a collection of Dataverse table names to localize.
Name: AddTableToLocalize
Parameters: string tableName
Type: void
Description: Adds a single Dataverse table name to localize.