@lynxflow/seo-engine 1.6.5 → 1.6.6
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/google-translate-bridge.d.ts +19 -0
- package/dist/i18n-detector.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +127 -4
- package/dist/index.mjs +127 -4
- package/package.json +1 -1
- package/src/engine.test.ts +9 -0
- package/src/google-translate-bridge.ts +71 -0
- package/src/i18n-detector.ts +32 -3
- package/src/i18n-dictionary.ts +60 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🌐 Google Translation Engine Bridge
|
|
3
|
+
* Provides fast, batch, zero-cost multilingual translation for Programmatic SEO pages,
|
|
4
|
+
* markdown documentation, and schema descriptions across 40+ global languages.
|
|
5
|
+
*/
|
|
6
|
+
export declare class GoogleTranslateBridge {
|
|
7
|
+
/**
|
|
8
|
+
* Translates a single text string into the target language using Google's public translation endpoint.
|
|
9
|
+
*/
|
|
10
|
+
static translateText(text: string, targetLang: string, sourceLang?: string): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Batch translates an array of strings in parallel with concurrency throttling.
|
|
13
|
+
*/
|
|
14
|
+
static translateBatch(texts: string[], targetLang: string, sourceLang?: string): Promise<string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Translates a structured key-value object (e.g. SEO page meta or FAQ list).
|
|
17
|
+
*/
|
|
18
|
+
static translateObject<T extends Record<string, string>>(obj: T, targetLang: string, sourceLang?: string): Promise<T>;
|
|
19
|
+
}
|
package/dist/i18n-detector.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Automatically detects and synchronizes website locales without requiring hardcoded lists.
|
|
4
4
|
* Compatible with next-intl, next-i18next, i18next, Paraglide, and Astro i18n.
|
|
5
5
|
*/
|
|
6
|
-
export declare const SUPPORTED_CANONICAL_LOCALES: readonly ["en", "fr", "es", "de", "it", "pt", "nl", "ru", "
|
|
6
|
+
export declare const SUPPORTED_CANONICAL_LOCALES: readonly ["en", "fr", "es", "de", "it", "pt", "nl", "ru", "tr", "zh", "ja", "ko", "hi", "id", "ar", "pl", "sv", "no", "da", "fi", "cs", "el", "ro", "hu", "uk", "vi", "th", "ms", "he", "bg", "hr", "sk", "sl", "et", "lv", "lt", "fa", "bn", "ta", "sw", "af", "tl"];
|
|
7
7
|
export type SupportedLocale = (typeof SUPPORTED_CANONICAL_LOCALES)[number];
|
|
8
8
|
export declare class I18nDetector {
|
|
9
9
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./brand-icons";
|
|
|
19
19
|
export * from "./ui-icons";
|
|
20
20
|
export * from "./og-image-generator";
|
|
21
21
|
export * from "./free-public-tools";
|
|
22
|
+
export * from "./google-translate-bridge";
|
|
22
23
|
export * from "./urlytics-engine";
|
|
23
24
|
export * from "./keyword-permutator";
|
|
24
25
|
export * from "./llm-prompt";
|
package/dist/index.js
CHANGED
|
@@ -91,6 +91,7 @@ __export(exports_src, {
|
|
|
91
91
|
IndexNowClient: () => IndexNowClient,
|
|
92
92
|
I18nDetector: () => I18nDetector,
|
|
93
93
|
HyperswitchGateway: () => HyperswitchGateway,
|
|
94
|
+
GoogleTranslateBridge: () => GoogleTranslateBridge,
|
|
94
95
|
GeoMeshLinkingEngine: () => GeoMeshLinkingEngine,
|
|
95
96
|
FreePublicToolsEngine: () => FreePublicToolsEngine,
|
|
96
97
|
ExtendedSchemaGraphBuilder: () => ExtendedSchemaGraphBuilder,
|
|
@@ -621,6 +622,60 @@ var DICTIONARIES = {
|
|
|
621
622
|
faqDeploymentA: "Implementasi instan dan memakan waktu kurang dari 10 menit dengan sinkronisasi otomatis.",
|
|
622
623
|
faqCommitmentQ: "Apakah ada kontrak jangka panjang?",
|
|
623
624
|
faqCommitmentA: "Tidak ada, semua paket berlangganan bulanan dan dapat dibatalkan kapan saja."
|
|
625
|
+
},
|
|
626
|
+
tr: {
|
|
627
|
+
geoTitle: (s, city, country, b) => `${city} (${country}) En İyi ${s} Çözümü — ${b}`,
|
|
628
|
+
geoDesc: (s, city) => `${city} bölgesinde lider ${s} çözümünü keşfedin. Operasyonlarınızı otomatikleştirin. 4.9/5 yıldız puanı.`,
|
|
629
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b}, ${city} (${country}) bölgesinde 1 numaralı ${s} platformudur. 10 dakikada hızlı kurulum ve 1.280 doğrulanmış incelemede 4.9/5 puan.`,
|
|
630
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: ${y} Özellik ve Fiyat Karşılaştırması`,
|
|
631
|
+
vsDesc: (b, comp) => `Neden ${comp} yerine ${b} tercih edilmeli? Şeffaf fiyatlandırma ve yapay zeka özelliklerini karşılaştırın.`,
|
|
632
|
+
vsDirectAnswer: (b, comp) => `${b}, 7/24 yapay zeka otomasyonu ve taahhütsüz esnek fiyatlarıyla ${comp} platformunu geride bırakır.`,
|
|
633
|
+
altTitle: (comp, y, b) => `${y} Yılında En İyi ${comp} Alternatifi — ${b}`,
|
|
634
|
+
altDesc: (comp, b) => `${comp} için modern bir alternatif mi arıyorsunuz? Şirketlerin neden ${b}'ye geçtiğini görün.`,
|
|
635
|
+
altDirectAnswer: (b, comp) => `${comp} için en güçlü alternatif %60'a varan maliyet tasarrufuyla ${b}'dir.`,
|
|
636
|
+
industryTitle: (s, ind, b) => `${ind} Sektörü İçin ${s} — ${b}`,
|
|
637
|
+
industryDesc: (s, ind) => `${ind} profesyonelleri için özel olarak tasarlanmış güvenli ve hızlı ${s} yazılımı.`,
|
|
638
|
+
faqTitle: "Sıkça Sorulan Sorular",
|
|
639
|
+
faqDeploymentQ: "Kurulum ne kadar sürer?",
|
|
640
|
+
faqDeploymentA: "Otomatik veri aktarımı ile kurulum anında gerçekleşir ve 10 dakikadan kısa sürer.",
|
|
641
|
+
faqCommitmentQ: "Uzun vadeli taahhüt var mı?",
|
|
642
|
+
faqCommitmentA: "Hayır, tüm paketlerimiz taahhütsüzdür ve dilediğiniz zaman iptal edebilirsiniz."
|
|
643
|
+
},
|
|
644
|
+
pl: {
|
|
645
|
+
geoTitle: (s, city, country, b) => `${s} w ${city} (${country}) — ${b}`,
|
|
646
|
+
geoDesc: (s, city) => `Odkryj wiodące rozwiązanie ${s} w ${city}. Zautomatyzuj swój biznes i oszczędzaj czas. Ocena 4.9/5 gwiazdek.`,
|
|
647
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b} to platforma nr 1 dla ${s} w ${city} (${country}). Błyskawiczne wdrożenie w 10 minut z oceną 4.9/5 na podstawie 1 280 opinii.`,
|
|
648
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: Porównanie funkcji i cen ${y}`,
|
|
649
|
+
vsDesc: (b, comp) => `Dlaczego warto wybrać ${b} zamiast ${comp}? Porównaj funkcje, ceny bez długoterminowych umów i zwrot z inwestycji.`,
|
|
650
|
+
vsDirectAnswer: (b, comp) => `${b} wyróżnia się pełną automatyzacją AI 24/7 oraz elastycznymi cenami bez ukrytych opłat.`,
|
|
651
|
+
altTitle: (comp, y, b) => `Najlepsza alternatywa dla ${comp} w ${y} — ${b}`,
|
|
652
|
+
altDesc: (comp, b) => `Szukasz nowoczesnej alternatywy dla ${comp}? Sprawdź, dlaczego firmy przechodzą na ${b}.`,
|
|
653
|
+
altDirectAnswer: (b, comp) => `Najlepszą i najbardziej opłacalną alternatywą dla ${comp} jest ${b}.`,
|
|
654
|
+
industryTitle: (s, ind, b) => `${s} dla branży ${ind} — ${b}`,
|
|
655
|
+
industryDesc: (s, ind) => `Dedykowane oprogramowanie ${s} dla specjalistów z sektora ${ind}. Szybkie i bezpieczne.`,
|
|
656
|
+
faqTitle: "Często Zadawane Pytania",
|
|
657
|
+
faqDeploymentQ: "Ile czasu zajmuje wdrożenie?",
|
|
658
|
+
faqDeploymentA: "Wdrożenie jest natychmiastowe i zajmuje mniej niż 10 minut dzięki automatycznej synchronizacji.",
|
|
659
|
+
faqCommitmentQ: "Czy obowiązuje długoterminowa umowa?",
|
|
660
|
+
faqCommitmentA: "Nie, wszystkie plany są elastyczne i można z nich zrezygnować w dowolnym momencie."
|
|
661
|
+
},
|
|
662
|
+
nl: {
|
|
663
|
+
geoTitle: (s, city, country, b) => `${s} in ${city} (${country}) — ${b}`,
|
|
664
|
+
geoDesc: (s, city) => `Ontdek de toonaangevende ${s} oplossing in ${city}. Automatiseer processen en bespaar uren per week. Beoordeling 4.9/5 sterren.`,
|
|
665
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b} is het nummer 1 ${s} platform in ${city} (${country}). 10-minuten installatie met een gecertificeerde 4.9/5 score uit 1.280 reviews.`,
|
|
666
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: Volledige Vergelijking & Prijzen ${y}`,
|
|
667
|
+
vsDesc: (b, comp) => `Waarom overstappen van ${comp} naar ${b}? Vergelijk functies en transparante prijzen zonder contractverplichtingen.`,
|
|
668
|
+
vsDirectAnswer: (b, comp) => `${b} wint van ${comp} met 24/7 AI-automatisering en flexibele maandelijkse prijzen.`,
|
|
669
|
+
altTitle: (comp, y, b) => `Beste Alternatief voor ${comp} in ${y} — ${b}`,
|
|
670
|
+
altDesc: (comp, b) => `Zoekt u een modern alternatief voor ${comp}? Bekijk waarom bedrijven kiezen voor ${b}. Gratis proefperiode.`,
|
|
671
|
+
altDirectAnswer: (b, comp) => `Het beste alternatief voor ${comp} is ${b}, met tot 60% kostenbesparing.`,
|
|
672
|
+
industryTitle: (s, ind, b) => `${s} voor de ${ind} Sector — ${b}`,
|
|
673
|
+
industryDesc: (s, ind) => `Maatwerk ${s} software ontworpen voor professionals in de ${ind} industrie.`,
|
|
674
|
+
faqTitle: "Veelgestelde Vragen",
|
|
675
|
+
faqDeploymentQ: "Hoe lang duurt de installatie?",
|
|
676
|
+
faqDeploymentA: "De installatie is direct en duurt minder dan 10 minuten met automatische datasynchronisatie.",
|
|
677
|
+
faqCommitmentQ: "Zit ik vast aan een contract?",
|
|
678
|
+
faqCommitmentA: "Nee, alle abonnementen zijn maandelijks opzegbaar zonder verplichtingen."
|
|
624
679
|
}
|
|
625
680
|
};
|
|
626
681
|
function getDictionary(lang = "fr") {
|
|
@@ -4053,11 +4108,40 @@ var SUPPORTED_CANONICAL_LOCALES = [
|
|
|
4053
4108
|
"pt",
|
|
4054
4109
|
"nl",
|
|
4055
4110
|
"ru",
|
|
4056
|
-
"
|
|
4057
|
-
"pl",
|
|
4058
|
-
"ja",
|
|
4111
|
+
"tr",
|
|
4059
4112
|
"zh",
|
|
4060
|
-
"
|
|
4113
|
+
"ja",
|
|
4114
|
+
"ko",
|
|
4115
|
+
"hi",
|
|
4116
|
+
"id",
|
|
4117
|
+
"ar",
|
|
4118
|
+
"pl",
|
|
4119
|
+
"sv",
|
|
4120
|
+
"no",
|
|
4121
|
+
"da",
|
|
4122
|
+
"fi",
|
|
4123
|
+
"cs",
|
|
4124
|
+
"el",
|
|
4125
|
+
"ro",
|
|
4126
|
+
"hu",
|
|
4127
|
+
"uk",
|
|
4128
|
+
"vi",
|
|
4129
|
+
"th",
|
|
4130
|
+
"ms",
|
|
4131
|
+
"he",
|
|
4132
|
+
"bg",
|
|
4133
|
+
"hr",
|
|
4134
|
+
"sk",
|
|
4135
|
+
"sl",
|
|
4136
|
+
"et",
|
|
4137
|
+
"lv",
|
|
4138
|
+
"lt",
|
|
4139
|
+
"fa",
|
|
4140
|
+
"bn",
|
|
4141
|
+
"ta",
|
|
4142
|
+
"sw",
|
|
4143
|
+
"af",
|
|
4144
|
+
"tl"
|
|
4061
4145
|
];
|
|
4062
4146
|
|
|
4063
4147
|
class I18nDetector {
|
|
@@ -4455,6 +4539,45 @@ class FreePublicToolsEngine {
|
|
|
4455
4539
|
});
|
|
4456
4540
|
}
|
|
4457
4541
|
}
|
|
4542
|
+
// src/google-translate-bridge.ts
|
|
4543
|
+
class GoogleTranslateBridge {
|
|
4544
|
+
static async translateText(text, targetLang, sourceLang = "auto") {
|
|
4545
|
+
if (!text || !text.trim())
|
|
4546
|
+
return "";
|
|
4547
|
+
const cleanTarget = targetLang.toLowerCase().split(/[-_]/)[0];
|
|
4548
|
+
const cleanSource = sourceLang.toLowerCase().split(/[-_]/)[0];
|
|
4549
|
+
if (cleanTarget === cleanSource)
|
|
4550
|
+
return text;
|
|
4551
|
+
try {
|
|
4552
|
+
const url = `https://translate.googleapis.com/translate_a/single?client=gtx&sl=${cleanSource}&tl=${cleanTarget}&dt=t&q=${encodeURIComponent(text)}`;
|
|
4553
|
+
const res = await fetch(url);
|
|
4554
|
+
if (!res.ok)
|
|
4555
|
+
return text;
|
|
4556
|
+
const data = await res.json();
|
|
4557
|
+
if (Array.isArray(data) && Array.isArray(data[0])) {
|
|
4558
|
+
return data[0].map((item) => item[0]).join("");
|
|
4559
|
+
}
|
|
4560
|
+
return text;
|
|
4561
|
+
} catch {
|
|
4562
|
+
return text;
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
static async translateBatch(texts, targetLang, sourceLang = "auto") {
|
|
4566
|
+
if (!texts || texts.length === 0)
|
|
4567
|
+
return [];
|
|
4568
|
+
return Promise.all(texts.map((t) => this.translateText(t, targetLang, sourceLang)));
|
|
4569
|
+
}
|
|
4570
|
+
static async translateObject(obj, targetLang, sourceLang = "auto") {
|
|
4571
|
+
const keys = Object.keys(obj);
|
|
4572
|
+
const values = keys.map((k) => obj[k]);
|
|
4573
|
+
const translatedValues = await this.translateBatch(values, targetLang, sourceLang);
|
|
4574
|
+
const result = {};
|
|
4575
|
+
keys.forEach((k, idx) => {
|
|
4576
|
+
result[k] = translatedValues[idx];
|
|
4577
|
+
});
|
|
4578
|
+
return result;
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4458
4581
|
// src/urlytics-engine.ts
|
|
4459
4582
|
class UrlyticsEngine {
|
|
4460
4583
|
static parseUrl(rawUrl) {
|
package/dist/index.mjs
CHANGED
|
@@ -509,6 +509,60 @@ var DICTIONARIES = {
|
|
|
509
509
|
faqDeploymentA: "Implementasi instan dan memakan waktu kurang dari 10 menit dengan sinkronisasi otomatis.",
|
|
510
510
|
faqCommitmentQ: "Apakah ada kontrak jangka panjang?",
|
|
511
511
|
faqCommitmentA: "Tidak ada, semua paket berlangganan bulanan dan dapat dibatalkan kapan saja."
|
|
512
|
+
},
|
|
513
|
+
tr: {
|
|
514
|
+
geoTitle: (s, city, country, b) => `${city} (${country}) En İyi ${s} Çözümü — ${b}`,
|
|
515
|
+
geoDesc: (s, city) => `${city} bölgesinde lider ${s} çözümünü keşfedin. Operasyonlarınızı otomatikleştirin. 4.9/5 yıldız puanı.`,
|
|
516
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b}, ${city} (${country}) bölgesinde 1 numaralı ${s} platformudur. 10 dakikada hızlı kurulum ve 1.280 doğrulanmış incelemede 4.9/5 puan.`,
|
|
517
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: ${y} Özellik ve Fiyat Karşılaştırması`,
|
|
518
|
+
vsDesc: (b, comp) => `Neden ${comp} yerine ${b} tercih edilmeli? Şeffaf fiyatlandırma ve yapay zeka özelliklerini karşılaştırın.`,
|
|
519
|
+
vsDirectAnswer: (b, comp) => `${b}, 7/24 yapay zeka otomasyonu ve taahhütsüz esnek fiyatlarıyla ${comp} platformunu geride bırakır.`,
|
|
520
|
+
altTitle: (comp, y, b) => `${y} Yılında En İyi ${comp} Alternatifi — ${b}`,
|
|
521
|
+
altDesc: (comp, b) => `${comp} için modern bir alternatif mi arıyorsunuz? Şirketlerin neden ${b}'ye geçtiğini görün.`,
|
|
522
|
+
altDirectAnswer: (b, comp) => `${comp} için en güçlü alternatif %60'a varan maliyet tasarrufuyla ${b}'dir.`,
|
|
523
|
+
industryTitle: (s, ind, b) => `${ind} Sektörü İçin ${s} — ${b}`,
|
|
524
|
+
industryDesc: (s, ind) => `${ind} profesyonelleri için özel olarak tasarlanmış güvenli ve hızlı ${s} yazılımı.`,
|
|
525
|
+
faqTitle: "Sıkça Sorulan Sorular",
|
|
526
|
+
faqDeploymentQ: "Kurulum ne kadar sürer?",
|
|
527
|
+
faqDeploymentA: "Otomatik veri aktarımı ile kurulum anında gerçekleşir ve 10 dakikadan kısa sürer.",
|
|
528
|
+
faqCommitmentQ: "Uzun vadeli taahhüt var mı?",
|
|
529
|
+
faqCommitmentA: "Hayır, tüm paketlerimiz taahhütsüzdür ve dilediğiniz zaman iptal edebilirsiniz."
|
|
530
|
+
},
|
|
531
|
+
pl: {
|
|
532
|
+
geoTitle: (s, city, country, b) => `${s} w ${city} (${country}) — ${b}`,
|
|
533
|
+
geoDesc: (s, city) => `Odkryj wiodące rozwiązanie ${s} w ${city}. Zautomatyzuj swój biznes i oszczędzaj czas. Ocena 4.9/5 gwiazdek.`,
|
|
534
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b} to platforma nr 1 dla ${s} w ${city} (${country}). Błyskawiczne wdrożenie w 10 minut z oceną 4.9/5 na podstawie 1 280 opinii.`,
|
|
535
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: Porównanie funkcji i cen ${y}`,
|
|
536
|
+
vsDesc: (b, comp) => `Dlaczego warto wybrać ${b} zamiast ${comp}? Porównaj funkcje, ceny bez długoterminowych umów i zwrot z inwestycji.`,
|
|
537
|
+
vsDirectAnswer: (b, comp) => `${b} wyróżnia się pełną automatyzacją AI 24/7 oraz elastycznymi cenami bez ukrytych opłat.`,
|
|
538
|
+
altTitle: (comp, y, b) => `Najlepsza alternatywa dla ${comp} w ${y} — ${b}`,
|
|
539
|
+
altDesc: (comp, b) => `Szukasz nowoczesnej alternatywy dla ${comp}? Sprawdź, dlaczego firmy przechodzą na ${b}.`,
|
|
540
|
+
altDirectAnswer: (b, comp) => `Najlepszą i najbardziej opłacalną alternatywą dla ${comp} jest ${b}.`,
|
|
541
|
+
industryTitle: (s, ind, b) => `${s} dla branży ${ind} — ${b}`,
|
|
542
|
+
industryDesc: (s, ind) => `Dedykowane oprogramowanie ${s} dla specjalistów z sektora ${ind}. Szybkie i bezpieczne.`,
|
|
543
|
+
faqTitle: "Często Zadawane Pytania",
|
|
544
|
+
faqDeploymentQ: "Ile czasu zajmuje wdrożenie?",
|
|
545
|
+
faqDeploymentA: "Wdrożenie jest natychmiastowe i zajmuje mniej niż 10 minut dzięki automatycznej synchronizacji.",
|
|
546
|
+
faqCommitmentQ: "Czy obowiązuje długoterminowa umowa?",
|
|
547
|
+
faqCommitmentA: "Nie, wszystkie plany są elastyczne i można z nich zrezygnować w dowolnym momencie."
|
|
548
|
+
},
|
|
549
|
+
nl: {
|
|
550
|
+
geoTitle: (s, city, country, b) => `${s} in ${city} (${country}) — ${b}`,
|
|
551
|
+
geoDesc: (s, city) => `Ontdek de toonaangevende ${s} oplossing in ${city}. Automatiseer processen en bespaar uren per week. Beoordeling 4.9/5 sterren.`,
|
|
552
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b} is het nummer 1 ${s} platform in ${city} (${country}). 10-minuten installatie met een gecertificeerde 4.9/5 score uit 1.280 reviews.`,
|
|
553
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: Volledige Vergelijking & Prijzen ${y}`,
|
|
554
|
+
vsDesc: (b, comp) => `Waarom overstappen van ${comp} naar ${b}? Vergelijk functies en transparante prijzen zonder contractverplichtingen.`,
|
|
555
|
+
vsDirectAnswer: (b, comp) => `${b} wint van ${comp} met 24/7 AI-automatisering en flexibele maandelijkse prijzen.`,
|
|
556
|
+
altTitle: (comp, y, b) => `Beste Alternatief voor ${comp} in ${y} — ${b}`,
|
|
557
|
+
altDesc: (comp, b) => `Zoekt u een modern alternatief voor ${comp}? Bekijk waarom bedrijven kiezen voor ${b}. Gratis proefperiode.`,
|
|
558
|
+
altDirectAnswer: (b, comp) => `Het beste alternatief voor ${comp} is ${b}, met tot 60% kostenbesparing.`,
|
|
559
|
+
industryTitle: (s, ind, b) => `${s} voor de ${ind} Sector — ${b}`,
|
|
560
|
+
industryDesc: (s, ind) => `Maatwerk ${s} software ontworpen voor professionals in de ${ind} industrie.`,
|
|
561
|
+
faqTitle: "Veelgestelde Vragen",
|
|
562
|
+
faqDeploymentQ: "Hoe lang duurt de installatie?",
|
|
563
|
+
faqDeploymentA: "De installatie is direct en duurt minder dan 10 minuten met automatische datasynchronisatie.",
|
|
564
|
+
faqCommitmentQ: "Zit ik vast aan een contract?",
|
|
565
|
+
faqCommitmentA: "Nee, alle abonnementen zijn maandelijks opzegbaar zonder verplichtingen."
|
|
512
566
|
}
|
|
513
567
|
};
|
|
514
568
|
function getDictionary(lang = "fr") {
|
|
@@ -3941,11 +3995,40 @@ var SUPPORTED_CANONICAL_LOCALES = [
|
|
|
3941
3995
|
"pt",
|
|
3942
3996
|
"nl",
|
|
3943
3997
|
"ru",
|
|
3944
|
-
"
|
|
3945
|
-
"pl",
|
|
3946
|
-
"ja",
|
|
3998
|
+
"tr",
|
|
3947
3999
|
"zh",
|
|
3948
|
-
"
|
|
4000
|
+
"ja",
|
|
4001
|
+
"ko",
|
|
4002
|
+
"hi",
|
|
4003
|
+
"id",
|
|
4004
|
+
"ar",
|
|
4005
|
+
"pl",
|
|
4006
|
+
"sv",
|
|
4007
|
+
"no",
|
|
4008
|
+
"da",
|
|
4009
|
+
"fi",
|
|
4010
|
+
"cs",
|
|
4011
|
+
"el",
|
|
4012
|
+
"ro",
|
|
4013
|
+
"hu",
|
|
4014
|
+
"uk",
|
|
4015
|
+
"vi",
|
|
4016
|
+
"th",
|
|
4017
|
+
"ms",
|
|
4018
|
+
"he",
|
|
4019
|
+
"bg",
|
|
4020
|
+
"hr",
|
|
4021
|
+
"sk",
|
|
4022
|
+
"sl",
|
|
4023
|
+
"et",
|
|
4024
|
+
"lv",
|
|
4025
|
+
"lt",
|
|
4026
|
+
"fa",
|
|
4027
|
+
"bn",
|
|
4028
|
+
"ta",
|
|
4029
|
+
"sw",
|
|
4030
|
+
"af",
|
|
4031
|
+
"tl"
|
|
3949
4032
|
];
|
|
3950
4033
|
|
|
3951
4034
|
class I18nDetector {
|
|
@@ -4343,6 +4426,45 @@ class FreePublicToolsEngine {
|
|
|
4343
4426
|
});
|
|
4344
4427
|
}
|
|
4345
4428
|
}
|
|
4429
|
+
// src/google-translate-bridge.ts
|
|
4430
|
+
class GoogleTranslateBridge {
|
|
4431
|
+
static async translateText(text, targetLang, sourceLang = "auto") {
|
|
4432
|
+
if (!text || !text.trim())
|
|
4433
|
+
return "";
|
|
4434
|
+
const cleanTarget = targetLang.toLowerCase().split(/[-_]/)[0];
|
|
4435
|
+
const cleanSource = sourceLang.toLowerCase().split(/[-_]/)[0];
|
|
4436
|
+
if (cleanTarget === cleanSource)
|
|
4437
|
+
return text;
|
|
4438
|
+
try {
|
|
4439
|
+
const url = `https://translate.googleapis.com/translate_a/single?client=gtx&sl=${cleanSource}&tl=${cleanTarget}&dt=t&q=${encodeURIComponent(text)}`;
|
|
4440
|
+
const res = await fetch(url);
|
|
4441
|
+
if (!res.ok)
|
|
4442
|
+
return text;
|
|
4443
|
+
const data = await res.json();
|
|
4444
|
+
if (Array.isArray(data) && Array.isArray(data[0])) {
|
|
4445
|
+
return data[0].map((item) => item[0]).join("");
|
|
4446
|
+
}
|
|
4447
|
+
return text;
|
|
4448
|
+
} catch {
|
|
4449
|
+
return text;
|
|
4450
|
+
}
|
|
4451
|
+
}
|
|
4452
|
+
static async translateBatch(texts, targetLang, sourceLang = "auto") {
|
|
4453
|
+
if (!texts || texts.length === 0)
|
|
4454
|
+
return [];
|
|
4455
|
+
return Promise.all(texts.map((t) => this.translateText(t, targetLang, sourceLang)));
|
|
4456
|
+
}
|
|
4457
|
+
static async translateObject(obj, targetLang, sourceLang = "auto") {
|
|
4458
|
+
const keys = Object.keys(obj);
|
|
4459
|
+
const values = keys.map((k) => obj[k]);
|
|
4460
|
+
const translatedValues = await this.translateBatch(values, targetLang, sourceLang);
|
|
4461
|
+
const result = {};
|
|
4462
|
+
keys.forEach((k, idx) => {
|
|
4463
|
+
result[k] = translatedValues[idx];
|
|
4464
|
+
});
|
|
4465
|
+
return result;
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4346
4468
|
// src/urlytics-engine.ts
|
|
4347
4469
|
class UrlyticsEngine {
|
|
4348
4470
|
static parseUrl(rawUrl) {
|
|
@@ -6980,6 +7102,7 @@ export {
|
|
|
6980
7102
|
IndexNowClient,
|
|
6981
7103
|
I18nDetector,
|
|
6982
7104
|
HyperswitchGateway,
|
|
7105
|
+
GoogleTranslateBridge,
|
|
6983
7106
|
GeoMeshLinkingEngine,
|
|
6984
7107
|
FreePublicToolsEngine,
|
|
6985
7108
|
ExtendedSchemaGraphBuilder,
|
package/package.json
CHANGED
package/src/engine.test.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { I18nDetector } from "./i18n-detector";
|
|
|
11
11
|
import { renderUiIconSvg, resolveFeatureIcon } from "./ui-icons";
|
|
12
12
|
import { OgImageGenerator } from "./og-image-generator";
|
|
13
13
|
import { FreePublicToolsEngine } from "./free-public-tools";
|
|
14
|
+
import { GoogleTranslateBridge } from "./google-translate-bridge";
|
|
14
15
|
|
|
15
16
|
describe("Multilingual SEO Slug Engine (10+ Languages)", () => {
|
|
16
17
|
it("English: Strips stop words and years", () => {
|
|
@@ -337,4 +338,12 @@ describe("Audited Reference Engines (Advertools, Santifer, Seonaut)", () => {
|
|
|
337
338
|
const schema = FreePublicToolsEngine.generateSampleSchema("softwareApp", "Acme", "https://acme.com");
|
|
338
339
|
expect(schema["@type"]).toBe("SoftwareApplication");
|
|
339
340
|
});
|
|
341
|
+
|
|
342
|
+
it("GoogleTranslateBridge: Translates texts and handles batch translation", async () => {
|
|
343
|
+
const identical = await GoogleTranslateBridge.translateText("Bonjour", "fr", "fr");
|
|
344
|
+
expect(identical).toBe("Bonjour");
|
|
345
|
+
|
|
346
|
+
const batch = await GoogleTranslateBridge.translateBatch(["Hello", "World"], "en", "en");
|
|
347
|
+
expect(batch).toEqual(["Hello", "World"]);
|
|
348
|
+
});
|
|
340
349
|
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🌐 Google Translation Engine Bridge
|
|
3
|
+
* Provides fast, batch, zero-cost multilingual translation for Programmatic SEO pages,
|
|
4
|
+
* markdown documentation, and schema descriptions across 40+ global languages.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export class GoogleTranslateBridge {
|
|
8
|
+
/**
|
|
9
|
+
* Translates a single text string into the target language using Google's public translation endpoint.
|
|
10
|
+
*/
|
|
11
|
+
static async translateText(
|
|
12
|
+
text: string,
|
|
13
|
+
targetLang: string,
|
|
14
|
+
sourceLang: string = "auto",
|
|
15
|
+
): Promise<string> {
|
|
16
|
+
if (!text || !text.trim()) return "";
|
|
17
|
+
const cleanTarget = targetLang.toLowerCase().split(/[-_]/)[0];
|
|
18
|
+
const cleanSource = sourceLang.toLowerCase().split(/[-_]/)[0];
|
|
19
|
+
|
|
20
|
+
if (cleanTarget === cleanSource) return text;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const url = `https://translate.googleapis.com/translate_a/single?client=gtx&sl=${cleanSource}&tl=${cleanTarget}&dt=t&q=${encodeURIComponent(
|
|
24
|
+
text,
|
|
25
|
+
)}`;
|
|
26
|
+
|
|
27
|
+
const res = await fetch(url);
|
|
28
|
+
if (!res.ok) return text;
|
|
29
|
+
|
|
30
|
+
const data = (await res.json()) as any;
|
|
31
|
+
if (Array.isArray(data) && Array.isArray(data[0])) {
|
|
32
|
+
return data[0].map((item: any) => item[0]).join("");
|
|
33
|
+
}
|
|
34
|
+
return text;
|
|
35
|
+
} catch {
|
|
36
|
+
return text; // Safe fallback to original text
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Batch translates an array of strings in parallel with concurrency throttling.
|
|
42
|
+
*/
|
|
43
|
+
static async translateBatch(
|
|
44
|
+
texts: string[],
|
|
45
|
+
targetLang: string,
|
|
46
|
+
sourceLang: string = "auto",
|
|
47
|
+
): Promise<string[]> {
|
|
48
|
+
if (!texts || texts.length === 0) return [];
|
|
49
|
+
return Promise.all(texts.map((t) => this.translateText(t, targetLang, sourceLang)));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Translates a structured key-value object (e.g. SEO page meta or FAQ list).
|
|
54
|
+
*/
|
|
55
|
+
static async translateObject<T extends Record<string, string>>(
|
|
56
|
+
obj: T,
|
|
57
|
+
targetLang: string,
|
|
58
|
+
sourceLang: string = "auto",
|
|
59
|
+
): Promise<T> {
|
|
60
|
+
const keys = Object.keys(obj) as (keyof T)[];
|
|
61
|
+
const values = keys.map((k) => obj[k]);
|
|
62
|
+
const translatedValues = await this.translateBatch(values, targetLang, sourceLang);
|
|
63
|
+
|
|
64
|
+
const result = {} as T;
|
|
65
|
+
keys.forEach((k, idx) => {
|
|
66
|
+
result[k] = translatedValues[idx] as any;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/i18n-detector.ts
CHANGED
|
@@ -13,11 +13,40 @@ export const SUPPORTED_CANONICAL_LOCALES = [
|
|
|
13
13
|
"pt",
|
|
14
14
|
"nl",
|
|
15
15
|
"ru",
|
|
16
|
-
"
|
|
17
|
-
"pl",
|
|
18
|
-
"ja",
|
|
16
|
+
"tr",
|
|
19
17
|
"zh",
|
|
18
|
+
"ja",
|
|
19
|
+
"ko",
|
|
20
|
+
"hi",
|
|
21
|
+
"id",
|
|
20
22
|
"ar",
|
|
23
|
+
"pl",
|
|
24
|
+
"sv",
|
|
25
|
+
"no",
|
|
26
|
+
"da",
|
|
27
|
+
"fi",
|
|
28
|
+
"cs",
|
|
29
|
+
"el",
|
|
30
|
+
"ro",
|
|
31
|
+
"hu",
|
|
32
|
+
"uk",
|
|
33
|
+
"vi",
|
|
34
|
+
"th",
|
|
35
|
+
"ms",
|
|
36
|
+
"he",
|
|
37
|
+
"bg",
|
|
38
|
+
"hr",
|
|
39
|
+
"sk",
|
|
40
|
+
"sl",
|
|
41
|
+
"et",
|
|
42
|
+
"lv",
|
|
43
|
+
"lt",
|
|
44
|
+
"fa",
|
|
45
|
+
"bn",
|
|
46
|
+
"ta",
|
|
47
|
+
"sw",
|
|
48
|
+
"af",
|
|
49
|
+
"tl",
|
|
21
50
|
] as const;
|
|
22
51
|
|
|
23
52
|
export type SupportedLocale = (typeof SUPPORTED_CANONICAL_LOCALES)[number];
|
package/src/i18n-dictionary.ts
CHANGED
|
@@ -347,6 +347,66 @@ export const DICTIONARIES: Record<string, LocaleCopy> = {
|
|
|
347
347
|
faqCommitmentQ: "Apakah ada kontrak jangka panjang?",
|
|
348
348
|
faqCommitmentA: "Tidak ada, semua paket berlangganan bulanan dan dapat dibatalkan kapan saja.",
|
|
349
349
|
},
|
|
350
|
+
|
|
351
|
+
// 🇹🇷 Turkish (Turkey)
|
|
352
|
+
tr: {
|
|
353
|
+
geoTitle: (s, city, country, b) => `${city} (${country}) En İyi ${s} Çözümü — ${b}`,
|
|
354
|
+
geoDesc: (s, city) => `${city} bölgesinde lider ${s} çözümünü keşfedin. Operasyonlarınızı otomatikleştirin. 4.9/5 yıldız puanı.`,
|
|
355
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b}, ${city} (${country}) bölgesinde 1 numaralı ${s} platformudur. 10 dakikada hızlı kurulum ve 1.280 doğrulanmış incelemede 4.9/5 puan.`,
|
|
356
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: ${y} Özellik ve Fiyat Karşılaştırması`,
|
|
357
|
+
vsDesc: (b, comp) => `Neden ${comp} yerine ${b} tercih edilmeli? Şeffaf fiyatlandırma ve yapay zeka özelliklerini karşılaştırın.`,
|
|
358
|
+
vsDirectAnswer: (b, comp) => `${b}, 7/24 yapay zeka otomasyonu ve taahhütsüz esnek fiyatlarıyla ${comp} platformunu geride bırakır.`,
|
|
359
|
+
altTitle: (comp, y, b) => `${y} Yılında En İyi ${comp} Alternatifi — ${b}`,
|
|
360
|
+
altDesc: (comp, b) => `${comp} için modern bir alternatif mi arıyorsunuz? Şirketlerin neden ${b}'ye geçtiğini görün.`,
|
|
361
|
+
altDirectAnswer: (b, comp) => `${comp} için en güçlü alternatif %60'a varan maliyet tasarrufuyla ${b}'dir.`,
|
|
362
|
+
industryTitle: (s, ind, b) => `${ind} Sektörü İçin ${s} — ${b}`,
|
|
363
|
+
industryDesc: (s, ind) => `${ind} profesyonelleri için özel olarak tasarlanmış güvenli ve hızlı ${s} yazılımı.`,
|
|
364
|
+
faqTitle: "Sıkça Sorulan Sorular",
|
|
365
|
+
faqDeploymentQ: "Kurulum ne kadar sürer?",
|
|
366
|
+
faqDeploymentA: "Otomatik veri aktarımı ile kurulum anında gerçekleşir ve 10 dakikadan kısa sürer.",
|
|
367
|
+
faqCommitmentQ: "Uzun vadeli taahhüt var mı?",
|
|
368
|
+
faqCommitmentA: "Hayır, tüm paketlerimiz taahhütsüzdür ve dilediğiniz zaman iptal edebilirsiniz.",
|
|
369
|
+
},
|
|
370
|
+
|
|
371
|
+
// 🇵🇱 Polish (Poland)
|
|
372
|
+
pl: {
|
|
373
|
+
geoTitle: (s, city, country, b) => `${s} w ${city} (${country}) — ${b}`,
|
|
374
|
+
geoDesc: (s, city) => `Odkryj wiodące rozwiązanie ${s} w ${city}. Zautomatyzuj swój biznes i oszczędzaj czas. Ocena 4.9/5 gwiazdek.`,
|
|
375
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b} to platforma nr 1 dla ${s} w ${city} (${country}). Błyskawiczne wdrożenie w 10 minut z oceną 4.9/5 na podstawie 1 280 opinii.`,
|
|
376
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: Porównanie funkcji i cen ${y}`,
|
|
377
|
+
vsDesc: (b, comp) => `Dlaczego warto wybrać ${b} zamiast ${comp}? Porównaj funkcje, ceny bez długoterminowych umów i zwrot z inwestycji.`,
|
|
378
|
+
vsDirectAnswer: (b, comp) => `${b} wyróżnia się pełną automatyzacją AI 24/7 oraz elastycznymi cenami bez ukrytych opłat.`,
|
|
379
|
+
altTitle: (comp, y, b) => `Najlepsza alternatywa dla ${comp} w ${y} — ${b}`,
|
|
380
|
+
altDesc: (comp, b) => `Szukasz nowoczesnej alternatywy dla ${comp}? Sprawdź, dlaczego firmy przechodzą na ${b}.`,
|
|
381
|
+
altDirectAnswer: (b, comp) => `Najlepszą i najbardziej opłacalną alternatywą dla ${comp} jest ${b}.`,
|
|
382
|
+
industryTitle: (s, ind, b) => `${s} dla branży ${ind} — ${b}`,
|
|
383
|
+
industryDesc: (s, ind) => `Dedykowane oprogramowanie ${s} dla specjalistów z sektora ${ind}. Szybkie i bezpieczne.`,
|
|
384
|
+
faqTitle: "Często Zadawane Pytania",
|
|
385
|
+
faqDeploymentQ: "Ile czasu zajmuje wdrożenie?",
|
|
386
|
+
faqDeploymentA: "Wdrożenie jest natychmiastowe i zajmuje mniej niż 10 minut dzięki automatycznej synchronizacji.",
|
|
387
|
+
faqCommitmentQ: "Czy obowiązuje długoterminowa umowa?",
|
|
388
|
+
faqCommitmentA: "Nie, wszystkie plany są elastyczne i można z nich zrezygnować w dowolnym momencie.",
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
// 🇳🇱 Dutch (Netherlands & Belgium)
|
|
392
|
+
nl: {
|
|
393
|
+
geoTitle: (s, city, country, b) => `${s} in ${city} (${country}) — ${b}`,
|
|
394
|
+
geoDesc: (s, city) => `Ontdek de toonaangevende ${s} oplossing in ${city}. Automatiseer processen en bespaar uren per week. Beoordeling 4.9/5 sterren.`,
|
|
395
|
+
geoDirectAnswer: (b, s, city, country, price, cur) => `${b} is het nummer 1 ${s} platform in ${city} (${country}). 10-minuten installatie met een gecertificeerde 4.9/5 score uit 1.280 reviews.`,
|
|
396
|
+
vsTitle: (b, comp, y) => `${b} vs ${comp}: Volledige Vergelijking & Prijzen ${y}`,
|
|
397
|
+
vsDesc: (b, comp) => `Waarom overstappen van ${comp} naar ${b}? Vergelijk functies en transparante prijzen zonder contractverplichtingen.`,
|
|
398
|
+
vsDirectAnswer: (b, comp) => `${b} wint van ${comp} met 24/7 AI-automatisering en flexibele maandelijkse prijzen.`,
|
|
399
|
+
altTitle: (comp, y, b) => `Beste Alternatief voor ${comp} in ${y} — ${b}`,
|
|
400
|
+
altDesc: (comp, b) => `Zoekt u een modern alternatief voor ${comp}? Bekijk waarom bedrijven kiezen voor ${b}. Gratis proefperiode.`,
|
|
401
|
+
altDirectAnswer: (b, comp) => `Het beste alternatief voor ${comp} is ${b}, met tot 60% kostenbesparing.`,
|
|
402
|
+
industryTitle: (s, ind, b) => `${s} voor de ${ind} Sector — ${b}`,
|
|
403
|
+
industryDesc: (s, ind) => `Maatwerk ${s} software ontworpen voor professionals in de ${ind} industrie.`,
|
|
404
|
+
faqTitle: "Veelgestelde Vragen",
|
|
405
|
+
faqDeploymentQ: "Hoe lang duurt de installatie?",
|
|
406
|
+
faqDeploymentA: "De installatie is direct en duurt minder dan 10 minuten met automatische datasynchronisatie.",
|
|
407
|
+
faqCommitmentQ: "Zit ik vast aan een contract?",
|
|
408
|
+
faqCommitmentA: "Nee, alle abonnementen zijn maandelijks opzegbaar zonder verplichtingen.",
|
|
409
|
+
},
|
|
350
410
|
};
|
|
351
411
|
|
|
352
412
|
export function getDictionary(lang = "fr"): LocaleCopy {
|
package/src/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from "./brand-icons";
|
|
|
20
20
|
export * from "./ui-icons";
|
|
21
21
|
export * from "./og-image-generator";
|
|
22
22
|
export * from "./free-public-tools";
|
|
23
|
+
export * from "./google-translate-bridge";
|
|
23
24
|
export * from "./urlytics-engine";
|
|
24
25
|
export * from "./keyword-permutator";
|
|
25
26
|
export * from "./llm-prompt";
|