{"_id":"@56duong/extract-ngx-translate","_rev":"14-d2146e03b11fda30561d72927c41f4fb","name":"@56duong/extract-ngx-translate","dist-tags":{"latest":"1.0.12"},"versions":{"1.0.5":{"name":"@56duong/extract-ngx-translate","version":"1.0.5","keywords":["ngx-translate","angular","ngx-translate-extract","translation","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","_id":"@56duong/extract-ngx-translate@1.0.5","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"homepage":"https://github.com/56duong/extract-ngx-translate#readme","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"dist":{"shasum":"67f36e3085b721bbbf596c00b400517eb5ab1c70","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.5.tgz","fileCount":3,"integrity":"sha512-WfuxtYKSvMXi2W0B6N8e9Kh4Fc1sof7EuR3AolUOh/67C9W6wqX2+CFrbst4iqfE8IfeEZHujy2rTg/GN7eiMg==","signatures":[{"sig":"MEUCIQCQnsMLVlW8dvcavqASxgSNel/HZtcml2sxFpuamLAtowIgRraAECVxMANoiNeQ3qFmeseVgUGlECs9GfPns75Oqt0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16442},"main":"extract-ngx-translate.js","gitHead":"b5854c39e660aae411471f4c18d23d229b8d1e1c","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"repository":{"url":"git+https://github.com/56duong/extract-ngx-translate.git","type":"git"},"_npmVersion":"10.5.0","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"yargs":"^17.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/extract-ngx-translate_1.0.5_1723627103723_0.13682857551512928","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"@56duong/extract-ngx-translate","version":"1.0.6","keywords":["ngx-translate","angular","ngx-translate-extract","translation","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","_id":"@56duong/extract-ngx-translate@1.0.6","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"homepage":"https://github.com/56duong/extract-ngx-translate#readme","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"bin":{"extract-ngx-translate":"extract-ngx-translate.js"},"dist":{"shasum":"fe394f9a09266404f9a0e1dec16f8bfb6a3422a8","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.6.tgz","fileCount":3,"integrity":"sha512-ohpiaRCsZcBHNoeeFM0cvpczMlqm+hea6Lnzlkt7A58hy82j0j/AOIFiovWoakVW201zTzqaFJFArk+OA1cwJg==","signatures":[{"sig":"MEUCICEWFiaJq0w4kH49hZeJQysVXVSOq0XLwmMUoySHtQmEAiEA12d/oXO+lr8wSTNrSaJaCFKOVpIfqOdqfYdVEZpAn+w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16514},"main":"extract-ngx-translate.js","gitHead":"7f2b1523faf36bb3a798f5f29375a2f9e1514243","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"repository":{"url":"git+https://github.com/56duong/extract-ngx-translate.git","type":"git"},"_npmVersion":"10.5.0","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"yargs":"^17.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/extract-ngx-translate_1.0.6_1723628362365_0.27126754458960645","host":"s3://npm-registry-packages"}},"1.0.7":{"name":"@56duong/extract-ngx-translate","version":"1.0.7","keywords":["ngx-translate","angular","ngx-translate-extract","translation","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","_id":"@56duong/extract-ngx-translate@1.0.7","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"homepage":"https://github.com/56duong/extract-ngx-translate#readme","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"bin":{"extract-ngx-translate":"extract-ngx-translate.js"},"dist":{"shasum":"21739d82a9f219c7b28aaf52b00d3797a6b6ad23","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.7.tgz","fileCount":3,"integrity":"sha512-GcHnRqD6NeO7d6t3Yf18XyDn2gYTx/Nu+Q3ffxo6f8IDpnbWWjGfN46XrGacCc2tuiXd4nz2n2kiqRFNhoy+iQ==","signatures":[{"sig":"MEUCIBrAsNzr0CnU/CQud9w3cGb5yb2WCxz7gz0H4xcSrbIMAiEAp3CCzGZmz4VrzPETu+f/srSCArfYFH+3SqY/yW5eLoE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12737},"main":"extract-ngx-translate.js","gitHead":"1f329e9b83be17a6331b8c12f0186fc6748e288b","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"repository":{"url":"git+https://github.com/56duong/extract-ngx-translate.git","type":"git"},"_npmVersion":"10.5.0","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"yargs":"^17.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/extract-ngx-translate_1.0.7_1723629448643_0.8895328627641206","host":"s3://npm-registry-packages"}},"1.0.8":{"name":"@56duong/extract-ngx-translate","version":"1.0.8","keywords":["ngx-translate","angular","ngx-translate-extract","translation","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","_id":"@56duong/extract-ngx-translate@1.0.8","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"homepage":"https://github.com/56duong/extract-ngx-translate#readme","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"bin":{"extract-ngx-translate":"index.js"},"dist":{"shasum":"245324ffaff72f54522d78e737962fae35aeac0d","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.8.tgz","fileCount":3,"integrity":"sha512-FjBf3L9GzThxN9Wz2dGu7zfXF0DJiSNBN/QoAT5LITb5LuavXjynBP+YNGyxjU0XJsfTzwwW5XeVpnfRGv4CDg==","signatures":[{"sig":"MEUCIFtte7JWjmxDeZSUbO3YXmFOgTdg+xmJHaMkgLCQahxhAiEAtY+j8p5+uaJ9A/Co7MjQyLy833saR1BV0MZbCv0qDpA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12704},"main":"index.js","gitHead":"527b7ed877aae7f50c350c1d3910696a8af65094","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"repository":{"url":"git+https://github.com/56duong/extract-ngx-translate.git","type":"git"},"_npmVersion":"10.5.0","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"yargs":"^17.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/extract-ngx-translate_1.0.8_1723630018915_0.5647654372205249","host":"s3://npm-registry-packages"}},"1.0.9":{"name":"@56duong/extract-ngx-translate","version":"1.0.9","keywords":["ngx-translate","angular","ngx-translate-extract","translation","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","_id":"@56duong/extract-ngx-translate@1.0.9","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"homepage":"https://github.com/56duong/extract-ngx-translate#readme","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"bin":{"extract-ngx-translate":"index.js"},"dist":{"shasum":"292ea16a592c6bcd403a6703740cbb0695268f02","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.9.tgz","fileCount":3,"integrity":"sha512-SeNzQf8Qe7fHgUcQ9Ip7KIVgiWZdIitabrKCkGVtdxn5aiLuKGtIuez41oGyzexZpemz34mNPrQt/ROBUrYKCA==","signatures":[{"sig":"MEQCIAMmeGSh2b8CanIcNQvKdNH0LyzpQohG7aSbPhEjEIp6AiB+UiMSluWZjy3wSUH9HI9x6TitLnWedvKdF4uj916Gmw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12688},"main":"index.js","gitHead":"6aa427371e2b0e22ee9a3072dbc4c4bae1b6f401","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"repository":{"url":"git+https://github.com/56duong/extract-ngx-translate.git","type":"git"},"_npmVersion":"10.5.0","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"yargs":"^17.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/extract-ngx-translate_1.0.9_1723631387248_0.013255155901463533","host":"s3://npm-registry-packages"}},"1.0.10":{"name":"@56duong/extract-ngx-translate","version":"1.0.10","keywords":["ngx-translate","angular","ngx-translate-extract","translation","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","_id":"@56duong/extract-ngx-translate@1.0.10","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"homepage":"https://github.com/56duong/extract-ngx-translate#readme","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"bin":{"extract-ngx-translate":"index.js"},"dist":{"shasum":"97d18ff2e335a544177a7bf1bd3c4e5119790085","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.10.tgz","fileCount":3,"integrity":"sha512-PU+AUkhv4P6oWmXXPUY4z6u8LSMxNcRbFz5QYmdki3PUtvT2E3wva7lN7yyTUKgmtzFuIH10YnzqSjSH3GWYAw==","signatures":[{"sig":"MEQCIGJwgSEhfxSJj/34p+wXwUiNY9KIYBTJOLppqmaXVxgQAiAj9UlSLXegwTHSmwYB8H6CECQ9hJsqLhFpoUVY44DtMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13937},"main":"index.js","gitHead":"95bcd8b8f67abe1809f9f0f52aa9c97159449426","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"repository":{"url":"git+https://github.com/56duong/extract-ngx-translate.git","type":"git"},"_npmVersion":"10.5.0","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"yargs":"^17.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/extract-ngx-translate_1.0.10_1723702450359_0.02771484315590711","host":"s3://npm-registry-packages"}},"1.0.11":{"name":"@56duong/extract-ngx-translate","version":"1.0.11","keywords":["ngx-translate","angular","ngx-translate-extract","translation","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","_id":"@56duong/extract-ngx-translate@1.0.11","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"homepage":"https://github.com/56duong/extract-ngx-translate#readme","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"bin":{"extract-ngx-translate":"index.js"},"dist":{"shasum":"5e1ae9abde674c9f92a61429da5714b3ad4fda0f","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.11.tgz","fileCount":3,"integrity":"sha512-UOqKY+hDWYFdB5P5eDNse1os739EdkGQCPutwTAdN4j/QTIhebTkeTSqEYT0378piFY/eDzFVYUxzYB/4iavmg==","signatures":[{"sig":"MEUCIQCHSOgBfq0LjBmpXNr6ubtbei6vNHeHcNTcJ8gbx2fPWgIgY3S4SQUAVRXfWUrof9ciG0Rm3sWVhSUL+H5Oo/s6ZfQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13883},"main":"index.js","gitHead":"08ac6958f73ab25a07e25cf5a78d54feebc6174a","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"repository":{"url":"git+https://github.com/56duong/extract-ngx-translate.git","type":"git"},"_npmVersion":"10.5.0","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"yargs":"^17.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/extract-ngx-translate_1.0.11_1724868196632_0.1994248803317744","host":"s3://npm-registry-packages"}},"1.0.12":{"name":"@56duong/extract-ngx-translate","version":"1.0.12","description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","main":"index.js","bin":{"extract-ngx-translate":"index.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/56duong/extract-ngx-translate.git"},"keywords":["ngx-translate","angular","ngx-translate-extract","translation","i18n","extract"],"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"homepage":"https://github.com/56duong/extract-ngx-translate#readme","dependencies":{"yargs":"^17.0.1"},"_id":"@56duong/extract-ngx-translate@1.0.12","gitHead":"eba4269a7cfd5c76db075d16e20ba4b43ddd728a","_nodeVersion":"18.20.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-vUqbnrFZZpwt1CUWejuBXgLMwvhAAkHSTBNSxt/P+Mq047DTIV+LqHEvRTYof3l7loQdcJR+mCddC2FvzRb4QA==","shasum":"9c689a86d6be7c697268047ce7401aeb92f1adba","tarball":"https://registry.npmjs.org/@56duong/extract-ngx-translate/-/extract-ngx-translate-1.0.12.tgz","fileCount":3,"unpackedSize":14554,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPbzzqQoBhHjxmRdfK374kvCg7xSXEm77XeOt0TfVkMAIhAIE+KbVvM+1y/zjAyFttae5N3i+7HIgEI6o89WN8qsIb"}]},"_npmUser":{"name":"56duong","email":"56duong@gmail.com"},"directories":{},"maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-ngx-translate_1.0.12_1725082948992_0.43058232051617873"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-14T09:18:23.614Z","modified":"2024-08-31T05:42:29.314Z","1.0.0":"2024-08-14T08:00:02.869Z","1.0.1":"2024-08-14T09:06:47.437Z","1.0.2":"2024-08-14T09:10:44.588Z","1.0.3":"2024-08-14T09:12:32.495Z","1.0.4":"2024-08-14T09:14:35.672Z","1.0.5":"2024-08-14T09:18:23.841Z","1.0.6":"2024-08-14T09:39:22.510Z","1.0.7":"2024-08-14T09:57:28.812Z","1.0.8":"2024-08-14T10:06:59.087Z","1.0.9":"2024-08-14T10:29:47.391Z","1.0.10":"2024-08-15T06:14:10.518Z","1.0.11":"2024-08-28T18:03:16.799Z","1.0.12":"2024-08-31T05:42:29.148Z"},"bugs":{"url":"https://github.com/56duong/extract-ngx-translate/issues"},"author":{"name":"Nguyen Ngoc Thuy Duong"},"license":"MIT","homepage":"https://github.com/56duong/extract-ngx-translate#readme","keywords":["ngx-translate","angular","ngx-translate-extract","translation","i18n","extract"],"repository":{"type":"git","url":"git+https://github.com/56duong/extract-ngx-translate.git"},"description":"Extracting translation keys from Angular HTML and TypeScript files when you use the ngx-translate.","maintainers":[{"name":"56duong","email":"56duong@gmail.com"}],"readme":"# extract-translations\r\n\r\n`extract-translations` is a Node.js script designed to extract translation keys from your source files and update your translation JSON files. It supports various transformation options to format the keys and values as needed.\r\n\r\n\r\n## Features\r\n\r\n- Extracts translation keys from `.html` and `.ts` files.\r\n- Supports various transformation options for keys and values.\r\n- Cleans up unused keys in existing translation files.\r\n- Merges new keys into existing translation files.\r\n\r\n\r\n## Installation\r\n\r\nYou can install the package via npm:\r\n\r\n```sh\r\nnpm i @56duong/extract-ngx-translate\r\n```\r\n\r\n\r\n## Usage\r\n\r\nTo run the script, use the following command:\r\n\r\n```sh\r\nnpx @56duong/extract-ngx-translate <inputDir> <outputPaths...> [options]\r\n```\r\nBy default, the script will add keys that do not exist or only update keys that do not have a value, the script will delete keys that no longer exist in the source files unless they have a `_preserve` key set to `true` to prevent removal. \r\n\r\n\r\n### Parameters\r\n\r\n- `<inputDir>`: The directory containing the source files to scan for translation keys.\r\n- `<outputPaths...>`: One or more paths to the translation JSON files to update.\r\n\r\n\r\n### Options\r\n```\r\nFile Type Option\r\n  --file-types, -f: A string specifying the file types to process (default: '.ts,.html').\r\n\r\nDefault Value Options\r\n  --key-as-default-value, --kd: Use key as default value.\r\n  --null-as-default-value, --nd: Use null as default value.\r\n  --string-as-default-value, --esd: Use a specific string as default value.\r\n  If no specific value transformation argument (`--kd`, `--nd`, `--esd`) is provided, the default value is an empty string (`''`).\r\n\r\nKey Transformation Options\r\n  --remove-underscore, --ru: Use key as default value and remove underscores.\r\n  --uppercase, --up: Convert key to uppercase.\r\n  --capitalize, --c: Capitalize the first letter of every word in the key.\r\n  --lowercase, --l: Convert key to lowercase.\r\n  --uppercase-first-value, --ufv: Uppercase the first letter of the value.\r\n\r\nOverwrite Option\r\n  --overwrite, --o: Overwrite existing translation values with new ones. By default, the script only updates existing keys if they do not have a value. The --overwrite option cannot overwrite keys with the `_preserve` key set to `true`.\r\n\r\nTranslate Service Identifier Option\r\n  --translate-service, --ts: Specify the name of the translation service to use in TypeScript files (default: 'translateService'). Example: --translate-service='translateService'.\r\n```\r\n\r\n\r\n### Regular Expressions Used\r\nThe script uses regular expressions to identify translation keys in your source files. Below is the regexMap constant that defines the patterns for different file types:\r\n```\r\nconst regexMap = {\r\n  '.html': /'\"['\"]\\s*\\|\\s*translate/g,\r\n  '.ts': new RegExp(`${translateService}\\\\.instant\\\\(\\\\s*'\"['\"]\\\\s*\\\\)`, 'g'),\r\n};\r\n```\r\n\r\n#### Explanation\r\n- HTML Files (.html):\r\n  - The regular expression ```/'\"['\"]\\s*\\|\\s*translate/g``` is used to match translation keys within HTML files.\r\n  - It looks for strings enclosed in single or double quotes that are followed by the ```| translate``` pipe.\r\n  - Example: ```<p>{{ 'hello_world' | translate }}</p>``` will match ```'hello_world'```.\r\n  - The regular expression is flexible with spaces, so it will also match ```<p>{{'hello_world'|translate}}</p>```.\r\n\r\n- TypeScript Files (.ts):\r\n  - The regular expression ```new RegExp(`${translateService}\\\\.instant\\\\(\\\\s*['\"]([^'\"]*)['\"]\\\\s*\\\\)`, 'g')``` is used to match translation keys within TypeScript files.\r\n  - It looks for strings enclosed in single or double quotes that are passed as arguments to the specified translation service's `instant` method.\r\n  - Example: ```const hello = this.translateService.instant('hello_world');``` will match ```'hello_world'```.\r\n  - Note: The default translation service identifier is `translateService`, but you can specify a different identifier using the `--translate-service` option.\r\n\r\n\r\n### Example\r\n\r\n```sh\r\nnpx @56duong/extract-ngx-translate ./src/app ./src/assets/i18n/en.json ./src/assets/i18n/fr.json ./src/assets/i18n/vi.json --file-types='.ts,.html' --key-as-default-value --uppercase-first-value --remove-underscore\r\n```\r\nor\r\n```sh\r\nnpx @56duong/extract-ngx-translate ./src/app ./src/assets/i18n/en.json ./src/assets/i18n/fr.json ./src/assets/i18n/vi.json --file-types='.ts,.html' --kd --ufv --ru\r\n```\r\nThis command will:\r\n\r\n- Scan the `./src/app` directory for `.ts` and `.html` files.\r\n- Extract translation keys and apply the specified transformations. Use key as default value, uppercase the first letter of the value and remove underscores. \r\n- Update the `en.json`, `fr.json`, and `vi.json` files with the new keys and values.\r\n\r\n\r\n### Input Example\r\n\r\n#### TypeScript File (`example.component.ts`)\r\n```typescript\r\nimport { TranslateService } from '@ngx-translate/core';\r\n\r\nexport class ExampleComponent {\r\n  constructor(private translateService: TranslateService) {}\r\n\r\n  ngOnInit() {\r\n    const hello = this.translateService.instant('hello_world');\r\n    const welcome = this.translateService.instant('welcome_message');\r\n  }\r\n}\r\n\r\nNote: The default translation service identifier is `translateService`, but you can specify a different identifier using the `--translate-service` option.\r\n```\r\n\r\n#### HTML File (example.component.html)\r\n```html\r\n<p>{{ 'hello_world' | translate }}</p>\r\n<p>{{ 'welcome_message' | translate }}</p>\r\n```\r\n\r\n\r\n### Output Example\r\n\r\n#### English Translation File (en.json)\r\n```json\r\n{\r\n  \"hello_world\": \"Hello world\",\r\n  \"welcome_message\": \"Welcome message\"\r\n}\r\n```\r\n\r\n#### French Translation File (fr.json)\r\n```json\r\n{\r\n  \"hello_world\": \"Hello world\",\r\n  \"welcome_message\": \"Welcome message\"\r\n}\r\n```\r\n\r\n#### Vietnamese Translation File (vi.json)\r\n```json\r\n{\r\n  \"hello_world\": \"Hello world\",\r\n  \"welcome_message\": \"Welcome message\"\r\n}\r\n```\r\n\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.\r\n","readmeFilename":"README.md"}