i18next-scanner
i18next-scanner copied to clipboard
Support for Angular Translation Pipe
Version
- i18next: 17.3.1
- i18next-scanner: 2.10.3
Request
It would be nice to extract placeholders that are associated with a translation pipe in angular. For example you can use in an inline template or external template a translation pipe. i18next is in this case the pipe provided by https://github.com/Romanchuk/angular-i18next:
<h1 class="mat-h1">{{ 'app_settings_configuration_categories_edit_headline' | i18next }}</h1>
In this case I want to extract the provided placeholder 'app_settings_configuration_categories_edit_headline'.
Same question, and wondering whats currently possible in Angular to extract a JSON with the default language keys 9and possible default translations).
I already used i19next-scanner with React,
t('common:foobarkey',{defaultValue :'foobar text')
and now wonder if and how it could do the same for a Angular project. We use a pipe called translate
:
<span>{{ 'common_foobar_key' | translate }}</span>
Often key is a plain string, but could also be a constant or a variable (e.g. array of dropdown options) .. any chance that such Angular usage would be supported by i18next-scanner? Or is there "regex" trick that we could use to parse code statistically and get keys + defaults?
Did anyone of you find a solution to extract strings preceding pipes in angular templates?