generaltranslation 9.1.0 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # generaltranslation
2
2
 
3
+ ## 9.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2017](https://github.com/generaltranslation/gt/pull/2017) [`b00b93e`](https://github.com/generaltranslation/gt/commit/b00b93eb3b830b8528ef3dbd5f503ff76d1b338a) Thanks [@logflash](https://github.com/logflash)! - Add opt-in `<T>` id-tagging (`_tagIds`). When enabled via `withGTConfig(config, { _tagIds: true })`, each `<T>`/`<Tx>` exposes its published-translation hash as a `data-_gt-hash` attribute, so tooling (localized replay, in-context QA) can map a rendered DOM node back to its published translation. Off by default; apps not using it pay nothing. No effect on `gt()` strings, and DOM-only — skipped on React Native.
8
+
9
+ Span injection is kept to the minimum necessary: when a `<T>` renders a single host element the attribute is placed directly on that element (no wrapper), so `<T>` keeps copying the source 1:1 and stays valid inside parents that reject a `<span>` (e.g. `<tr>`/`<select>`/`<ul>`). A layout-neutral `display:contents` span is injected only when there is no element to carry the attribute (bare text or a fragment).
10
+
11
+ ## 9.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#2018](https://github.com/generaltranslation/gt/pull/2018) [`9b3eb92`](https://github.com/generaltranslation/gt/commit/9b3eb92fb1a916b5f47d15f51a9f39f6c62840a9) Thanks [@eoinest](https://github.com/eoinest)! - Preserve proper-noun casing when diagnostic reasons are combined into user-facing messages.
16
+
3
17
  ## 9.1.0
4
18
 
5
19
  ### Minor Changes
@@ -18,9 +18,6 @@ function stripSentence(text) {
18
18
  }
19
19
  return trimmed.slice(0, end);
20
20
  }
21
- function lowercaseFirstWord(text) {
22
- return text.replace(/^[A-Z][a-z]/, (match) => match.toLowerCase());
23
- }
24
21
  function formatDetails(details) {
25
22
  if (!details) return "";
26
23
  const detailText = Array.isArray(details) ? details.join(", ") : details;
@@ -33,12 +30,12 @@ function formatDiagnosticErrorDetails(error) {
33
30
  }
34
31
  function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
35
32
  const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
36
- const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${lowercaseFirstWord(stripSentence(why))}` : whatHappened;
33
+ const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
37
34
  const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
38
35
  const messageParts = [
39
36
  whatAndWhy,
40
37
  reassurance,
41
- shouldCombineWayOut ? `${stripSentence(fix)}, or ${lowercaseFirstWord(stripSentence(wayOut))}` : fix,
38
+ shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
42
39
  shouldCombineWayOut ? void 0 : wayOut,
43
40
  formatDetails(details)
44
41
  ].filter((part) => !!part).map(ensureSentence);
@@ -57,4 +54,4 @@ const API_VERSION = "2026-03-06.v1";
57
54
  //#endregion
58
55
  export { createDiagnosticMessage as a, libraryDefaultLocale as c, defaultRuntimeApiUrl as i, defaultBaseUrl as n, formatDiagnosticErrorDetails as o, defaultCacheUrl as r, defaultTimeout as s, API_VERSION as t };
59
56
 
60
- //# sourceMappingURL=api-BOEGbEF6.mjs.map
57
+ //# sourceMappingURL=api-rqq7klYe.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-rqq7klYe.mjs","names":[],"sources":["../src/settings/settings.ts","../src/logging/diagnostics.ts","../src/settings/settingsUrls.ts","../src/translate/api.ts"],"sourcesContent":["export const libraryDefaultLocale = 'en' as const;\nexport const defaultTimeout = 60000;\n","export type DiagnosticSeverity = 'Error' | 'Warning';\n\n/**\n * Text slots follow the five-part error message model:\n * what happened, reassurance, why it happened, how to fix it, and a way out.\n * Clauses that are combined into another sentence should use their intended\n * in-sentence casing.\n */\nexport type DiagnosticMessageInput = {\n source?: string;\n severity?: DiagnosticSeverity;\n whatHappened: string;\n reassurance?: string;\n why?: string;\n fix?: string;\n wayOut?: string;\n details?: string | string[];\n docsUrl?: string;\n};\n\nfunction ensureSentence(text: string): string {\n const trimmed = text.trim();\n if (!trimmed) return '';\n return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\n\nfunction stripSentence(text: string): string {\n const trimmed = text.trim();\n let end = trimmed.length;\n while (end > 0) {\n const char = trimmed[end - 1];\n if (char !== '.' && char !== '!' && char !== '?') break;\n end -= 1;\n }\n return trimmed.slice(0, end);\n}\n\nfunction formatDetails(details: string | string[] | undefined): string {\n if (!details) return '';\n const detailText = Array.isArray(details) ? details.join(', ') : details;\n if (!detailText.trim()) return '';\n return ensureSentence(`Details: ${detailText}`);\n}\n\nexport function formatDiagnosticErrorDetails(\n error: unknown\n): string | undefined {\n if (error == null) return undefined;\n return String(error);\n}\n\nexport function createDiagnosticMessage({\n source,\n severity,\n whatHappened,\n reassurance,\n why,\n fix,\n wayOut,\n details,\n docsUrl,\n}: DiagnosticMessageInput): string {\n const prefix = source\n ? severity\n ? `${source} ${severity}:`\n : `${source}:`\n : severity\n ? `${severity}:`\n : '';\n const whatAndWhy = why\n ? `${stripSentence(whatHappened)} because ${stripSentence(why)}`\n : whatHappened;\n const shouldCombineWayOut =\n !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n const fixAndWayOut = shouldCombineWayOut\n ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}`\n : fix;\n const messageParts = [\n whatAndWhy,\n reassurance,\n fixAndWayOut,\n shouldCombineWayOut ? undefined : wayOut,\n formatDetails(details),\n ]\n .filter((part): part is string => !!part)\n .map(ensureSentence);\n\n if (docsUrl) {\n messageParts.push(`Learn more: ${docsUrl}`);\n }\n\n const message = messageParts.join(' ');\n return prefix ? `${prefix} ${message}` : message;\n}\n","export const defaultCacheUrl = 'https://cdn.gtx.dev' as const;\nexport const defaultBaseUrl = 'https://api2.gtx.dev' as const;\nexport const defaultRuntimeApiUrl = 'https://runtime2.gtx.dev' as const;\n","export const API_VERSION = '2026-03-06.v1';\n"],"mappings":";AAAA,MAAa,uBAAuB;AACpC,MAAa,iBAAiB;;;ACmB9B,SAAS,eAAe,MAAsB;CAC5C,MAAM,UAAU,KAAK,MAAM;AAC3B,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,QAAQ;;AAGxD,SAAS,cAAc,MAAsB;CAC3C,MAAM,UAAU,KAAK,MAAM;CAC3B,IAAI,MAAM,QAAQ;AAClB,QAAO,MAAM,GAAG;EACd,MAAM,OAAO,QAAQ,MAAM;AAC3B,MAAI,SAAS,OAAO,SAAS,OAAO,SAAS,IAAK;AAClD,SAAO;;AAET,QAAO,QAAQ,MAAM,GAAG,IAAI;;AAG9B,SAAS,cAAc,SAAgD;AACrE,KAAI,CAAC,QAAS,QAAO;CACrB,MAAM,aAAa,MAAM,QAAQ,QAAQ,GAAG,QAAQ,KAAK,KAAK,GAAG;AACjE,KAAI,CAAC,WAAW,MAAM,CAAE,QAAO;AAC/B,QAAO,eAAe,YAAY,aAAa;;AAGjD,SAAgB,6BACd,OACoB;AACpB,KAAI,SAAS,KAAM,QAAO,KAAA;AAC1B,QAAO,OAAO,MAAM;;AAGtB,SAAgB,wBAAwB,EACtC,QACA,UACA,cACA,aACA,KACA,KACA,QACA,SACA,WACiC;CACjC,MAAM,SAAS,SACX,WACE,GAAG,OAAO,GAAG,SAAS,KACtB,GAAG,OAAO,KACZ,WACE,GAAG,SAAS,KACZ;CACN,MAAM,aAAa,MACf,GAAG,cAAc,aAAa,CAAC,WAAW,cAAc,IAAI,KAC5D;CACJ,MAAM,sBACJ,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,SAAS,KAAK,cAAc,OAAO,CAAC;CAI3D,MAAM,eAAe;EACnB;EACA;EALmB,sBACjB,GAAG,cAAc,IAAI,CAAC,OAAO,cAAc,OAAO,KAClD;EAKF,sBAAsB,KAAA,IAAY;EAClC,cAAc,QAAQ;EACvB,CACE,QAAQ,SAAyB,CAAC,CAAC,KAAK,CACxC,IAAI,eAAe;AAEtB,KAAI,QACF,cAAa,KAAK,eAAe,UAAU;CAG7C,MAAM,UAAU,aAAa,KAAK,IAAI;AACtC,QAAO,SAAS,GAAG,OAAO,GAAG,YAAY;;;;AC5F3C,MAAa,kBAAkB;AAC/B,MAAa,iBAAiB;AAC9B,MAAa,uBAAuB;;;ACFpC,MAAa,cAAc"}
@@ -18,9 +18,6 @@ function stripSentence(text) {
18
18
  }
19
19
  return trimmed.slice(0, end);
20
20
  }
21
- function lowercaseFirstWord(text) {
22
- return text.replace(/^[A-Z][a-z]/, (match) => match.toLowerCase());
23
- }
24
21
  function formatDetails(details) {
25
22
  if (!details) return "";
26
23
  const detailText = Array.isArray(details) ? details.join(", ") : details;
@@ -33,12 +30,12 @@ function formatDiagnosticErrorDetails(error) {
33
30
  }
34
31
  function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
35
32
  const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
36
- const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${lowercaseFirstWord(stripSentence(why))}` : whatHappened;
33
+ const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
37
34
  const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
38
35
  const messageParts = [
39
36
  whatAndWhy,
40
37
  reassurance,
41
- shouldCombineWayOut ? `${stripSentence(fix)}, or ${lowercaseFirstWord(stripSentence(wayOut))}` : fix,
38
+ shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
42
39
  shouldCombineWayOut ? void 0 : wayOut,
43
40
  formatDetails(details)
44
41
  ].filter((part) => !!part).map(ensureSentence);
@@ -104,4 +101,4 @@ Object.defineProperty(exports, "libraryDefaultLocale", {
104
101
  }
105
102
  });
106
103
 
107
- //# sourceMappingURL=api-B2fSa2JN.cjs.map
104
+ //# sourceMappingURL=api-tMgy8sHj.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-tMgy8sHj.cjs","names":[],"sources":["../src/settings/settings.ts","../src/logging/diagnostics.ts","../src/settings/settingsUrls.ts","../src/translate/api.ts"],"sourcesContent":["export const libraryDefaultLocale = 'en' as const;\nexport const defaultTimeout = 60000;\n","export type DiagnosticSeverity = 'Error' | 'Warning';\n\n/**\n * Text slots follow the five-part error message model:\n * what happened, reassurance, why it happened, how to fix it, and a way out.\n * Clauses that are combined into another sentence should use their intended\n * in-sentence casing.\n */\nexport type DiagnosticMessageInput = {\n source?: string;\n severity?: DiagnosticSeverity;\n whatHappened: string;\n reassurance?: string;\n why?: string;\n fix?: string;\n wayOut?: string;\n details?: string | string[];\n docsUrl?: string;\n};\n\nfunction ensureSentence(text: string): string {\n const trimmed = text.trim();\n if (!trimmed) return '';\n return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\n\nfunction stripSentence(text: string): string {\n const trimmed = text.trim();\n let end = trimmed.length;\n while (end > 0) {\n const char = trimmed[end - 1];\n if (char !== '.' && char !== '!' && char !== '?') break;\n end -= 1;\n }\n return trimmed.slice(0, end);\n}\n\nfunction formatDetails(details: string | string[] | undefined): string {\n if (!details) return '';\n const detailText = Array.isArray(details) ? details.join(', ') : details;\n if (!detailText.trim()) return '';\n return ensureSentence(`Details: ${detailText}`);\n}\n\nexport function formatDiagnosticErrorDetails(\n error: unknown\n): string | undefined {\n if (error == null) return undefined;\n return String(error);\n}\n\nexport function createDiagnosticMessage({\n source,\n severity,\n whatHappened,\n reassurance,\n why,\n fix,\n wayOut,\n details,\n docsUrl,\n}: DiagnosticMessageInput): string {\n const prefix = source\n ? severity\n ? `${source} ${severity}:`\n : `${source}:`\n : severity\n ? `${severity}:`\n : '';\n const whatAndWhy = why\n ? `${stripSentence(whatHappened)} because ${stripSentence(why)}`\n : whatHappened;\n const shouldCombineWayOut =\n !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n const fixAndWayOut = shouldCombineWayOut\n ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}`\n : fix;\n const messageParts = [\n whatAndWhy,\n reassurance,\n fixAndWayOut,\n shouldCombineWayOut ? undefined : wayOut,\n formatDetails(details),\n ]\n .filter((part): part is string => !!part)\n .map(ensureSentence);\n\n if (docsUrl) {\n messageParts.push(`Learn more: ${docsUrl}`);\n }\n\n const message = messageParts.join(' ');\n return prefix ? `${prefix} ${message}` : message;\n}\n","export const defaultCacheUrl = 'https://cdn.gtx.dev' as const;\nexport const defaultBaseUrl = 'https://api2.gtx.dev' as const;\nexport const defaultRuntimeApiUrl = 'https://runtime2.gtx.dev' as const;\n","export const API_VERSION = '2026-03-06.v1';\n"],"mappings":";AAAA,MAAa,uBAAuB;AACpC,MAAa,iBAAiB;;;ACmB9B,SAAS,eAAe,MAAsB;CAC5C,MAAM,UAAU,KAAK,MAAM;AAC3B,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,QAAQ;;AAGxD,SAAS,cAAc,MAAsB;CAC3C,MAAM,UAAU,KAAK,MAAM;CAC3B,IAAI,MAAM,QAAQ;AAClB,QAAO,MAAM,GAAG;EACd,MAAM,OAAO,QAAQ,MAAM;AAC3B,MAAI,SAAS,OAAO,SAAS,OAAO,SAAS,IAAK;AAClD,SAAO;;AAET,QAAO,QAAQ,MAAM,GAAG,IAAI;;AAG9B,SAAS,cAAc,SAAgD;AACrE,KAAI,CAAC,QAAS,QAAO;CACrB,MAAM,aAAa,MAAM,QAAQ,QAAQ,GAAG,QAAQ,KAAK,KAAK,GAAG;AACjE,KAAI,CAAC,WAAW,MAAM,CAAE,QAAO;AAC/B,QAAO,eAAe,YAAY,aAAa;;AAGjD,SAAgB,6BACd,OACoB;AACpB,KAAI,SAAS,KAAM,QAAO,KAAA;AAC1B,QAAO,OAAO,MAAM;;AAGtB,SAAgB,wBAAwB,EACtC,QACA,UACA,cACA,aACA,KACA,KACA,QACA,SACA,WACiC;CACjC,MAAM,SAAS,SACX,WACE,GAAG,OAAO,GAAG,SAAS,KACtB,GAAG,OAAO,KACZ,WACE,GAAG,SAAS,KACZ;CACN,MAAM,aAAa,MACf,GAAG,cAAc,aAAa,CAAC,WAAW,cAAc,IAAI,KAC5D;CACJ,MAAM,sBACJ,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,SAAS,KAAK,cAAc,OAAO,CAAC;CAI3D,MAAM,eAAe;EACnB;EACA;EALmB,sBACjB,GAAG,cAAc,IAAI,CAAC,OAAO,cAAc,OAAO,KAClD;EAKF,sBAAsB,KAAA,IAAY;EAClC,cAAc,QAAQ;EACvB,CACE,QAAQ,SAAyB,CAAC,CAAC,KAAK,CACxC,IAAI,eAAe;AAEtB,KAAI,QACF,cAAa,KAAK,eAAe,UAAU;CAG7C,MAAM,UAAU,aAAa,KAAK,IAAI;AACtC,QAAO,SAAS,GAAG,OAAO,GAAG,YAAY;;;;AC5F3C,MAAa,kBAAkB;AAC/B,MAAa,iBAAiB;AAC9B,MAAa,uBAAuB;;;ACFpC,MAAa,cAAc"}
package/dist/id.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { kt as HashMetadata, m as JsxChildren } from "./types-i06r567-.cjs";
1
+ import { kt as HashMetadata, m as JsxChildren } from "./types-DI9Puvx3.cjs";
2
2
 
3
3
  //#region src/id/hashSource.d.ts
4
4
  /**
package/dist/id.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { kt as HashMetadata, m as JsxChildren } from "./types-BXULfnbQ.mjs";
1
+ import { kt as HashMetadata, m as JsxChildren } from "./types-DPJXAVoW.mjs";
2
2
 
3
3
  //#region src/id/hashSource.d.ts
4
4
  /**
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_api = require("./api-B2fSa2JN.cjs");
3
- const require_runtime = require("./runtime-B2Tvrf2B.cjs");
2
+ const require_api = require("./api-tMgy8sHj.cjs");
3
+ const require_runtime = require("./runtime-DoOLkKJT.cjs");
4
4
  const require_derive = require("./derive-CM6w3hKI.cjs");
5
5
  const require_file = require("./file-BO51iVUx.cjs");
6
6
  let _generaltranslation_format = require("@generaltranslation/format");
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as UploadFilesOptions, A as AwaitJobsOptions, F as MoveMapping, H as FileDataResult, L as ProcessMovesOptions, N as CheckJobStatusResult, Q as FileUpload, R as ProcessMovesResponse, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _t as EnqueueFilesResult, at as CreateTagResult, bt as FileQuery, ct as DownloadFileBatchRequest, et as UploadFilesResponse, it as CreateTagOptions, j as AwaitJobsResult, k as SubmitUserEditDiffsPayload, lt as DownloadFileBatchResult, mt as FileReferenceIds, nt as SetupProjectOptions, ot as EnqueueFilesOptions, rt as SetupProjectResult, st as DownloadFileBatchOptions, tt as SetupProjectFileReference, xt as FileQueryResult, yt as CheckFileTranslationsOptions, z as GetOrphanedFilesResult } from "./types-i06r567-.cjs";
1
+ import { $ as UploadFilesOptions, A as AwaitJobsOptions, F as MoveMapping, H as FileDataResult, L as ProcessMovesOptions, N as CheckJobStatusResult, Q as FileUpload, R as ProcessMovesResponse, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _t as EnqueueFilesResult, at as CreateTagResult, bt as FileQuery, ct as DownloadFileBatchRequest, et as UploadFilesResponse, it as CreateTagOptions, j as AwaitJobsResult, k as SubmitUserEditDiffsPayload, lt as DownloadFileBatchResult, mt as FileReferenceIds, nt as SetupProjectOptions, ot as EnqueueFilesOptions, rt as SetupProjectResult, st as DownloadFileBatchOptions, tt as SetupProjectFileReference, xt as FileQueryResult, yt as CheckFileTranslationsOptions, z as GetOrphanedFilesResult } from "./types-DI9Puvx3.cjs";
2
2
  import { GTConstructorParams, GTRuntime } from "./runtime.cjs";
3
3
  import { n as declareVar, r as decodeVars, t as derive } from "./derive-DBCCXTmL.cjs";
4
4
  import { LocaleConfig, LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as UploadFilesOptions, A as AwaitJobsOptions, F as MoveMapping, H as FileDataResult, L as ProcessMovesOptions, N as CheckJobStatusResult, Q as FileUpload, R as ProcessMovesResponse, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _t as EnqueueFilesResult, at as CreateTagResult, bt as FileQuery, ct as DownloadFileBatchRequest, et as UploadFilesResponse, it as CreateTagOptions, j as AwaitJobsResult, k as SubmitUserEditDiffsPayload, lt as DownloadFileBatchResult, mt as FileReferenceIds, nt as SetupProjectOptions, ot as EnqueueFilesOptions, rt as SetupProjectResult, st as DownloadFileBatchOptions, tt as SetupProjectFileReference, xt as FileQueryResult, yt as CheckFileTranslationsOptions, z as GetOrphanedFilesResult } from "./types-BXULfnbQ.mjs";
1
+ import { $ as UploadFilesOptions, A as AwaitJobsOptions, F as MoveMapping, H as FileDataResult, L as ProcessMovesOptions, N as CheckJobStatusResult, Q as FileUpload, R as ProcessMovesResponse, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _t as EnqueueFilesResult, at as CreateTagResult, bt as FileQuery, ct as DownloadFileBatchRequest, et as UploadFilesResponse, it as CreateTagOptions, j as AwaitJobsResult, k as SubmitUserEditDiffsPayload, lt as DownloadFileBatchResult, mt as FileReferenceIds, nt as SetupProjectOptions, ot as EnqueueFilesOptions, rt as SetupProjectResult, st as DownloadFileBatchOptions, tt as SetupProjectFileReference, xt as FileQueryResult, yt as CheckFileTranslationsOptions, z as GetOrphanedFilesResult } from "./types-DPJXAVoW.mjs";
2
2
  import { GTConstructorParams, GTRuntime } from "./runtime.mjs";
3
3
  import { n as declareVar, r as decodeVars, t as derive } from "./derive-texIAHzc.mjs";
4
4
  import { LocaleConfig, LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { s as defaultTimeout } from "./api-BOEGbEF6.mjs";
2
- import { a as validateResponse, c as noSourceLocaleProvidedError, i as handleFetchError, l as noTargetLocaleProvidedError, n as apiRequest, o as fetchWithTimeout, r as generateRequestHeaders, s as gtInstanceLogger, t as GTRuntime } from "./runtime-kPwGszp1.mjs";
1
+ import { s as defaultTimeout } from "./api-rqq7klYe.mjs";
2
+ import { a as validateResponse, c as noSourceLocaleProvidedError, i as handleFetchError, l as noTargetLocaleProvidedError, n as apiRequest, o as fetchWithTimeout, r as generateRequestHeaders, s as gtInstanceLogger, t as GTRuntime } from "./runtime-hWpzl6v_.mjs";
3
3
  import { c as decode, l as encode, n as declareVar, r as decodeVars, t as derive, u as isSupportedFileFormatTransform } from "./derive-C7Gc7al2.mjs";
4
4
  import { n as isBinaryFileFormat } from "./file-CY2B-8Wr.mjs";
5
5
  import { LocaleConfig, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
package/dist/internal.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_api = require("./api-B2fSa2JN.cjs");
2
+ const require_api = require("./api-tMgy8sHj.cjs");
3
3
  const require_derive = require("./derive-CM6w3hKI.cjs");
4
4
  const require_isVariable = require("./isVariable-I3nllgeI.cjs");
5
5
  let _generaltranslation_icu = require("@generaltranslation/icu");
@@ -1,4 +1,4 @@
1
- import { C as VariableType, D as VariableTransformationSuffix, Mt as RuntimeTranslateManyOptions, S as Variable, ft as FileFormat, g as LocaleProperties, h as JsxElement, m as JsxChildren, p as JsxChild } from "./types-i06r567-.cjs";
1
+ import { C as VariableType, D as VariableTransformationSuffix, Mt as RuntimeTranslateManyOptions, S as Variable, ft as FileFormat, g as LocaleProperties, h as JsxElement, m as JsxChildren, p as JsxChild } from "./types-DI9Puvx3.cjs";
2
2
  import { n as declareVar, r as decodeVars, t as derive } from "./derive-DBCCXTmL.cjs";
3
3
  import { IcuMessage } from "@generaltranslation/format/types";
4
4
 
@@ -12,6 +12,8 @@ type DiagnosticSeverity = 'Error' | 'Warning';
12
12
  /**
13
13
  * Text slots follow the five-part error message model:
14
14
  * what happened, reassurance, why it happened, how to fix it, and a way out.
15
+ * Clauses that are combined into another sentence should use their intended
16
+ * in-sentence casing.
15
17
  */
16
18
  type DiagnosticMessageInput = {
17
19
  source?: string;
@@ -1,4 +1,4 @@
1
- import { C as VariableType, D as VariableTransformationSuffix, Mt as RuntimeTranslateManyOptions, S as Variable, ft as FileFormat, g as LocaleProperties, h as JsxElement, m as JsxChildren, p as JsxChild } from "./types-BXULfnbQ.mjs";
1
+ import { C as VariableType, D as VariableTransformationSuffix, Mt as RuntimeTranslateManyOptions, S as Variable, ft as FileFormat, g as LocaleProperties, h as JsxElement, m as JsxChildren, p as JsxChild } from "./types-DPJXAVoW.mjs";
2
2
  import { n as declareVar, r as decodeVars, t as derive } from "./derive-texIAHzc.mjs";
3
3
  import { IcuMessage } from "@generaltranslation/format/types";
4
4
 
@@ -12,6 +12,8 @@ type DiagnosticSeverity = 'Error' | 'Warning';
12
12
  /**
13
13
  * Text slots follow the five-part error message model:
14
14
  * what happened, reassurance, why it happened, how to fix it, and a way out.
15
+ * Clauses that are combined into another sentence should use their intended
16
+ * in-sentence casing.
15
17
  */
16
18
  type DiagnosticMessageInput = {
17
19
  source?: string;
package/dist/internal.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createDiagnosticMessage, c as libraryDefaultLocale, i as defaultRuntimeApiUrl, n as defaultBaseUrl, o as formatDiagnosticErrorDetails, r as defaultCacheUrl, t as API_VERSION } from "./api-BOEGbEF6.mjs";
1
+ import { a as createDiagnosticMessage, c as libraryDefaultLocale, i as defaultRuntimeApiUrl, n as defaultBaseUrl, o as formatDiagnosticErrorDetails, r as defaultCacheUrl, t as API_VERSION } from "./api-rqq7klYe.mjs";
2
2
  import { a as isGTUnindexedSelectElement, c as decode, i as isGTIndexedSelectElement, l as encode, n as declareVar, o as VAR_IDENTIFIER, r as decodeVars, s as traverseIcu, t as derive, u as isSupportedFileFormatTransform } from "./derive-C7Gc7al2.mjs";
3
3
  import { t as isVariable } from "./isVariable-8-Wy5FnX.mjs";
4
4
  import { TYPE, printAST } from "@generaltranslation/icu";
@@ -2,6 +2,8 @@ export type DiagnosticSeverity = 'Error' | 'Warning';
2
2
  /**
3
3
  * Text slots follow the five-part error message model:
4
4
  * what happened, reassurance, why it happened, how to fix it, and a way out.
5
+ * Clauses that are combined into another sentence should use their intended
6
+ * in-sentence casing.
5
7
  */
6
8
  export type DiagnosticMessageInput = {
7
9
  source?: string;
@@ -15,9 +15,6 @@ function stripSentence(text) {
15
15
  }
16
16
  return trimmed.slice(0, end);
17
17
  }
18
- function lowercaseFirstWord(text) {
19
- return text.replace(/^[A-Z][a-z]/, function (match) { return match.toLowerCase(); });
20
- }
21
18
  function formatDetails(details) {
22
19
  if (!details)
23
20
  return '';
@@ -41,11 +38,11 @@ export function createDiagnosticMessage(_a) {
41
38
  ? "".concat(severity, ":")
42
39
  : '';
43
40
  var whatAndWhy = why
44
- ? "".concat(stripSentence(whatHappened), " because ").concat(lowercaseFirstWord(stripSentence(why)))
41
+ ? "".concat(stripSentence(whatHappened), " because ").concat(stripSentence(why))
45
42
  : whatHappened;
46
43
  var shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
47
44
  var fixAndWayOut = shouldCombineWayOut
48
- ? "".concat(stripSentence(fix), ", or ").concat(lowercaseFirstWord(stripSentence(wayOut)))
45
+ ? "".concat(stripSentence(fix), ", or ").concat(stripSentence(wayOut))
49
46
  : fix;
50
47
  var messageParts = [
51
48
  whatAndWhy,
@@ -1,4 +1,4 @@
1
- const require_api = require("./api-B2fSa2JN.cjs");
1
+ const require_api = require("./api-tMgy8sHj.cjs");
2
2
  const require_ApiError = require("./ApiError-BcjcnTAr.cjs");
3
3
  const require_id = require("./id-BpSNpXZu.cjs");
4
4
  let _generaltranslation_format = require("@generaltranslation/format");
@@ -1096,4 +1096,4 @@ Object.defineProperty(exports, "validateResponse", {
1096
1096
  }
1097
1097
  });
1098
1098
 
1099
- //# sourceMappingURL=runtime-B2Tvrf2B.cjs.map
1099
+ //# sourceMappingURL=runtime-DoOLkKJT.cjs.map