jsverse / transloco-keys-manager

🦄 The Key to a Better Translation Experience

Home Page:https://github.com/jsverse/transloco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Let findMissingKeys return missing and extra keys

jgilsaa opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe

Hi,

I'm trying to create a verification step as part of a CI pipeline to check if a PR has any missing or extra keys in the main translation file.

The key-detective seems to be doing all the legwork of extracting and comparing translations, but since it only logs the result to the console I'm not able to use it for what I have in mind.

Describe the solution you'd like

Let findMissingKeys return the analysed translations file(s) in a fitting format fx:
{ [lang: string]: { missingKeys: string[]; extraKeys: string[]; } }

Describe alternatives you've considered

No response

Describe alternatives you've considered

Currently running `transloco-keys-manager find` only logs the results to the console in a table format.

Describe alternatives you've considered

Ideally I'd like to be able to run the findMissingKeys() as part of my pipeline and check the output

import { findMissingKeys } from '@ngneat/transloco-keys-manager/keys-detective';
...

const missingKeys = findMissingKeys({...});
// verify missing and extra keys

Additional context

No response

I would like to make a pull request for this feature

Yes 🚀