ultimate-jekyll-manager 0.0.43 → 0.0.45

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.
@@ -259,9 +259,10 @@ async function processTranslation() {
259
259
  const outPath = isHomepage
260
260
  ? path.join('_site', `${lang}.html`)
261
261
  : path.join('_site', lang, relativePath);
262
+ const logTag = `[${lang}] ${relativePath}`;
262
263
 
263
264
  // Log
264
- logger.log(`🌐 Translating: ${relativePath} → [${lang}]`);
265
+ logger.log(`🌐 Translation started: ${logTag}`);
265
266
 
266
267
  // Skip if the file is not in the meta or if it has no text nodes
267
268
  let translated = null;
@@ -294,14 +295,14 @@ async function processTranslation() {
294
295
  && jetpack.exists(cachePath)
295
296
  ) {
296
297
  translated = jetpack.read(cachePath);
297
- logger.log(`📦 Using cached translation for ${relativePath} [${lang}]`);
298
+ logger.log(`📦 Translation cache: ${logTag}`);
298
299
  } else {
299
300
  try {
300
301
  const { result, usage } = await translateWithAPI(openAIKey, bodyText, lang);
301
302
 
302
303
  // Log
303
304
  const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
304
- logger.log(`✅ Translated: ${relativePath} [${lang}] (Elapsed time: ${elapsedTime}s)`);
305
+ logger.log(`✅ Translation succeeded: ${logTag} (Elapsed time: ${elapsedTime}s)`);
305
306
 
306
307
  // Set translated result
307
308
  translated = result;
@@ -317,7 +318,7 @@ async function processTranslation() {
317
318
  setResult(true);
318
319
  } catch (e) {
319
320
  const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
320
- logger.error(`⚠️ Translation failed: ${relativePath} [${lang}] — ${e.message} (Elapsed time: ${elapsedTime}s)`);
321
+ logger.error(`❌ Translation failed: ${logTag} — ${e.message} (Elapsed time: ${elapsedTime}s)`);
321
322
 
322
323
  // Set translated result
323
324
  translated = bodyText;
@@ -342,7 +343,7 @@ async function processTranslation() {
342
343
  const translation = match?.[1];
343
344
 
344
345
  if (!translation) {
345
- return logger.warn(`⚠️ Could not find translated tag for index ${i}`);
346
+ return logger.warn(`⚠️ Translation warning: ${logTag} - Could not find translated tag for index ${i}`);
346
347
  }
347
348
 
348
349
  // Extract original leading and trailing whitespace
@@ -372,14 +373,14 @@ async function processTranslation() {
372
373
  controlTag.length === 0
373
374
  || controlTag.text() !== CONTROL
374
375
  ) {
375
- logger.error(`⚠️ Control tag mismatch in ${relativePath} [${lang}]`);
376
+ logger.error(`❌ Translation failed: ${logTag} — Control tag mismatch or missing`);
376
377
 
377
378
  return setResult(false);
378
- } else {
379
- // Delete the control tag
380
- controlTag.remove();
381
379
  }
382
380
 
381
+ // Delete the control tag
382
+ // controlTag.remove();
383
+
383
384
  // Set the lang attribute on the <html> tag
384
385
  $('html').attr('lang', lang);
385
386
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-jekyll-manager",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "Ultimate Jekyll dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {