-
Notifications
You must be signed in to change notification settings - Fork 323
Hard coded Strings Extraction
Kirill Stryaponov edited this page Sep 27, 2021
·
12 revisions
- Vue templates,
- JSX templates,
- HTML files.
File types supported: vue
, js
, ts
, jsx
, tsx
Strings could be ignored within file and within the project from a quick fix menu.
i18n-ally.detect_hard_strings
(expiremental) Detect hard-coded strings in the current file
// Parser options for extracting HTML, see https://github.com/lokalise/i18n-ally/blob/master/src/extraction/parsers/options.ts
"i18n-ally.extract.parsers.html": {
"attributes": ["text", "title", "alt", "placeholder", "label", "aria-label"],
"ignoredTags": ["script", "style"],
"vBind": true,
"inlineText": true
},
// Enables hard-coded strings detection automatically whenever opening supported a file
"i18n-ally.extract.autoDetect": false,
// Make sure that particular refactoring templates would be picked up be the bulk extraction depending on the context
"i18n-ally.refactor.templates": [
{
// affect scope (optional)
// see https://github.com/lokalise/i18n-ally/blob/master/src/core/types.ts#L156-L156
"source": "html-attribute",
"templates": [
"i18n.t('{key}'{args})",
"custom.t('{key}'{args})",
],
// accept globs, resolved to project root (optional)
"include": [
"src/**/*.{vue,ts,js}",
"index.html"
],
"exclude": [
"src/config/**"
]
},
// ...
]
Lokalise is the fastest growing language cloud technology made by developers, for developers.
As a collaborative productivity platform, it helps structure and automate the translation and localization process for any company in the world.
Learn more
πβπ¨ Review & Collaborate
πͺ¨ Hard-coded Strings Extraction
βοΈ Configurations
π Migration