Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/date.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/// <reference types="@nextcloud/typings" />

import { getCanonicalLocale } from './locale'

/**
/*!
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/// <reference types="@nextcloud/typings" />

import { getCanonicalLocale } from './locale'

declare let window: Nextcloud.v27.WindowWithGlobals

Expand Down
8 changes: 1 addition & 7 deletions lib/gettext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*!
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
Expand All @@ -22,9 +22,6 @@ import GetText from 'node-gettext'

import { getLanguage } from '.'

/**
* @notExported
*/
class GettextBuilder {

private locale?: string
Expand Down Expand Up @@ -57,9 +54,6 @@ class GettextBuilder {

}

/**
* @notExported
*/
class GettextWrapper {

private gt: GetText
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*!
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/locale.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*!
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/registry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="@nextcloud/typings" />

/**
/*!
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
Expand Down
6 changes: 1 addition & 5 deletions lib/translation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*!
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
Expand All @@ -15,15 +15,13 @@ import { generateFilePath } from '@nextcloud/router'
import DOMPurify from 'dompurify'
import escapeHTML from 'escape-html'

/** @notExported */
interface TranslationOptions {
/** enable/disable auto escape of placeholders (by default enabled) */
escape?: boolean
/** enable/disable sanitization (by default enabled) */
sanitize?: boolean
}

/** @notExported */
interface TranslationVariableReplacementObject<T> {
/** The value to use for the replacement */
value: T
Expand All @@ -33,14 +31,12 @@ interface TranslationVariableReplacementObject<T> {

/**
* Extracts variables from a translation key
* @notExported
*/
type ExtractedVariables<T extends string> =
T extends `${string}{${infer Variable}}${infer Rest}`
? Variable | ExtractedVariables<Rest>
: never

/** @notExported */
type TranslationVariables<K extends string> = Record<ExtractedVariables<K>, string | number | TranslationVariableReplacementObject<string | number>>

/**
Expand Down
21 changes: 11 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"@types/node": "^20.17.16",
"@types/node-gettext": "^3.0.6",
"@vitest/coverage-v8": "^3.0.4",
"@zamiell/typedoc-plugin-not-exported": "^0.3.0",
"gettext-parser": "^8.0.0",
"mock-xmlhttprequest": "^8.4.1",
"typedoc": "^0.27.6",
"typedoc-plugin-missing-exports": "^3.1.0",
"vite": "^6.0.11",
"vitest": "^3.0.4"
},
Expand Down
19 changes: 11 additions & 8 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["./lib/index.ts", "./lib/gettext.ts"],
"out": "dist/doc",
"excludePrivate": true,
"navigationLinks": {
"GitHub": "https://github.com/nextcloud-libraries/nextcloud-l10n/",
"Nextcloud": "https://docs.nextcloud.com/server/stable/developer_manual/basics/front-end/l10n.html"
}
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["./lib/index.ts", "./lib/gettext.ts"],
"out": "dist/doc",
"excludePrivate": true,
"plugin": [
"typedoc-plugin-missing-exports"
],
"navigationLinks": {
"GitHub": "https://github.com/nextcloud-libraries/nextcloud-l10n/",
"Nextcloud": "https://docs.nextcloud.com/server/stable/developer_manual/basics/front-end/l10n.html"
}
}
Loading