i18next-scanner icon indicating copy to clipboard operation
i18next-scanner copied to clipboard

Support for Angular Translation Pipe

Open Desnoo opened this issue 4 years ago • 2 comments

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'.

Desnoo avatar Oct 28 '19 17:10 Desnoo

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?

barrystaes avatar Jun 09 '21 10:06 barrystaes

Did anyone of you find a solution to extract strings preceding pipes in angular templates?

genox avatar Apr 12 '23 12:04 genox