Translation key generation from source text. Slugifies text and derives scope from file paths.

Methods

(inner) pathToScope(filePath, baseDir) → {Array.<string>}

Derives scope array from file path (e.g., "users/profile.component.ts" → ["users", "profile"])

Parameters:
NameTypeDescription
filePathstring
baseDirstring
Returns:
Type: 
Array.<string>

(inner) slugify(text) → {string}

Converts text to a translation key (lowercase, underscored, max 50 chars)

Parameters:
NameTypeDescription
textstring
Returns:
Type: 
string
Example
slugify("Hello World!") // "hello_world"