generaltranslation 7.7.3 → 7.9.0

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/id.d.ts +1 -1
  3. package/dist/index.cjs.min.cjs +3 -3
  4. package/dist/index.cjs.min.cjs.map +1 -1
  5. package/dist/index.d.ts +28 -2
  6. package/dist/index.esm.min.mjs +3 -3
  7. package/dist/index.esm.min.mjs.map +1 -1
  8. package/dist/internal.cjs.min.cjs +1 -1
  9. package/dist/internal.cjs.min.cjs.map +1 -1
  10. package/dist/internal.d.ts +3 -2
  11. package/dist/internal.esm.min.mjs +1 -1
  12. package/dist/internal.esm.min.mjs.map +1 -1
  13. package/dist/types-dir/{enqueueEntries.d.ts → api/enqueueEntries.d.ts} +1 -1
  14. package/dist/types-dir/{enqueueFiles.d.ts → api/enqueueFiles.d.ts} +1 -1
  15. package/dist/types-dir/{entry.d.ts → api/entry.d.ts} +1 -1
  16. package/dist/types-dir/{translate.d.ts → api/translate.d.ts} +1 -1
  17. package/dist/types-dir/{uploadFiles.d.ts → api/uploadFiles.d.ts} +1 -1
  18. package/dist/types-dir/{variables.d.ts → jsx/variables.d.ts} +1 -1
  19. package/dist/types-dir/transformations.d.ts +6 -0
  20. package/dist/types.cjs.min.cjs.map +1 -1
  21. package/dist/types.d.ts +9 -7
  22. package/dist/types.esm.min.mjs.map +1 -1
  23. package/package.json +1 -1
  24. /package/dist/types-dir/{checkFileTranslations.d.ts → api/checkFileTranslations.d.ts} +0 -0
  25. /package/dist/types-dir/{downloadFile.d.ts → api/downloadFile.d.ts} +0 -0
  26. /package/dist/types-dir/{downloadFileBatch.d.ts → api/downloadFileBatch.d.ts} +0 -0
  27. /package/dist/types-dir/{fetchTranslations.d.ts → api/fetchTranslations.d.ts} +0 -0
  28. /package/dist/types-dir/{file.d.ts → api/file.d.ts} +0 -0
  29. /package/dist/types-dir/{project.d.ts → api/project.d.ts} +0 -0
  30. /package/dist/types-dir/{translateMany.d.ts → api/translateMany.d.ts} +0 -0
  31. /package/dist/types-dir/{translationStatus.d.ts → api/translationStatus.d.ts} +0 -0
  32. /package/dist/types-dir/{content.d.ts → jsx/content.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { DataFormat } from './content';
1
+ import { DataFormat } from '../jsx/content';
2
2
  export type { Updates } from './enqueueFiles';
3
3
  export type EnqueueEntriesOptions = {
4
4
  timeout?: number;
@@ -1,4 +1,4 @@
1
- import { DataFormat, JsxChildren } from './content';
1
+ import { DataFormat, JsxChildren } from '../jsx/content';
2
2
  import { CompletedFileTranslationData, FileFormat } from './file';
3
3
  export type Updates = ({
4
4
  metadata: Record<string, any>;
@@ -1,4 +1,4 @@
1
- import { Content, DataFormat } from '../types';
1
+ import { Content, DataFormat } from '../../types';
2
2
  /**
3
3
  * ActionType is the type of action to perform on the request.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { I18nextMessage, IcuMessage, JsxChildren } from './content';
1
+ import { I18nextMessage, IcuMessage, JsxChildren } from '../jsx/content';
2
2
  /**
3
3
  * TranslationResultReference is used to store the reference for a translation result.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { DataFormat } from './content';
1
+ import { DataFormat } from '../jsx/content';
2
2
  import { FileFormat } from './file';
3
3
  export type FileUpload = {
4
4
  content: string;
@@ -1,4 +1,4 @@
1
- export type VariableType = 'v' | 'n' | 'd' | 'c';
1
+ export type VariableType = 'v' | 'n' | 'd' | 'c' | 's';
2
2
  /**
3
3
  * Variables are used to store the variable name and type.
4
4
  */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Transformations are made from a prefix and a suffix.
3
+ */
4
+ export type Transformation = 'translate-client' | 'translate-server' | 'translate-runtime' | 'variable-variable' | 'variable-currency' | 'variable-datetime' | 'variable-number' | 'variable-static' | 'plural' | 'branch';
5
+ export type TransformationPrefix = 'translate' | 'variable' | 'plural' | 'branch' | 'fragment';
6
+ export type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency' | 'static';
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs.min.cjs","sources":["../src/types-dir/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';\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"}
package/dist/types.d.ts CHANGED
@@ -24,7 +24,7 @@ type LocaleProperties = {
24
24
  emoji: string;
25
25
  };
26
26
 
27
- type VariableType = 'v' | 'n' | 'd' | 'c';
27
+ type VariableType = 'v' | 'n' | 'd' | 'c' | 's';
28
28
  /**
29
29
  * Variables are used to store the variable name and type.
30
30
  */
@@ -304,16 +304,18 @@ type TranslationResult = RequestSuccess | TranslationError;
304
304
  */
305
305
  type TranslateManyResult = Array<TranslationResult>;
306
306
 
307
- /**
308
- * @deprecated Use {@link Content} instead.
309
- */
310
- type _Content = string | Array<string | Variable>;
311
307
  /**
312
308
  * Transformations are made from a prefix and a suffix.
313
309
  */
314
- type Transformation = 'translate-client' | 'translate-server' | 'translate-runtime' | 'variable-variable' | 'variable-currency' | 'variable-datetime' | 'variable-number' | 'plural' | 'branch';
310
+ type Transformation = 'translate-client' | 'translate-server' | 'translate-runtime' | 'variable-variable' | 'variable-currency' | 'variable-datetime' | 'variable-number' | 'variable-static' | 'plural' | 'branch';
315
311
  type TransformationPrefix = 'translate' | 'variable' | 'plural' | 'branch' | 'fragment';
316
- type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency';
312
+ type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency' | 'static';
313
+
314
+ /**
315
+ * @deprecated Use {@link Content} instead.
316
+ */
317
+ type _Content = string | Array<string | Variable>;
318
+
317
319
  type Metadata = {
318
320
  context?: string;
319
321
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.esm.min.mjs","sources":["../src/types-dir/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';\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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "7.7.3",
3
+ "version": "7.9.0",
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",
File without changes