Skip to content

Commit 17b0a8d

Browse files
committed
move localizations
1 parent 9f558c8 commit 17b0a8d

File tree

7 files changed

+16
-10
lines changed

7 files changed

+16
-10
lines changed

src/packages/core/extension-registry/models/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import type { ManifestGlobalContext } from './global-context.model.js';
2525
import type { ManifestHeaderApp, ManifestHeaderAppButtonKind } from './header-app.model.js';
2626
import type { ManifestHealthCheck } from './health-check.model.js';
2727
import type { ManifestIcons } from './icons.model.js';
28-
import type { ManifestLocalization } from './localization.model.js';
2928
import type { ManifestMenu } from './menu.model.js';
3029
import type { ManifestMenuItem, ManifestMenuItemLinkKind, ManifestMenuItemTreeKind } from './menu-item.model.js';
3130
import type { ManifestPackageView } from './package-view.model.js';
@@ -69,7 +68,6 @@ export type * from './global-context.model.js';
6968
export type * from './header-app.model.js';
7069
export type * from './health-check.model.js';
7170
export type * from './icons.model.js';
72-
export type * from './localization.model.js';
7371
export type * from './menu-item.model.js';
7472
export type * from './menu.model.js';
7573
export type * from './mfa-login-provider.model.js';
@@ -133,7 +131,6 @@ export type ManifestTypes =
133131
| ManifestHealthCheck
134132
| ManifestIcons
135133
| ManifestItemStore
136-
| ManifestLocalization
137134
| ManifestMenu
138135
| ManifestMenuItem
139136
| ManifestMenuItemTreeKind

src/packages/core/localization/components/ui-culture-input/ui-culture-input.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { css, html, customElement, query, state, property } from '@umbraco-cms/b
33
import type { UUISelectEvent } from '@umbraco-cms/backoffice/external/uui';
44
import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui';
55
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
6-
import type { ManifestLocalization } from '@umbraco-cms/backoffice/extension-registry';
6+
import type { ManifestLocalization } from '@umbraco-cms/backoffice/localization';
77
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
88

99
interface UmbCultureInputOption {

src/packages/core/extension-registry/models/localization.model.ts renamed to src/packages/core/localization/extensions/localization.extension.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface MetaLocalization {
1515
* The value is used to describe the language of the translations according to the extension system
1616
* and it will be set as the `lang` attribute on the `<html>` element.
1717
* @see https://en.wikipedia.org/wiki/Language_localisation#Language_tags_and_codes
18-
* @examples ["en-us", "en-gb", "da-dk"]
18+
* @example ["en-us", "en-gb", "da-dk"]
1919
*/
2020
culture: string;
2121

@@ -25,7 +25,7 @@ export interface MetaLocalization {
2525
* The value is used to describe the direction of the translations according to the extension system
2626
* and it will be set as the `dir` attribute on the `<html>` element. It defaults to `ltr`.
2727
* @see https://en.wikipedia.org/wiki/Right-to-left
28-
* @examples ["ltr"]
28+
* @example ["ltr"]
2929
* @default "ltr"
3030
*/
3131
direction?: 'ltr' | 'rtl';
@@ -42,3 +42,9 @@ export interface MetaLocalization {
4242
*/
4343
localizations?: UmbLocalizationDictionary;
4444
}
45+
46+
declare global {
47+
interface UmbExtensionManifestMap {
48+
UmbLocalizationExtension: ManifestLocalization;
49+
}
50+
}

src/packages/core/localization/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ import './localize-number.element.js';
44
import './localize-relative-time.element.js';
55

66
export * from './registry/localization.registry.js';
7+
export type * from './extensions/localization.extension.js';
78
export { UmbUiCultureInputElement } from './components/index.js';

src/packages/core/localization/manifests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ManifestLocalization } from '../extension-registry/models/localization.model.js';
1+
import type { ManifestLocalization } from './extensions/localization.extension.js';
22

33
export const manifests: Array<ManifestLocalization> = [
44
{

src/packages/core/localization/registry/localization.registry.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { UmbLocalizationRegistry } from './localization.registry.js';
22
import { aTimeout, expect } from '@open-wc/testing';
3-
import type { ManifestLocalization } from '@umbraco-cms/backoffice/extension-registry';
3+
import type { ManifestLocalization } from '@umbraco-cms/backoffice/localization';
44
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
55

66
//#region Localizations

src/packages/core/localization/registry/localization.registry.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
UMB_DEFAULT_LOCALIZATION_CULTURE,
66
} from '@umbraco-cms/backoffice/localization-api';
77
import { umbLocalizationManager } from '@umbraco-cms/backoffice/localization-api';
8-
import type { ManifestLocalization, UmbBackofficeExtensionRegistry } from '@umbraco-cms/backoffice/extension-registry';
8+
import type { UmbBackofficeExtensionRegistry } from '@umbraco-cms/backoffice/extension-registry';
9+
import type { ManifestLocalization } from '@umbraco-cms/backoffice/localization';
910
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
1011
import { UmbStringState } from '@umbraco-cms/backoffice/observable-api';
1112
import { combineLatest } from '@umbraco-cms/backoffice/external/rxjs';
@@ -37,6 +38,7 @@ export class UmbLocalizationRegistry {
3738

3839
/**
3940
* Get the current registered translations.
41+
* @returns {Map<string, UmbLocalizationSetBase>} Returns the registered translations
4042
*/
4143
get localizations() {
4244
return umbLocalizationManager.localizations;
@@ -111,7 +113,7 @@ export class UmbLocalizationRegistry {
111113

112114
/**
113115
* Load a language from the extension registry.
114-
* @param locale The locale to load.
116+
* @param {string} locale The locale to load.
115117
*/
116118
loadLanguage(locale: string) {
117119
this.#currentLanguage.setValue(locale.toLowerCase());

0 commit comments

Comments
 (0)