Closed kakserpom closed 8 months ago
Hi, glad that you have liked ttag!!! Seems like a reasonable improvement, going to add this feature to lib.
@AlexMost
let missingPhrases = []
ttag.onMissingPhrase(async phrase => {
if (missingPhrases.includes(phrase)) {
return
}
missingPhrases.push(phrase)
phrase = phrase.replace(/\r?\n/g, '\\n')
await fs.promises.appendFile('locales/' + locale + '.po', `msgid "${phrase}"\nmsgstr "${phrase}"\n\n`)
})
This way we don't need to write .po entries by hand :) Just write some code, test it and then translate.
Interesting use case. We are using ttag-cli https://github.com/ttag-org/ttag-cli for extracting and updating .po
.pot
files in our projects.
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch
ttag@1.7.24
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.