מחבר:
הפנו את עוזר ה-AI המועדף עליכם למסמך הזהChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
שאלו את שאלתכם וקבלו סיכום של המסמך על ידי הפניה לדף הזה ולספק ה-AI שתבחרו
היסטוריית גרסאות
- "Init history"v5.5.1029.6.2025
התוכן של הדף הזה תורגם באמצעות AI.
צפייה בגרסה האחרונה של התוכן המקורי באנגליתעריכת המסמך הזה
אם יש לכם רעיון לשיפור התיעוד הזה, אל תהססו לתרום על ידי הגשת Pull Request ב-GitHub.
קישור GitHub לתיעודנוצר:2025-08-23עדכון אחרון:2026-09-27
העתקה
העתקת ה-Markdown של המסמך ללוח
Documentation: getPathWithoutLocale Functions in intlayer
Description
Removes the locale segment from the given URL or pathname if present. It works with both absolute URLs and relative pathnames.
Parameters
inputUrl: string- Description: The complete URL string or pathname to process.
- Type:
string
locales: Locales[]- Description: Optional array of supported locales. Defaults to the configured locales in the project.
- Type:
Locales[]
Returns
- Type:
string - Description: The URL string or pathname without the locale segment.
Example Usage
typescript
העתקת קוד
העתקת הקוד ללוח
import { getPathWithoutLocale } from "intlayer";
console.log(getPathWithoutLocale("/dashboard")); // Output: "/dashboard"
console.log(getPathWithoutLocale("/en/dashboard")); // Output: "/dashboard"
console.log(getPathWithoutLocale("/fr/dashboard")); // Output: "/dashboard"
console.log(getPathWithoutLocale("https://example.com/en/dashboard")); // Output: "https://example.com/dashboard"
