Intlayerの今後のリリースに関する通知を受け取る
    作成:2024-08-11最終更新:2025-06-29

    ドキュメント: intlayergetPathWithoutLocale 関数

    説明

    指定された 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"

    ドキュメント履歴

    • 5.5.10 - 2025-06-29: 履歴初期化
    Intlayerの今後のリリースに関する通知を受け取る