generaltranslation 6.1.10 → 6.2.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.
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ declare class GT {
27
27
  * @param {string} [params.projectId=''] - The project ID for the translation service.
28
28
  * @param {string} [params.baseUrl='https://api.gtx.dev'] - The base URL for the translation service.
29
29
  */
30
- constructor({ apiKey, devApiKey, sourceLocale, projectId, baseUrl }?: GTConstructorParams);
30
+ constructor({ apiKey, devApiKey, sourceLocale, projectId, baseUrl, }?: GTConstructorParams);
31
31
  /**
32
32
  * Translates a string or an array of strings/variables into a target locale.
33
33
  * If `metadata.save` is provided, the translation is cached for use in a public project.
@@ -48,15 +48,15 @@ declare class GT {
48
48
  [key: string]: any;
49
49
  }): Promise<ContentTranslationResult | TranslationError>;
50
50
  /**
51
- * Translates JSX elements into a given locale.
52
- *
53
- * @param {Object} params - The parameters for the translation.
54
- * @param {JsxChildren} params.source - The JSX children content to be translated.
55
- * @param {string} params.locale - The target locale for the translation.
56
- * @param {Object} params.metadata - Additional metadata for the translation process.
57
- *
58
- * @returns {Promise<JsxTranslationResult | TranslationError>} - A promise that resolves to the translated content.
59
- */
51
+ * Translates JSX elements into a given locale.
52
+ *
53
+ * @param {Object} params - The parameters for the translation.
54
+ * @param {JsxChildren} params.source - The JSX children content to be translated.
55
+ * @param {string} params.locale - The target locale for the translation.
56
+ * @param {Object} params.metadata - Additional metadata for the translation process.
57
+ *
58
+ * @returns {Promise<JsxTranslationResult | TranslationError>} - A promise that resolves to the translated content.
59
+ */
60
60
  translateJsx(source: JsxChildren, locale: string, metadata?: {
61
61
  context?: string;
62
62
  id?: string;
@@ -113,7 +113,7 @@ export declare function getLocaleName(locale: string, defaultLocale?: string): s
113
113
  * @property {string} minimizedName - Minimized language name in the default language, e.g., "Austrian German".
114
114
  * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "Österreichisches Deutsch".
115
115
  * @property {string} emoji - The emoji associated with the locale's region, if applicable.
116
- */
116
+ */
117
117
  export declare function getLocaleProperties(locale: string, defaultLocale?: string): {
118
118
  code: string;
119
119
  name: string;
@@ -144,7 +144,7 @@ export declare function getLocaleProperties(locale: string, defaultLocale?: stri
144
144
  * @param code - A string representing the locale code (e.g., 'en-US', 'fr-CA').
145
145
  * @param custom - An optional custom mapping of locale codes to emojis.
146
146
  * @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.
147
- */
147
+ */
148
148
  export declare function getLocaleEmoji(locale: string, custom?: Record<string, string>): string;
149
149
  /**
150
150
  * Checks if a given BCP 47 locale code is valid.
@@ -182,7 +182,7 @@ export declare function isSameDialect(...locales: (string | string[])[]): boolea
182
182
  *
183
183
  * @param {string[]} locales - The BCP 47 locale codes to compare.
184
184
  * @returns {boolean} True if all BCP 47 codes represent the same locale, false otherwise.
185
- */
185
+ */
186
186
  export declare function isSameLanguage(...locales: (string | string[])[]): boolean;
187
187
  /**
188
188
  * Formats a number according to the specified locales and options.