Function to manually mark strings to be extracted using ngx-translate-extract
Go to file
2019-06-24 12:40:32 +02:00
e2e Initial commit 2019-06-24 12:39:17 +02:00
projects/ngx-translate-extract-marker Move readme 2019-06-24 12:40:32 +02:00
src Initial commit 2019-06-24 12:39:17 +02:00
.angulardoc.json Initial commit 2019-06-24 12:39:17 +02:00
.editorconfig Initial commit 2019-06-24 12:39:17 +02:00
.gitignore Initial commit 2019-06-24 12:39:17 +02:00
angular.json Initial commit 2019-06-24 12:39:17 +02:00
browserslist Initial commit 2019-06-24 12:39:17 +02:00
karma.conf.js Initial commit 2019-06-24 12:39:17 +02:00
LICENSE Initial commit 2019-06-24 12:37:12 +02:00
package-lock.json Initial commit 2019-06-24 12:39:17 +02:00
package.json Initial commit 2019-06-24 12:39:17 +02:00
README.md Move readme 2019-06-24 12:40:32 +02:00
tsconfig.app.json Initial commit 2019-06-24 12:39:17 +02:00
tsconfig.json Initial commit 2019-06-24 12:39:17 +02:00
tsconfig.spec.json Initial commit 2019-06-24 12:39:17 +02:00
tslint.json Initial commit 2019-06-24 12:39:17 +02:00

Mark strings for extraction using a marker function

If, for some reason, you want to extract strings not passed directly to TranslateService's get() or instant() methods, you can wrap them in a custom marker function to let ngx-translate-extract know you want to extract them.

Install marker function: npm install @biesbjerg/ngx-translate-extract-marker

import { extract } from '@biesbjerg/ngx-translate-extract-marker';

extract('Extract me');

Add the marker argument when running the extract script:

ngx-translate-extract ... -m extract

You can alias the marker function if needed:

import { extract as _ } from '@biesbjerg/ngx-translate-extract-marker';

_('Extract me');

ngx-translate-extract ... -m _