Creation:2024-08-11Last update:2025-06-29
이 문서를 원하는 AI 어시스턴트에 참조하세요ChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
이 페이지와 원하는 AI 어시스턴트를 사용하여 문서를 요약합니다
이 페이지의 콘텐츠는 AI를 사용하여 번역되었습니다.
영어 원본 내용의 최신 버전을 보기Edit this doc
If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy
Copy doc Markdown to clipboard
문서: intlayer의 getPathWithoutLocale 함수
설명
주어진 URL 또는 경로명에서 로케일 세그먼트를 제거합니다. 절대 URL과 상대 경로명 모두에서 작동합니다.
매개변수
inputUrl: string- 설명: 처리할 전체 URL 문자열 또는 경로명입니다.
- 타입:
string
locales: Locales[]- 설명: 지원되는 로케일의 선택적 배열입니다. 프로젝트에 구성된 로케일이 기본값입니다.
- 타입:
Locales[]
반환값
- 타입:
string - 설명: 로케일 세그먼트가 제거된 URL 문자열 또는 경로명입니다.
사용 예시
typescript
코드 복사
코드를 클립보드에 복사
import { getPathWithoutLocale } from "intlayer";
console.log(getPathWithoutLocale("/dashboard")); // 출력: "/dashboard"
console.log(getPathWithoutLocale("/en/dashboard")); // 출력: "/dashboard"
console.log(getPathWithoutLocale("/fr/dashboard")); // 출력: "/dashboard"
console.log(getPathWithoutLocale("https://example.com/en/dashboard")); // 출력: "https://example.com/dashboard"