generaltranslation 8.1.5 → 8.1.6

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.
@@ -1,2 +1,3 @@
1
1
  export declare const formatI18nextWarning = "Warning: formatI18next is not currently supported but will be implemented in a future version. Use _formatMessage for current ICU message format support.";
2
2
  export declare const formatJsxWarning = "Warning: formatJsx is not currently supported but will be implemented in a future version. Use _formatMessage for current ICU message format support.";
3
+ export declare const formatDateFnsWarning = "Warning: formatDateFns is not currently supported but will be implemented in a future version. Use _formatMessage for current ICU message format support.";
@@ -10,6 +10,9 @@ export type Updates = ({
10
10
  } | {
11
11
  dataFormat: 'I18NEXT';
12
12
  source: string;
13
+ } | {
14
+ dataFormat: 'DATE_FNS';
15
+ source: string;
13
16
  }))[];
14
17
  /**
15
18
  * Options for enqueueing files
@@ -28,7 +28,7 @@ export type EntryMetadata = {
28
28
  scriptCode?: string;
29
29
  };
30
30
  /**
31
- * GTRequest is a translation request object for {@link JsxChildren} | {@link IcuMessage} | {@link I18nextMessage}
31
+ * GTRequest is a translation request object for {@link JsxChildren} | {@link IcuMessage} | {@link I18nextMessage} | {@link DateFnsMessage}
32
32
  *
33
33
  * @param source - The source content to translate.
34
34
  * @param targetLocale - The target locale to translate to.
@@ -1,4 +1,4 @@
1
- import { I18nextMessage, IcuMessage, JsxChildren } from '../jsx/content';
1
+ import { I18nextMessage, IcuMessage, JsxChildren, DateFnsMessage } from '../jsx/content';
2
2
  /**
3
3
  * TranslationResultReference is used to store the reference for a translation result.
4
4
  */
@@ -13,8 +13,8 @@ export type TypedResult = {
13
13
  translation: JsxChildren;
14
14
  dataFormat: 'JSX';
15
15
  } | {
16
- translation: I18nextMessage | IcuMessage;
17
- dataFormat: 'ICU' | 'I18NEXT';
16
+ translation: I18nextMessage | IcuMessage | DateFnsMessage;
17
+ dataFormat: 'ICU' | 'I18NEXT' | 'DATE_FNS';
18
18
  };
19
19
  /**
20
20
  * RequestError is a type that represents an error that occurred during a translation request.
@@ -9,7 +9,7 @@ export type GTJsonFormatMetadata = Record<string, {
9
9
  id?: string;
10
10
  domain?: string;
11
11
  maxChars?: number;
12
- dataFormat?: 'JSX' | 'ICU';
12
+ dataFormat?: 'JSX' | 'ICU' | 'I18NEXT' | 'DATE_FNS';
13
13
  requestVersion?: number;
14
14
  approved_at?: string | null;
15
15
  approved_by?: string | null;
@@ -30,11 +30,11 @@ export type JsxChild = string | JsxElement | Variable;
30
30
  /**
31
31
  * The format of the content
32
32
  */
33
- export type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
33
+ export type DataFormat = 'JSX' | 'ICU' | 'I18NEXT' | 'DATE_FNS';
34
34
  /**
35
35
  * A content type representing JSX, ICU, and I18next messages
36
36
  */
37
- export type Content = JsxChildren | IcuMessage | I18nextMessage;
37
+ export type Content = JsxChildren | IcuMessage | I18nextMessage | DateFnsMessage;
38
38
  /**
39
39
  * A content type representing JSX elements
40
40
  */
@@ -47,3 +47,7 @@ export type IcuMessage = string;
47
47
  * A content type representing I18next messages
48
48
  */
49
49
  export type I18nextMessage = string;
50
+ /**
51
+ * A content type representing DateFns messages
52
+ */
53
+ export type DateFnsMessage = string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs.min.cjs","sources":["../src/types-dir/jsx/content.ts"],"sourcesContent":["import { Variable } from './variables';\n\n/**\n * Map of data-_gt properties to their corresponding React props\n */\nexport const HTML_CONTENT_PROPS = {\n pl: 'placeholder',\n ti: 'title',\n alt: 'alt',\n arl: 'aria-label',\n arb: 'aria-labelledby',\n ard: 'aria-describedby',\n} as const;\n\nexport type HtmlContentPropKeysRecord = Partial<\n Record<keyof typeof HTML_CONTENT_PROPS, string>\n>;\nexport type HtmlContentPropValuesRecord = Partial<\n Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>\n>;\n\n/**\n * GTProp is an internal property used to contain data for translating and rendering elements.\n * note, transformations are only read on the server side if they are 'plural' or 'branch'\n */\nexport type GTProp = {\n b?: Record<string, JsxChildren>; // Branches\n t?: 'p' | 'b'; // Branch Transformation\n} & HtmlContentPropKeysRecord;\n\nexport type JsxElement = {\n t?: string; // tag name\n i?: number; // id\n d?: GTProp; // GT data\n c?: JsxChildren; // children\n};\n\nexport type JsxChild = string | JsxElement | Variable;\n\n/**\n * The format of the content\n */\nexport type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';\n\n/**\n * A content type representing JSX, ICU, and I18next messages\n */\nexport type Content = JsxChildren | IcuMessage | I18nextMessage;\n\n/**\n * A content type representing JSX elements\n */\nexport type JsxChildren = JsxChild | JsxChild[];\n\n/**\n * A content type representing ICU messages\n */\nexport type IcuMessage = string;\n\n/**\n * A content type representing I18next messages\n */\nexport type I18nextMessage = string;\n"],"names":["pl","ti","alt","arl","arb","ard"],"mappings":"wCAKkC,CAChCA,GAAI,cACJC,GAAI,QACJC,IAAK,MACLC,IAAK,aACLC,IAAK,kBACLC,IAAK"}
1
+ {"version":3,"file":"types.cjs.min.cjs","sources":["../src/types-dir/jsx/content.ts"],"sourcesContent":["import { Variable } from './variables';\n\n/**\n * Map of data-_gt properties to their corresponding React props\n */\nexport const HTML_CONTENT_PROPS = {\n pl: 'placeholder',\n ti: 'title',\n alt: 'alt',\n arl: 'aria-label',\n arb: 'aria-labelledby',\n ard: 'aria-describedby',\n} as const;\n\nexport type HtmlContentPropKeysRecord = Partial<\n Record<keyof typeof HTML_CONTENT_PROPS, string>\n>;\nexport type HtmlContentPropValuesRecord = Partial<\n Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>\n>;\n\n/**\n * GTProp is an internal property used to contain data for translating and rendering elements.\n * note, transformations are only read on the server side if they are 'plural' or 'branch'\n */\nexport type GTProp = {\n b?: Record<string, JsxChildren>; // Branches\n t?: 'p' | 'b'; // Branch Transformation\n} & HtmlContentPropKeysRecord;\n\nexport type JsxElement = {\n t?: string; // tag name\n i?: number; // id\n d?: GTProp; // GT data\n c?: JsxChildren; // children\n};\n\nexport type JsxChild = string | JsxElement | Variable;\n\n/**\n * The format of the content\n */\nexport type DataFormat = 'JSX' | 'ICU' | 'I18NEXT' | 'DATE_FNS';\n\n/**\n * A content type representing JSX, ICU, and I18next messages\n */\nexport type Content =\n | JsxChildren\n | IcuMessage\n | I18nextMessage\n | DateFnsMessage;\n\n/**\n * A content type representing JSX elements\n */\nexport type JsxChildren = JsxChild | JsxChild[];\n\n/**\n * A content type representing ICU messages\n */\nexport type IcuMessage = string;\n\n/**\n * A content type representing I18next messages\n */\nexport type I18nextMessage = string;\n\n/**\n * A content type representing DateFns messages\n */\nexport type DateFnsMessage = string;\n"],"names":["pl","ti","alt","arl","arb","ard"],"mappings":"wCAKkC,CAChCA,GAAI,cACJC,GAAI,QACJC,IAAK,MACLC,IAAK,aACLC,IAAK,kBACLC,IAAK"}
package/dist/types.d.ts CHANGED
@@ -65,11 +65,11 @@ type JsxChild = string | JsxElement | Variable;
65
65
  /**
66
66
  * The format of the content
67
67
  */
68
- type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
68
+ type DataFormat = 'JSX' | 'ICU' | 'I18NEXT' | 'DATE_FNS';
69
69
  /**
70
70
  * A content type representing JSX, ICU, and I18next messages
71
71
  */
72
- type Content = JsxChildren | IcuMessage | I18nextMessage;
72
+ type Content = JsxChildren | IcuMessage | I18nextMessage | DateFnsMessage;
73
73
  /**
74
74
  * A content type representing JSX elements
75
75
  */
@@ -82,6 +82,10 @@ type IcuMessage = string;
82
82
  * A content type representing I18next messages
83
83
  */
84
84
  type I18nextMessage = string;
85
+ /**
86
+ * A content type representing DateFns messages
87
+ */
88
+ type DateFnsMessage = string;
85
89
 
86
90
  /**
87
91
  * ActionType is the type of action to perform on the request.
@@ -112,7 +116,7 @@ type EntryMetadata = {
112
116
  scriptCode?: string;
113
117
  };
114
118
  /**
115
- * GTRequest is a translation request object for {@link JsxChildren} | {@link IcuMessage} | {@link I18nextMessage}
119
+ * GTRequest is a translation request object for {@link JsxChildren} | {@link IcuMessage} | {@link I18nextMessage} | {@link DateFnsMessage}
116
120
  *
117
121
  * @param source - The source content to translate.
118
122
  * @param targetLocale - The target locale to translate to.
@@ -224,6 +228,9 @@ type Updates = ({
224
228
  } | {
225
229
  dataFormat: 'I18NEXT';
226
230
  source: string;
231
+ } | {
232
+ dataFormat: 'DATE_FNS';
233
+ source: string;
227
234
  }))[];
228
235
  /**
229
236
  * Options for enqueueing files
@@ -274,7 +281,7 @@ type GTJsonFormatMetadata = Record<string, {
274
281
  id?: string;
275
282
  domain?: string;
276
283
  maxChars?: number;
277
- dataFormat?: 'JSX' | 'ICU';
284
+ dataFormat?: 'JSX' | 'ICU' | 'I18NEXT' | 'DATE_FNS';
278
285
  requestVersion?: number;
279
286
  approved_at?: string | null;
280
287
  approved_by?: string | null;
@@ -333,8 +340,8 @@ type TypedResult = {
333
340
  translation: JsxChildren;
334
341
  dataFormat: 'JSX';
335
342
  } | {
336
- translation: I18nextMessage | IcuMessage;
337
- dataFormat: 'ICU' | 'I18NEXT';
343
+ translation: I18nextMessage | IcuMessage | DateFnsMessage;
344
+ dataFormat: 'ICU' | 'I18NEXT' | 'DATE_FNS';
338
345
  };
339
346
  /**
340
347
  * RequestError is a type that represents an error that occurred during a translation request.
@@ -542,4 +549,4 @@ type TranslationRequestConfig = {
542
549
  };
543
550
 
544
551
  export { HTML_CONTENT_PROPS };
545
- export type { BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, ContentTranslationResult, CustomMapping, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesOptions, EnqueueFilesResult, Entry, ActionType as EntryActionType, EntryMetadata, FetchTranslationsOptions, FetchTranslationsResult, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileTranslationQuery, FileUpload, FormatVariables, GTProp, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, IcuTranslationResult, JobStatus, JsxChild, JsxChildren, JsxElement, JsxTranslationResult, LocaleProperties, Metadata, Request, RetrievedTranslations, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, TranslationStatusResult, Update, Updates, Variable, VariableTransformationSuffix, VariableType, _Content };
552
+ export type { BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, ContentTranslationResult, CustomMapping, DataFormat, DateFnsMessage, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesOptions, EnqueueFilesResult, Entry, ActionType as EntryActionType, EntryMetadata, FetchTranslationsOptions, FetchTranslationsResult, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileTranslationQuery, FileUpload, FormatVariables, GTProp, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, IcuTranslationResult, JobStatus, JsxChild, JsxChildren, JsxElement, JsxTranslationResult, LocaleProperties, Metadata, Request, RetrievedTranslations, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, TranslationStatusResult, Update, Updates, Variable, VariableTransformationSuffix, VariableType, _Content };
@@ -1 +1 @@
1
- {"version":3,"file":"types.esm.min.mjs","sources":["../src/types-dir/jsx/content.ts"],"sourcesContent":["import { Variable } from './variables';\n\n/**\n * Map of data-_gt properties to their corresponding React props\n */\nexport const HTML_CONTENT_PROPS = {\n pl: 'placeholder',\n ti: 'title',\n alt: 'alt',\n arl: 'aria-label',\n arb: 'aria-labelledby',\n ard: 'aria-describedby',\n} as const;\n\nexport type HtmlContentPropKeysRecord = Partial<\n Record<keyof typeof HTML_CONTENT_PROPS, string>\n>;\nexport type HtmlContentPropValuesRecord = Partial<\n Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>\n>;\n\n/**\n * GTProp is an internal property used to contain data for translating and rendering elements.\n * note, transformations are only read on the server side if they are 'plural' or 'branch'\n */\nexport type GTProp = {\n b?: Record<string, JsxChildren>; // Branches\n t?: 'p' | 'b'; // Branch Transformation\n} & HtmlContentPropKeysRecord;\n\nexport type JsxElement = {\n t?: string; // tag name\n i?: number; // id\n d?: GTProp; // GT data\n c?: JsxChildren; // children\n};\n\nexport type JsxChild = string | JsxElement | Variable;\n\n/**\n * The format of the content\n */\nexport type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';\n\n/**\n * A content type representing JSX, ICU, and I18next messages\n */\nexport type Content = JsxChildren | IcuMessage | I18nextMessage;\n\n/**\n * A content type representing JSX elements\n */\nexport type JsxChildren = JsxChild | JsxChild[];\n\n/**\n * A content type representing ICU messages\n */\nexport type IcuMessage = string;\n\n/**\n * A content type representing I18next messages\n */\nexport type I18nextMessage = string;\n"],"names":["HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard"],"mappings":"AAKO,IAAMA,EAAqB,CAChCC,GAAI,cACJC,GAAI,QACJC,IAAK,MACLC,IAAK,aACLC,IAAK,kBACLC,IAAK"}
1
+ {"version":3,"file":"types.esm.min.mjs","sources":["../src/types-dir/jsx/content.ts"],"sourcesContent":["import { Variable } from './variables';\n\n/**\n * Map of data-_gt properties to their corresponding React props\n */\nexport const HTML_CONTENT_PROPS = {\n pl: 'placeholder',\n ti: 'title',\n alt: 'alt',\n arl: 'aria-label',\n arb: 'aria-labelledby',\n ard: 'aria-describedby',\n} as const;\n\nexport type HtmlContentPropKeysRecord = Partial<\n Record<keyof typeof HTML_CONTENT_PROPS, string>\n>;\nexport type HtmlContentPropValuesRecord = Partial<\n Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>\n>;\n\n/**\n * GTProp is an internal property used to contain data for translating and rendering elements.\n * note, transformations are only read on the server side if they are 'plural' or 'branch'\n */\nexport type GTProp = {\n b?: Record<string, JsxChildren>; // Branches\n t?: 'p' | 'b'; // Branch Transformation\n} & HtmlContentPropKeysRecord;\n\nexport type JsxElement = {\n t?: string; // tag name\n i?: number; // id\n d?: GTProp; // GT data\n c?: JsxChildren; // children\n};\n\nexport type JsxChild = string | JsxElement | Variable;\n\n/**\n * The format of the content\n */\nexport type DataFormat = 'JSX' | 'ICU' | 'I18NEXT' | 'DATE_FNS';\n\n/**\n * A content type representing JSX, ICU, and I18next messages\n */\nexport type Content =\n | JsxChildren\n | IcuMessage\n | I18nextMessage\n | DateFnsMessage;\n\n/**\n * A content type representing JSX elements\n */\nexport type JsxChildren = JsxChild | JsxChild[];\n\n/**\n * A content type representing ICU messages\n */\nexport type IcuMessage = string;\n\n/**\n * A content type representing I18next messages\n */\nexport type I18nextMessage = string;\n\n/**\n * A content type representing DateFns messages\n */\nexport type DateFnsMessage = string;\n"],"names":["HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard"],"mappings":"AAKO,IAAMA,EAAqB,CAChCC,GAAI,cACJC,GAAI,QACJC,IAAK,MACLC,IAAK,aACLC,IAAK,kBACLC,IAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "8.1.5",
3
+ "version": "8.1.6",
4
4
  "description": "A language toolkit for AI developers",
5
5
  "main": "dist/index.cjs.min.cjs",
6
6
  "module": "dist/index.esm.min.mjs",