joermd commited on
Commit
a895f7f
·
verified ·
1 Parent(s): 6eedbc5

Update indexproo.html

Browse files
Files changed (1) hide show
  1. indexproo.html +144 -66
indexproo.html CHANGED
@@ -1313,6 +1313,25 @@
1313
  .error-meaning {
1314
  border-right-color: #ef4444;
1315
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1316
  </style>
1317
  </head>
1318
  <body class="bg-gray-50">
@@ -1762,6 +1781,12 @@
1762
  </button>
1763
  </div>
1764
  </div>
 
 
 
 
 
 
1765
  </main>
1766
  </div>
1767
 
@@ -2254,7 +2279,7 @@
2254
  }
2255
 
2256
  /* =====================================
2257
- دالة عرض شرح الخطأ - محسنة
2258
  ===================================== */
2259
  function showErrorExplanation(errorType, errorText, explanation) {
2260
  const popup = document.getElementById('errorPopup');
@@ -3016,7 +3041,7 @@
3016
  // السماح بوقت للمعالجة بين الطلبات
3017
  await new Promise(resolve => setTimeout(resolve, 200));
3018
  }
3019
-
3020
  // إعداد الملخص النهائي
3021
  const totalErrors = totalNumberErrors + totalMissingErrors + totalMeaningErrors;
3022
  if (totalErrors === 0) {
@@ -3027,16 +3052,16 @@
3027
  if (totalMissingErrors > 0) addError(`- ${totalMissingErrors} نص مفقود`, 'warning');
3028
  if (totalMeaningErrors > 0) addError(`- ${totalMeaningErrors} اختلاف في المعنى`, 'warning');
3029
  }
3030
-
3031
  // تجهيز العرض الكلاسيكي
3032
  displayClassicView(sourceText, targetText);
3033
-
3034
  // تجهيز العرض المقسم
3035
  displaySegmentedView();
3036
-
3037
  // تجهيز العرض التفاعلي
3038
  setupInteractiveView();
3039
-
3040
  } catch (error) {
3041
  console.error('Error during analysis:', error);
3042
  addError('حدث خطأ أثناء التحليل: ' + error.message, 'error');
@@ -3274,20 +3299,23 @@
3274
 
3275
  // برومبت محسن للتحليل
3276
  const prompt = `قارن النص المصدر والنص الهدف التاليين، وحدد بدقة:
3277
- 1. اختلافات الأرقام: ضع الرقم المختلف بين علامتي < >
3278
  2. النصوص المفقودة: ضع النص المفقود في الترجمة بين علامتي __ __
3279
  3. اختلافات المعنى: ضع النص الذي تغير معناه بين علامتي [MEANING] [/MEANING]
3280
 
3281
- اعتبر الأرقام بمختلف أنظمتها (العربية والهندية والإنجليزية) متطابقة إذا كانت تمثل نفس الرقم.
 
 
3282
  قم بتحليل كل جملة على حدة وتحديد الاختلافات بدقة.
3283
-
3284
  لكل اختلاف، قدم شرحاً موجزاً للخطأ والتصحيح المقترح.
3285
 
3286
- النص المصدر:
3287
  ${sourceText}
3288
 
3289
- النص الهدف:
3290
- ${targetText}`;
 
3291
 
3292
  const payload = {
3293
  model: "deepseek-chat",
@@ -3483,32 +3511,57 @@
3483
 
3484
  // إضافة مستمعي الأحداث للنصوص المحددة
3485
  setTimeout(() => {
3486
- document.querySelectorAll('.highlight-number, .highlight-meaning, .highlight-missing, .completely-missing, .partially-missing').forEach(element => {
3487
  element.addEventListener('click', function() {
3488
- const errorType = this.getAttribute('data-error-type') ||
3489
- (this.classList.contains('completely-missing') ? 'missing' :
3490
- this.classList.contains('partially-missing') ? 'missing' : 'number');
3491
- const errorText = this.textContent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3492
  let explanation = '';
3493
-
3494
- if (this.classList.contains('completely-missing')) {
3495
- explanation = 'هذا النص مفقود تماما في الترجمة. يجب إضافته للحفاظ على اكتمال المحتوى.';
3496
- } else if (this.classList.contains('partially-missing')) {
3497
- explanation = 'هذا النص موجود بشكل جزئي في الترجمة. تأكد من ترجمة كل المحتوى.';
 
 
3498
  } else {
3499
- explanation = decodeURIComponent(this.getAttribute('data-explanation') || 'لا يوجد شرح متاح');
3500
  }
3501
-
3502
- showErrorExplanation(errorType, errorText, explanation);
3503
  });
3504
  });
3505
  }, 100);
3506
  }
3507
 
3508
  /* =====================================
3509
- دالة تمييز النص - محسنة
3510
  ===================================== */
3511
  function applyHighlights(originalText, targetText, analysisOutput) {
 
 
 
3512
  // تطبيق تمييز للنص المفقود تماما والمفقود جزئيا
3513
  const enhancedSourceText = highlightMissingText(originalText, targetText);
3514
 
@@ -3517,50 +3570,51 @@
3517
  const missingMatches = Array.from(analysisOutput.matchAll(/__(.*?)__/g)).map(m => m[1].trim());
3518
  const meaningMatches = Array.from(analysisOutput.matchAll(/\[MEANING\](.*?)\[\/MEANING\]/g)).map(m => m[1].trim());
3519
 
3520
- // تقسيم النص الأصلي إلى جمل
3521
- const sentences = splitIntoSentences(enhancedSourceText);
3522
-
3523
  // معالجة كل جملة على حدة وتطبيق التحديد
3524
- const highlightedSentences = sentences.map(sentence => {
3525
  let hasError = false;
3526
  let highlightedSentence = sentence;
3527
-
 
3528
  // تحديد اختلافات الأرقام
3529
- numberMatches.forEach(phrase => {
3530
  if (sentence.includes(phrase)) {
3531
  const regex = new RegExp(escapeRegExp(phrase), 'g');
3532
  highlightedSentence = highlightedSentence.replace(regex, `<span class="highlight-number" data-error-type="number" data-explanation="تأكد من صحة الرقم في النص الهدف وتطابقه مع النص المصدر">${phrase}</span>`);
3533
  hasError = true;
 
3534
  }
3535
- });
3536
 
3537
  // تحديد النصوص المفقودة
3538
- missingMatches.forEach(phrase => {
3539
  if (sentence.includes(phrase)) {
3540
  const regex = new RegExp(escapeRegExp(phrase), 'g');
3541
  highlightedSentence = highlightedSentence.replace(regex, `<span class="highlight-missing" data-error-type="missing" data-explanation="أضف النص المفقود إلى الترجمة للحفاظ على اكتمال المعنى">${phrase}</span>`);
3542
  hasError = true;
 
3543
  }
3544
- });
3545
 
3546
  // تحديد اختلافات المعنى
3547
- meaningMatches.forEach(phrase => {
3548
  if (sentence.includes(phrase)) {
3549
  const regex = new RegExp(escapeRegExp(phrase), 'g');
3550
  highlightedSentence = highlightedSentence.replace(regex, `<span class="highlight-meaning" data-error-type="meaning" data-explanation="راجع الترجمة للتأكد من نقل المعنى الصحيح دون تحريف">${phrase}</span>`);
3551
  hasError = true;
 
3552
  }
3553
- });
3554
 
3555
  // إذا كان هناك خطأ، قم بتمييز الجملة كاملة
3556
  if (hasError) {
3557
- return `<span class="sentence-with-error">${highlightedSentence}</span>`;
3558
  }
3559
 
3560
  return highlightedSentence;
3561
- });
3562
 
3563
- return highlightedSentences.join(' ');
3564
  }
3565
 
3566
  /* =====================================
@@ -3699,23 +3753,47 @@
3699
 
3700
  // إضافة مستمعي الأحداث للتحديدات
3701
  setTimeout(() => {
3702
- document.querySelectorAll('.segment-source .highlight-number, .segment-source .highlight-meaning, .segment-target .highlight-missing, .segment-source .completely-missing, .segment-source .partially-missing').forEach(element => {
3703
  element.addEventListener('click', function() {
3704
- const errorType = this.getAttribute('data-error-type') ||
3705
- (this.classList.contains('completely-missing') ? 'missing' :
3706
- this.classList.contains('partially-missing') ? 'missing' : 'number');
3707
- const errorText = this.textContent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3708
  let explanation = '';
3709
-
3710
- if (this.classList.contains('completely-missing')) {
3711
- explanation = 'هذا النص مفقود تماما في الترجمة. يجب إضافته للحفاظ على اكتمال المحتوى.';
3712
- } else if (this.classList.contains('partially-missing')) {
3713
- explanation = 'هذا النص موجود بشكل جزئي في الترجمة. تأكد من ترجمة كل المحتوى.';
 
 
3714
  } else {
3715
- explanation = decodeURIComponent(this.getAttribute('data-explanation') || 'لا يوجد شرح متاح');
3716
  }
3717
-
3718
- showErrorExplanation(errorType, errorText, explanation);
3719
  });
3720
  });
3721
  }, 100);
@@ -4042,14 +4120,14 @@
4042
  }
4043
  }
4044
 
4045
- // الحصول على توصية مخصصة لكل نوع اختلاف
4046
  function getRecommendationForDiff(diff) {
4047
  if (diff.type === 'number') {
4048
- return 'تأكد من صحة الرقم في النص الهدف وتطابقه مع النص المصدر. راجع القيمة العددية وتأكد من تمثيلها بنفس الصيغة.';
4049
  } else if (diff.type === 'missing') {
4050
- return 'أضف النص المفقود إلى الترجمة للحفاظ على اكتمال المعنى. تأكد من ترجمة كل العناصر المهمة في النص الأصلي.';
4051
  } else if (diff.type === 'meaning') {
4052
- return 'راجع الترجمة للتأكد من نقل المعنى الصحيح دون تحريف. قد يكون هناك سوء فهم أو ترجمة خاطئة للمصطلحات.';
4053
  }
4054
  return '';
4055
  }
@@ -4092,7 +4170,7 @@
4092
  numberMatches.forEach(match => {
4093
  numberErrors.push({
4094
  text: match[1],
4095
- explanation: 'تأكد من تطابق هذا الرقم في النص الهدف.'
4096
  });
4097
  });
4098
 
@@ -4100,7 +4178,7 @@
4100
  missingMatches.forEach(match => {
4101
  missingErrors.push({
4102
  text: match[1],
4103
- explanation: 'تأكد من وجود هذا النص في الترجمة.'
4104
  });
4105
  });
4106
 
@@ -4108,7 +4186,7 @@
4108
  meaningMatches.forEach(match => {
4109
  meaningErrors.push({
4110
  text: match[1],
4111
- explanation: 'راجع ترجمة هذا النص للتأكد من نقل المعنى الصحيح.'
4112
  });
4113
  });
4114
 
@@ -4124,12 +4202,12 @@
4124
  if (paragraph.length > 100) {
4125
  completelyMissing.push({
4126
  text: paragraph.substring(0, 100) + '...',
4127
- explanation: 'هذا النص مفقود تماما في الترجمة'
4128
  });
4129
  } else {
4130
  completelyMissing.push({
4131
  text: paragraph,
4132
- explanation: 'هذا النص مفقود تماما في الترجمة'
4133
  });
4134
  }
4135
  }
@@ -4316,9 +4394,9 @@
4316
  توصيات للتحسين
4317
  </h4>
4318
  <ul class="list-disc pr-8 text-sm text-green-700 space-y-1">
4319
- ${numberErrors.length > 0 ? '<li>راجع الأرقام في النص وتأكد من تطابقها بين النص المصدر والترجمة.</li>' : ''}
4320
- ${missingErrors.length > 0 ? '<li>أضف النصوص المفقودة إلى الترجمة للحفاظ على اكتمال المحتوى.</li>' : ''}
4321
- ${meaningErrors.length > 0 ? '<li>صحح ترجمة الكلمات والعبارات التي قد تؤدي إلى اختلاف في المعنى.</li>' : ''}
4322
  <li>استخدم وضع العرض المقسم للتعديل الدقيق للنصوص.</li>
4323
  </ul>
4324
  </div>`;
@@ -4581,7 +4659,7 @@
4581
  // إضافة التذييل
4582
  wordContent += `
4583
  <div class="footer">
4584
- تم إنشاء هذا التقرير تلقائيًا بواسطة نظام المراجع الذكي - شركة فاست برو للبرمجيات والذكاء الاصطناعي
4585
  </div>
4586
  </body>
4587
  </html>`;
 
1313
  .error-meaning {
1314
  border-right-color: #ef4444;
1315
  }
1316
+
1317
+ /* حقوق الملكية - جديد */
1318
+ .copyright {
1319
+ text-align: center;
1320
+ padding: 15px 0;
1321
+ font-size: 0.9rem;
1322
+ color: #6b7280;
1323
+ border-top: 1px solid #e5e7eb;
1324
+ margin-top: 40px;
1325
+ }
1326
+
1327
+ .copyright a {
1328
+ color: #3b82f6;
1329
+ text-decoration: none;
1330
+ }
1331
+
1332
+ .copyright a:hover {
1333
+ text-decoration: underline;
1334
+ }
1335
  </style>
1336
  </head>
1337
  <body class="bg-gray-50">
 
1781
  </button>
1782
  </div>
1783
  </div>
1784
+
1785
+ <!-- حقوق الملكية - إضافة جديدة -->
1786
+ <footer class="copyright">
1787
+ <p>جميع الحقوق محفوظة لشركة فاست برو للبرمجيات والذكاء الاصطناعي &copy; <span id="currentYear"></span></p>
1788
+ <script>document.getElementById('currentYear').textContent = new Date().getFullYear();</script>
1789
+ </footer>
1790
  </main>
1791
  </div>
1792
 
 
2279
  }
2280
 
2281
  /* =====================================
2282
+ دالة عرض شرح الخطأ - محسنة لتكون أكثر ودية
2283
  ===================================== */
2284
  function showErrorExplanation(errorType, errorText, explanation) {
2285
  const popup = document.getElementById('errorPopup');
 
3041
  // السماح بوقت للمعالجة بين الطلبات
3042
  await new Promise(resolve => setTimeout(resolve, 200));
3043
  }
3044
+
3045
  // إعداد الملخص النهائي
3046
  const totalErrors = totalNumberErrors + totalMissingErrors + totalMeaningErrors;
3047
  if (totalErrors === 0) {
 
3052
  if (totalMissingErrors > 0) addError(`- ${totalMissingErrors} نص مفقود`, 'warning');
3053
  if (totalMeaningErrors > 0) addError(`- ${totalMeaningErrors} اختلاف في المعنى`, 'warning');
3054
  }
3055
+
3056
  // تجهيز العرض الكلاسيكي
3057
  displayClassicView(sourceText, targetText);
3058
+
3059
  // تجهيز العرض المقسم
3060
  displaySegmentedView();
3061
+
3062
  // تجهيز العرض التفاعلي
3063
  setupInteractiveView();
3064
+
3065
  } catch (error) {
3066
  console.error('Error during analysis:', error);
3067
  addError('حدث خطأ أثناء التحليل: ' + error.message, 'error');
 
3299
 
3300
  // برومبت محسن للتحليل
3301
  const prompt = `قارن النص المصدر والنص الهدف التاليين، وحدد بدقة:
3302
+ 1. اختلافات الأرقام: ضع الرقم المختلف بين علامتي < > مع الكلمة السابقة والكلمة اللاحقة أو الجملة كاملة
3303
  2. النصوص المفقودة: ضع النص المفقود في الترجمة بين علامتي __ __
3304
  3. اختلافات المعنى: ضع النص الذي تغير معناه بين علامتي [MEANING] [/MEANING]
3305
 
3306
+ اعتبر الأرقام بمختلف أنظمتها (العربية والهندية والإنجليزية) متطابقة إذا كانت تمثل نفس الرقم.
3307
+ الجمل عادةً تكون من 20 إلى 300 كلمة. النصوص عبارة عن نص سورس ونص تاجرت واحد أصلي والثاني ترجمته.
3308
+ استخراج النصوص المفقودة حيث يوجد في المصدر جملة أو فقرة أو كلمة (بالعربي أو الإنجليزي) وفي النص المقابل لا يوجد ما يعادلها في المعنى بأي لغة.
3309
  قم بتحليل كل جملة على حدة وتحديد الاختلافات بدقة.
3310
+
3311
  لكل اختلاف، قدم شرحاً موجزاً للخطأ والتصحيح المقترح.
3312
 
3313
+ النص المصدر:
3314
  ${sourceText}
3315
 
3316
+ النص الهدف:
3317
+ ${targetText}
3318
+ `;
3319
 
3320
  const payload = {
3321
  model: "deepseek-chat",
 
3511
 
3512
  // إضافة مستمعي الأحداث للنصوص المحددة
3513
  setTimeout(() => {
3514
+ document.querySelectorAll('.sentence-with-error').forEach(element => {
3515
  element.addEventListener('click', function() {
3516
+ // الحصول على النص الكامل للجملة
3517
+ const sentenceText = this.textContent;
3518
+
3519
+ // تحديد نوع الخطأ من خلال الفئات داخل الجملة
3520
+ let errorType = 'general';
3521
+ let errorText = sentenceText;
3522
+
3523
+ // البحث عن الخطأ المحدد داخل الجملة
3524
+ const numberHighlight = this.querySelector('.highlight-number');
3525
+ const missingHighlight = this.querySelector('.highlight-missing');
3526
+ const meaningHighlight = this.querySelector('.highlight-meaning');
3527
+
3528
+ if (numberHighlight) {
3529
+ errorType = 'number';
3530
+ errorText = numberHighlight.textContent;
3531
+ } else if (missingHighlight) {
3532
+ errorType = 'missing';
3533
+ errorText = missingHighlight.textContent;
3534
+ } else if (meaningHighlight) {
3535
+ errorType = 'meaning';
3536
+ errorText = meaningHighlight.textContent;
3537
+ }
3538
+
3539
+ // إعداد شرح أكثر ودية
3540
  let explanation = '';
3541
+
3542
+ if (errorType === 'number') {
3543
+ explanation = `يا صديقي، لاحظت وجود خطأ في الأرقام في هذه الجملة. <br><br>الرقم "${errorText}" في النص المصدر لا يتطابق مع النص الهدف. يرجى التحقق من صحة الرقم والتأكد من تطابقه في كلا النصين.`;
3544
+ } else if (errorType === 'missing') {
3545
+ explanation = `يا صديقي، هناك نص مفقود في الترجمة! <br><br>النص "${errorText}" موجود في المصدر ولكن لا يوجد ما يقابله في النص الهدف. يرجى إضافة هذا النص المفقود للحفاظ على اكتمال المعنى.`;
3546
+ } else if (errorType === 'meaning') {
3547
+ explanation = `يا صديقي، يبدو أن هناك اختلاف في المعنى! <br><br>في الجملة "${sentenceText}" النص الذي في المصدر قد تم ترجمته بمعنى مختلف عما هو مقصود. تحتاج إلى مراجعة ترجمة "${errorText}" للتأكد من نقل المعنى الصحيح.`;
3548
  } else {
3549
+ explanation = `يا صديقي، هناك خطأ في هذه الجملة: "${sentenceText}"<br><br>يرجى مراجعة الترجمة للتأكد من دقة المعنى والتطابق بين النصين.`;
3550
  }
3551
+
3552
+ showErrorExplanation(errorType, sentenceText, explanation);
3553
  });
3554
  });
3555
  }, 100);
3556
  }
3557
 
3558
  /* =====================================
3559
+ دالة تمييز النص - محسنة لتمييز الجمل الكاملة
3560
  ===================================== */
3561
  function applyHighlights(originalText, targetText, analysisOutput) {
3562
+ // تقسيم النص الأصلي إلى جمل
3563
+ const sentences = splitIntoSentences(originalText);
3564
+
3565
  // تطبيق تمييز للنص المفقود تماما والمفقود جزئيا
3566
  const enhancedSourceText = highlightMissingText(originalText, targetText);
3567
 
 
3570
  const missingMatches = Array.from(analysisOutput.matchAll(/__(.*?)__/g)).map(m => m[1].trim());
3571
  const meaningMatches = Array.from(analysisOutput.matchAll(/\[MEANING\](.*?)\[\/MEANING\]/g)).map(m => m[1].trim());
3572
 
 
 
 
3573
  // معالجة كل جملة على حدة وتطبيق التحديد
3574
+ const highlightedText = sentences.map((sentence, index) => {
3575
  let hasError = false;
3576
  let highlightedSentence = sentence;
3577
+ let errorType = '';
3578
+
3579
  // تحديد اختلافات الأرقام
3580
+ for (const phrase of numberMatches) {
3581
  if (sentence.includes(phrase)) {
3582
  const regex = new RegExp(escapeRegExp(phrase), 'g');
3583
  highlightedSentence = highlightedSentence.replace(regex, `<span class="highlight-number" data-error-type="number" data-explanation="تأكد من صحة الرقم في النص الهدف وتطابقه مع النص المصدر">${phrase}</span>`);
3584
  hasError = true;
3585
+ errorType = 'number';
3586
  }
3587
+ }
3588
 
3589
  // تحديد النصوص المفقودة
3590
+ for (const phrase of missingMatches) {
3591
  if (sentence.includes(phrase)) {
3592
  const regex = new RegExp(escapeRegExp(phrase), 'g');
3593
  highlightedSentence = highlightedSentence.replace(regex, `<span class="highlight-missing" data-error-type="missing" data-explanation="أضف النص المفقود إلى الترجمة للحفاظ على اكتمال المعنى">${phrase}</span>`);
3594
  hasError = true;
3595
+ errorType = errorType || 'missing';
3596
  }
3597
+ }
3598
 
3599
  // تحديد اختلافات المعنى
3600
+ for (const phrase of meaningMatches) {
3601
  if (sentence.includes(phrase)) {
3602
  const regex = new RegExp(escapeRegExp(phrase), 'g');
3603
  highlightedSentence = highlightedSentence.replace(regex, `<span class="highlight-meaning" data-error-type="meaning" data-explanation="راجع الترجمة للتأكد من نقل المعنى الصحيح دون تحريف">${phrase}</span>`);
3604
  hasError = true;
3605
+ errorType = errorType || 'meaning';
3606
  }
3607
+ }
3608
 
3609
  // إذا كان هناك خطأ، قم بتمييز الجملة كاملة
3610
  if (hasError) {
3611
+ return `<span class="sentence-with-error" data-error-id="${index}" data-error-type="${errorType}" data-sentence-number="${index+1}">${highlightedSentence}</span>`;
3612
  }
3613
 
3614
  return highlightedSentence;
3615
+ }).join(' ');
3616
 
3617
+ return highlightedText;
3618
  }
3619
 
3620
  /* =====================================
 
3753
 
3754
  // إضافة مستمعي الأحداث للتحديدات
3755
  setTimeout(() => {
3756
+ document.querySelectorAll('.segment-source .sentence-with-error').forEach(element => {
3757
  element.addEventListener('click', function() {
3758
+ // الحصول على النص الكامل للجملة
3759
+ const sentenceText = this.textContent;
3760
+
3761
+ // تحديد نوع الخطأ من خلال الفئات داخل الجملة
3762
+ let errorType = 'general';
3763
+ let errorSpecificText = '';
3764
+
3765
+ // البحث عن الخطأ المحدد داخل الجملة
3766
+ const numberHighlight = this.querySelector('.highlight-number');
3767
+ const missingHighlight = this.querySelector('.highlight-missing');
3768
+ const meaningHighlight = this.querySelector('.highlight-meaning');
3769
+
3770
+ if (numberHighlight) {
3771
+ errorType = 'number';
3772
+ errorSpecificText = numberHighlight.textContent;
3773
+ } else if (missingHighlight) {
3774
+ errorType = 'missing';
3775
+ errorSpecificText = missingHighlight.textContent;
3776
+ } else if (meaningHighlight) {
3777
+ errorType = 'meaning';
3778
+ errorSpecificText = meaningHighlight.textContent;
3779
+ }
3780
+
3781
+ const sentenceNumber = this.getAttribute('data-sentence-number');
3782
+
3783
+ // إعداد شرح أكثر ودية
3784
  let explanation = '';
3785
+
3786
+ if (errorType === 'number') {
3787
+ explanation = `يا صديقي، لاحظت وجود خطأ في الأرقام في الجملة رقم ${sentenceNumber} هذه. <br><br>الرقم "${errorSpecificText}" في النص المصدر لا يتطابق مع النص الهدف. تحتاج لتصحيح الرقم في الترجمة.`;
3788
+ } else if (errorType === 'missing') {
3789
+ explanation = `يا صديقي، هناك نص مفقود في الترجمة في الجملة رقم ${sentenceNumber}! <br><br>النص "${errorSpecificText}" موجود في المصدر ولكن لا يوجد ما يقابله في النص الهدف. يرجى إضافة هذا النص المفقود للحفاظ على اكتمال المعنى.`;
3790
+ } else if (errorType === 'meaning') {
3791
+ explanation = `يا صديقي، يبدو أن هناك اختلاف في المعنى في الجملة رقم ${sentenceNumber}! <br><br>النص "${errorSpecificText}" في المصدر تمت ترجمته بشكل مختلف عما هو مقصود. تحتاج إلى مراجعة الترجمة للتأكد من دقتها.`;
3792
  } else {
3793
+ explanation = `يا صديقي، هناك خطأ في هذه الجملة رقم ${sentenceNumber}: "${sentenceText}"<br><br>يرجى مراجعة الترجمة للتأكد من دقة المعنى والتطابق بين النصين.`;
3794
  }
3795
+
3796
+ showErrorExplanation(errorType, sentenceText, explanation);
3797
  });
3798
  });
3799
  }, 100);
 
4120
  }
4121
  }
4122
 
4123
+ // الحصول على توصية مخصصة لكل نوع اختلاف - محسنة لتكون أكثر ودية
4124
  function getRecommendationForDiff(diff) {
4125
  if (diff.type === 'number') {
4126
+ return 'يا صديقي، يبدو أن هناك خطأ في الرقم. في النص المصدر يظهر الرقم بشكل مختلف عما هو في النص الهدف. تأكد من تطابق الأرقام في النصين واستخدام نفس الصيغة.';
4127
  } else if (diff.type === 'missing') {
4128
+ return 'يا صديقي، هناك نص مفقود في الترجمة! تأكد من إضافة هذا النص لأنه موجود في المصدر ويحتوي على معلومات مهمة للمحافظة على اكتمال المعنى.';
4129
  } else if (diff.type === 'meaning') {
4130
+ return 'يا صديقي، هناك اختلاف في المعنى بين النصين. النص في المصدر يقول شيئًا مختلفًا عما تمت ترجمته. راجع هذا الجزء للتأكد من دقة الترجمة ونقل المعنى الصحيح.';
4131
  }
4132
  return '';
4133
  }
 
4170
  numberMatches.forEach(match => {
4171
  numberErrors.push({
4172
  text: match[1],
4173
+ explanation: 'يا صديقي، الرقم في النص المصدر يختلف عن الرقم في النص الهدف. يجب التأكد من تطابق الأرقام في كلا النصين.'
4174
  });
4175
  });
4176
 
 
4178
  missingMatches.forEach(match => {
4179
  missingErrors.push({
4180
  text: match[1],
4181
+ explanation: 'يا صديقي، هذا النص موجود في المصدر ولكنه مفقود في الترجمة. يجب إضافته للحفاظ على اكتمال المعنى.'
4182
  });
4183
  });
4184
 
 
4186
  meaningMatches.forEach(match => {
4187
  meaningErrors.push({
4188
  text: match[1],
4189
+ explanation: 'يا صديقي، هذا النص تم ترجمته بمعنى مختلف عما هو في النص الأصلي. تحتاج إلى مراجعة الترجمة للتأكد من نقل المعنى الصحيح.'
4190
  });
4191
  });
4192
 
 
4202
  if (paragraph.length > 100) {
4203
  completelyMissing.push({
4204
  text: paragraph.substring(0, 100) + '...',
4205
+ explanation: 'يا صديقي، هذا النص مفقود تمامًا في الترجمة. النص الأصلي يحتوي على هذه المعلومات المهمة التي تحتاج إلى إضافتها.'
4206
  });
4207
  } else {
4208
  completelyMissing.push({
4209
  text: paragraph,
4210
+ explanation: 'يا صديقي، هذا النص مفقود تمامًا في الترجمة. النص الأصلي يحتوي على هذه المعلومات المهمة التي تحتاج إلى إضافتها.'
4211
  });
4212
  }
4213
  }
 
4394
  توصيات للتحسين
4395
  </h4>
4396
  <ul class="list-disc pr-8 text-sm text-green-700 space-y-1">
4397
+ ${numberErrors.length > 0 ? '<li>يا صديقي، راجع الأرقام في النص وتأكد من تطابقها بين النص المصدر والترجمة.</li>' : ''}
4398
+ ${missingErrors.length > 0 ? '<li>يا صديقي، هناك نصوص مفقودة تحتاج إلى إضافتها في الترجمة للحفاظ على اكتمال المحتوى.</li>' : ''}
4399
+ ${meaningErrors.length > 0 ? '<li>يا صديقي، هناك بعض الاختلافات في المعنى. صحح ترجمة العبارات التي تم تغيير معناها.</li>' : ''}
4400
  <li>استخدم وضع العرض المقسم للتعديل الدقيق للنصوص.</li>
4401
  </ul>
4402
  </div>`;
 
4659
  // إضافة التذييل
4660
  wordContent += `
4661
  <div class="footer">
4662
+ تم إنشاء هذا التقرير تلقائيًا بواسطة نظام المراجع الذكي - جميع الحقوق محفوظة لشركة فاست برو للبرمجيات والذكاء الاصطناعي © ${new Date().getFullYear()}
4663
  </div>
4664
  </body>
4665
  </html>`;