scribe-cms 0.0.15 → 0.0.16
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/cli/index.cjs +12 -1
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +12 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/src/translate/prompts/translation-prompt.d.ts +2 -0
- package/dist/src/translate/prompts/translation-prompt.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2820,6 +2820,13 @@ function defaultLocalizationPrompt(localeName, locale) {
|
|
|
2820
2820
|
"Write as if a native speaker authored it for the target market."
|
|
2821
2821
|
].join(" ");
|
|
2822
2822
|
}
|
|
2823
|
+
function buildLocalizationPrompt(promptOverride, localeName, locale) {
|
|
2824
|
+
const localeDirective = defaultLocalizationPrompt(localeName, locale);
|
|
2825
|
+
if (!promptOverride) return localeDirective;
|
|
2826
|
+
return `${promptOverride}
|
|
2827
|
+
|
|
2828
|
+
${localeDirective}`;
|
|
2829
|
+
}
|
|
2823
2830
|
var TASK_FRAMING = "You are localizing the content below into a target language specified at the end of this prompt.";
|
|
2824
2831
|
function buildOutputFormatLine(hasFrontmatter, slugStrategy) {
|
|
2825
2832
|
if (!hasFrontmatter) {
|
|
@@ -2836,7 +2843,11 @@ function buildRetryContextSection(previousError) {
|
|
|
2836
2843
|
}
|
|
2837
2844
|
function buildPageTranslationPrompt(input) {
|
|
2838
2845
|
const localeName = LOCALE_NAMES[input.targetLocale] ?? input.targetLocale;
|
|
2839
|
-
const localizationPrompt =
|
|
2846
|
+
const localizationPrompt = buildLocalizationPrompt(
|
|
2847
|
+
input.resolved.promptOverride,
|
|
2848
|
+
localeName,
|
|
2849
|
+
input.targetLocale
|
|
2850
|
+
);
|
|
2840
2851
|
const prefix = [
|
|
2841
2852
|
TASK_FRAMING,
|
|
2842
2853
|
"",
|