Conversation
Packages register a `L10nDefinition` (DBO class + payload columns) via the `L10nDefinitionCollecting` event in their bootstrap file. At the end of a package installation or update, `SyncL10nTables` creates or extends the `<table>_l10n` tables (objectID, nullable languageID for monolingual content, payload columns) using `DatabaseTableChangeProcessor`, so all changes are recorded in the sql log and dropped on package uninstallation.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a dedicated L10N storage system for localized content of database objects, replacing the previous approach of storing such content as i18n phrases in
wcf1_language_item. Localized values now live in a per-object<table>_l10ntable (objectID, nullablelanguageID, payload columns), read/written through a singleL10nStorageservice. Captcha questions and user options are migrated to the new system as the first adopters.The L10N system
L10nStorage– the only writer/reader for*_l10ntables. Exchanges values ascolumnName => [languageID => value], supports monolingual content (languageID IS NULL, exposed asL10nStorage::MONOLINGUAL), per-column language sets, a deterministic fallback resolver (resolveValue()), and a correlatedgetSubSelect()for sortable/filterable list queries.L10nDefinition– describes a localized table (primary table,*_l10ntable, object column, payload columns). Optionally declares support for synchronization with language variables via anidentifierColumnName+ per-column language-variable suffixes.IL10nFormField/TL10nFormFieldadd->l10n()support to form builder fields, mutually exclusive with the phrase-based->i18n()mode.TCollectionL10ntrait batch-loads the localized values of all objects in aDatabaseObjectCollectionin a single query;OptionCollection/UserOptionCollection/CaptchaQuestionCollectionand theL10n*Listclasses wire this into lists and grid views.L10nTextFilterfilters grid columns on localized values.Synchronization with language variables
Delivered objects (e.g. shipped user options) keep their
wcf.*phrases as the sourceof truth and mirror them into the L10N storage:
l10nIdentifiercolumn (the language-variable base name,NULLfor admin-created objects), and the*_l10ntable anisPristineflag.L10nDefinitionCollectingevent;SyncL10nLanguageItemsruns at the end of every install/update and refreshes pristine rows from the phrases, preserving values an administrator changed locally.isPristineis maintained automatically insideL10nStorage::setValues(): a delivered object keeps the flag per language while the value is unchanged; a changed value or a user-created object is written as modified.L10nLanguageItemSyncprovides reusable one-timemigrate()/ ongoingsync()helpers (usable by other packages).Migrations
DatabaseObjectBuilderwith dedicated create/update commands and events.wcf.user.option.*phrases intowcf1_user_option_l10n; system options stay linked (pristine, kept in sync), admin-created options own their values and their obsolete phrases are removed.UserOptionPackageInstallationPluginandUserOptionImporterwrite through the new builder / L10N storage; the ACP forms, grid views, cache builder and templates read localized titles/descriptions from the collection.Notes
*_l10ntables are created via explicit database scripts (install + update); no automatic table provisioning.PackageInstallationDispatcherinvokes the sync after the bootstrap loader is rebuilt, so listeners added by the same update are already active.See #6109
See #6290