aymericzip/intlayer-skills / skills/intlayer-usage
intlayer-usage
VerifiedProvides general guidelines for using Intlayer in any project. Use when the user asks to "get started with Intlayer", "declare content files", or understand the "project structure" for internationalization.
references/packages_intlayer_getLocale.md
View on GitHub---
createdAt: 2026-01-21
updatedAt: 2026-09-27
priority: 5
title: getLocale Function Documentation | intlayer
description: "Use getLocale to detect the locale from a string such as a URL or a pathname, falling back to your default locale."
keywords:
- getLocale
- translation
- Intlayer
- intlayer
- Internationalization
- Documentation
slugs:
- doc
- packages
- intlayer
- getLocale
history:
- version: 8.0.0
date: 2026-01-21
changes: "Init doc"
author: aymericzip
---
# getLocale Function Documentation
The `getLocale` function allows you to detect the locale from a given string, such as a URL or a path.
## Usage
```ts
import { getLocale } from "intlayer";
const locale = getLocale("/fr/about");
// Output: 'fr'
```
## Parameters
| Parameter | Type | Description |
| --------- | -------- | ---------------------------------------------- |
| `path` | `string` | The path or string to extract the locale from. |
## Returns
The detected locale, or the default locale if no locale is detected.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |