samirhosninet commited on
Commit
810fb20
·
1 Parent(s): 0ac8044

Update sitemap with alternate language URLs, fix client lang sync in LanguageContext, and inject SoftwareApplication JSON-LD rich schema

Browse files
app/layout.tsx CHANGED
@@ -149,6 +149,27 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
149
  })
150
  }}
151
  />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  {/* Viewport Elegant Top Border */}
153
  <div className="fixed top-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-primary/20 dark:via-primary/35 to-transparent pointer-events-none z-50" aria-hidden="true" />
154
 
 
149
  })
150
  }}
151
  />
152
+ {/* JSON-LD SoftwareApplication Schema for Rich Search Results */}
153
+ <script
154
+ type="application/ld+json"
155
+ dangerouslySetInnerHTML={{
156
+ __html: JSON.stringify({
157
+ "@context": "https://schema.org",
158
+ "@type": "SoftwareApplication",
159
+ "name": "HUBAPI",
160
+ "applicationCategory": "DeveloperApplication",
161
+ "operatingSystem": "Web",
162
+ "description": "A unified API gateway for accessing multiple LLM providers with one API key, smart routing, usage tracking, and unified billing.",
163
+ "url": "https://darkslategrey-nightingale-132659.hostingersite.com/",
164
+ "offers": {
165
+ "@type": "Offer",
166
+ "price": "0",
167
+ "priceCurrency": "USD",
168
+ "availability": "https://schema.org/PreOrder"
169
+ }
170
+ })
171
+ }}
172
+ />
173
  {/* Viewport Elegant Top Border */}
174
  <div className="fixed top-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-primary/20 dark:via-primary/35 to-transparent pointer-events-none z-50" aria-hidden="true" />
175
 
components/LanguageContext.tsx CHANGED
@@ -23,16 +23,28 @@ export function LanguageProvider({ children }: { children: React.ReactNode }) {
23
  useEffect(() => {
24
  // Deferred to avoid synchronous setState in effect body (React 19 rule)
25
  const init = setTimeout(() => {
26
- const savedLang = localStorage.getItem("hubapi_lang") as Language;
27
- if (savedLang === "ar" || savedLang === "en") {
28
- setLanguage(savedLang);
29
- } else {
30
- // Default to Arabic if browser is in Arabic
31
- const browserLang = navigator.language;
32
- if (browserLang.startsWith("ar")) {
33
- setLanguage("ar");
 
 
 
 
 
 
 
 
 
 
34
  }
35
  }
 
 
36
 
37
  const savedAmbient = localStorage.getItem("hubapi_ambient");
38
  if (savedAmbient === "true") {
 
23
  useEffect(() => {
24
  // Deferred to avoid synchronous setState in effect body (React 19 rule)
25
  const init = setTimeout(() => {
26
+ let initialLang: Language = "en";
27
+
28
+ if (typeof window !== "undefined") {
29
+ const params = new URLSearchParams(window.location.search);
30
+ const urlLang = params.get("lang");
31
+ if (urlLang === "ar" || urlLang === "en") {
32
+ initialLang = urlLang as Language;
33
+ } else {
34
+ const savedLang = localStorage.getItem("hubapi_lang") as Language;
35
+ if (savedLang === "ar" || savedLang === "en") {
36
+ initialLang = savedLang;
37
+ } else {
38
+ // Default to Arabic if browser is in Arabic
39
+ const browserLang = navigator.language;
40
+ if (browserLang.startsWith("ar")) {
41
+ initialLang = "ar";
42
+ }
43
+ }
44
  }
45
  }
46
+
47
+ setLanguage(initialLang);
48
 
49
  const savedAmbient = localStorage.getItem("hubapi_ambient");
50
  if (savedAmbient === "true") {
public/sitemap.xml CHANGED
@@ -2,8 +2,20 @@
2
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
  <url>
4
  <loc>https://darkslategrey-nightingale-132659.hostingersite.com/</loc>
5
- <lastmod>2026-05-20</lastmod>
6
  <changefreq>weekly</changefreq>
7
  <priority>1.0</priority>
8
  </url>
 
 
 
 
 
 
 
 
 
 
 
 
9
  </urlset>
 
2
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
  <url>
4
  <loc>https://darkslategrey-nightingale-132659.hostingersite.com/</loc>
5
+ <lastmod>2026-05-22</lastmod>
6
  <changefreq>weekly</changefreq>
7
  <priority>1.0</priority>
8
  </url>
9
+ <url>
10
+ <loc>https://darkslategrey-nightingale-132659.hostingersite.com/?lang=en</loc>
11
+ <lastmod>2026-05-22</lastmod>
12
+ <changefreq>weekly</changefreq>
13
+ <priority>0.9</priority>
14
+ </url>
15
+ <url>
16
+ <loc>https://darkslategrey-nightingale-132659.hostingersite.com/?lang=ar</loc>
17
+ <lastmod>2026-05-22</lastmod>
18
+ <changefreq>weekly</changefreq>
19
+ <priority>0.9</priority>
20
+ </url>
21
  </urlset>