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/cli/index.cjs
CHANGED
|
@@ -2547,6 +2547,13 @@ function defaultLocalizationPrompt(localeName, locale) {
|
|
|
2547
2547
|
"Write as if a native speaker authored it for the target market."
|
|
2548
2548
|
].join(" ");
|
|
2549
2549
|
}
|
|
2550
|
+
function buildLocalizationPrompt(promptOverride, localeName, locale) {
|
|
2551
|
+
const localeDirective = defaultLocalizationPrompt(localeName, locale);
|
|
2552
|
+
if (!promptOverride) return localeDirective;
|
|
2553
|
+
return `${promptOverride}
|
|
2554
|
+
|
|
2555
|
+
${localeDirective}`;
|
|
2556
|
+
}
|
|
2550
2557
|
var TASK_FRAMING = "You are localizing the content below into a target language specified at the end of this prompt.";
|
|
2551
2558
|
function buildOutputFormatLine(hasFrontmatter, slugStrategy) {
|
|
2552
2559
|
if (!hasFrontmatter) {
|
|
@@ -2563,7 +2570,11 @@ function buildRetryContextSection(previousError) {
|
|
|
2563
2570
|
}
|
|
2564
2571
|
function buildPageTranslationPrompt(input) {
|
|
2565
2572
|
const localeName = LOCALE_NAMES[input.targetLocale] ?? input.targetLocale;
|
|
2566
|
-
const localizationPrompt =
|
|
2573
|
+
const localizationPrompt = buildLocalizationPrompt(
|
|
2574
|
+
input.resolved.promptOverride,
|
|
2575
|
+
localeName,
|
|
2576
|
+
input.targetLocale
|
|
2577
|
+
);
|
|
2567
2578
|
const prefix = [
|
|
2568
2579
|
TASK_FRAMING,
|
|
2569
2580
|
"",
|