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

Bug: "extract --sort" not working when output is set to POT

votdev opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Is this a regression?

No

Current behavior

Running transloco-keys-manager extract --sort does not sort the keys in the output file.

The output looks like this for previously started project:

msgid ""
msgstr ""
"mime-version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Toggle navigation"
msgstr ""

msgid "Help"
msgstr ""

msgid "Dashboard"
msgstr ""

msgid "OK"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Yes"
msgstr ""

msgid "No"
msgstr ""

msgid "Users"
msgstr ""

msgid "Do you really want to sign out?"
msgstr ""

Expected behavior

The keys/msgid should be sorted, e.g. like ngx-translate-extract is doing it.

Please provide a link to a minimal reproduction of the bug

https://github.com/aquarist-labs/s3gw-ui

Transloco Config

module.exports = {
  rootTranslationsPath: 'src/assets/i18n/',
  langs: ['en_US'],
  keysManager: {
    fileFormat: 'pot',
    marker: 'TEXT',
    defaultValue: ''
  }
};

Debug Logs

No response

Please provide the environment you discovered this bug in

Transloco: 4.1.0
Transloco Keys Manager: 3.4.1
Angular: 13.3.11
Node: v16.15.1
Package Manager: 
OS: Ubuntu

Additional context

No response

I would like to make a pull request for this bug

No

@votdev Please provide the expected result and the actual result. I don't understand the output you pasted.

@votdev Please provide the expected result and the actual result. I don't understand the output you pasted.

Sure.

The current output looks like this (taken from above):

msgid ""
msgstr ""
"mime-version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Toggle navigation"
msgstr ""

msgid "Help"
msgstr ""

msgid "Dashboard"
msgstr ""

msgid "OK"
msgstr ""

msgid "Cancel"
msgstr ""

The expected result is this when using the --sort option.

msgid ""
msgstr ""
"mime-version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Cancel"
msgstr ""

msgid "Dashboard"
msgstr ""

msgid "Help"
msgstr ""

msgid "OK"
msgstr ""

msgid "Toggle navigation"
msgstr ""

@votdev so if I understand correctly it seems that the issue is occurring when using POT output format, can you confirm?

@votdev so if I understand correctly it seems that the issue is occurring when using POT output format, can you confirm?

Yes