Translation key generation from source text. Slugifies text and derives scope from file paths.
- Source
Methods
(inner) pathToScope(filePath, baseDir) → {Array.<string>}
Derives scope array from file path (e.g., "users/profile.component.ts" → ["users", "profile"])
Parameters:
| Name | Type | Description |
|---|---|---|
filePath | string | |
baseDir | string |
- Source
Returns:
- Type:
- Array.<string>
(inner) slugify(text) → {string}
Converts text to a translation key (lowercase, underscored, max 50 chars)
Parameters:
| Name | Type | Description |
|---|---|---|
text | string |
- Source
Returns:
- Type:
- string
Example
slugify("Hello World!") // "hello_world"