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.cjs
CHANGED
|
@@ -2833,6 +2833,13 @@ function defaultLocalizationPrompt(localeName, locale) {
|
|
|
2833
2833
|
"Write as if a native speaker authored it for the target market."
|
|
2834
2834
|
].join(" ");
|
|
2835
2835
|
}
|
|
2836
|
+
function buildLocalizationPrompt(promptOverride, localeName, locale) {
|
|
2837
|
+
const localeDirective = defaultLocalizationPrompt(localeName, locale);
|
|
2838
|
+
if (!promptOverride) return localeDirective;
|
|
2839
|
+
return `${promptOverride}
|
|
2840
|
+
|
|
2841
|
+
${localeDirective}`;
|
|
2842
|
+
}
|
|
2836
2843
|
var TASK_FRAMING = "You are localizing the content below into a target language specified at the end of this prompt.";
|
|
2837
2844
|
function buildOutputFormatLine(hasFrontmatter, slugStrategy) {
|
|
2838
2845
|
if (!hasFrontmatter) {
|
|
@@ -2849,7 +2856,11 @@ function buildRetryContextSection(previousError) {
|
|
|
2849
2856
|
}
|
|
2850
2857
|
function buildPageTranslationPrompt(input) {
|
|
2851
2858
|
const localeName = LOCALE_NAMES[input.targetLocale] ?? input.targetLocale;
|
|
2852
|
-
const localizationPrompt =
|
|
2859
|
+
const localizationPrompt = buildLocalizationPrompt(
|
|
2860
|
+
input.resolved.promptOverride,
|
|
2861
|
+
localeName,
|
|
2862
|
+
input.targetLocale
|
|
2863
|
+
);
|
|
2853
2864
|
const prefix = [
|
|
2854
2865
|
TASK_FRAMING,
|
|
2855
2866
|
"",
|