Skip to content

Commit

Permalink
feat: Remove obsolete messages from en.po when extracting
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Nov 26, 2020
1 parent 59db0f6 commit 0c7f43f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 74 deletions.
7 changes: 7 additions & 0 deletions lib/commands/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,13 @@ UPDATING PO FILE
shell.exec(`msgmerge ${mergeArgs}`);
});

let removeObsoleteOpts = ['--no-obsolete', `-o ${poFile}`, poFile];
let removeObsoleteArgs = removeObsoleteOpts.join(' ');

this.tryInvoke_(() => {
shell.exec(`msgattrib ${removeObsoleteArgs}`);
});

// invoke msginit in case current language
// is default language, otherwise the new
// strings would be left empty in PO file
Expand Down
75 changes: 1 addition & 74 deletions translations/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ msgstr ""

#: tests/dummy/app/controllers/application.js:12:10
#: tests/dummy/app/templates/test-page.hbs:19:0
#: tests/dummy/app/templates/test-page.hbs:20:0
#: tests/unit/services/l10n-test.js:152:6
msgid "en"
msgstr "en"
Expand Down Expand Up @@ -112,77 +113,3 @@ msgstr[1] "You have {{count}} subscriptions"
#: tests/unit/services/l10n-test.js:324:6
msgid "testing"
msgstr "testing"

#~ msgid ""
#~ "Your orders have been converted to schedules,\n"
#~ "please review them in scheduling across all your locations."
#~ msgstr ""
#~ "Your orders have been converted to schedules,\n"
#~ "please review them in scheduling across all your locations."

#~ msgid "NEW TEST"
#~ msgstr "NEW TEST"

#~ msgctxt "context"
#~ msgid "NEW TEST"
#~ msgstr "NEW TEST"

#~ msgid "singular 1"
#~ msgid_plural "plural 1"
#~ msgstr[0] "singular 1"
#~ msgstr[1] "plural 1"

#~ msgctxt "context"
#~ msgid "singular 1"
#~ msgid_plural "plural 1"
#~ msgstr[0] "singular 1"
#~ msgstr[1] "plural 1"

#~ msgid "This page only \"contains\" text for tests"
#~ msgstr "This page only \"contains\" text for tests"

#~ msgid "special chars work: \", ', ` and others!"
#~ msgstr "special chars work: \", ', ` and others!"

#~ msgid "sub test"
#~ msgstr "sub test"

#~ msgid "sub one"
#~ msgstr "sub one"

#~ msgid "cobbling plural"
#~ msgid_plural "cobbling plural MULTI"
#~ msgstr[0] "cobbling plural"
#~ msgstr[1] "cobbling plural MULTI"

#~ msgctxt "context"
#~ msgid "test"
#~ msgstr "test"

#~ msgctxt ""
#~ "multi-line\n"
#~ "context"
#~ msgid "message with"
#~ msgstr "message with"

#~ msgid ""
#~ "multi line singular\n"
#~ "is here"
#~ msgid_plural ""
#~ "multi line plural\n"
#~ "is here"
#~ msgstr[0] ""
#~ "multi line singular\n"
#~ "is here"
#~ msgstr[1] ""
#~ "multi line plural\n"
#~ "is here"

#~ msgctxt "context"
#~ msgid "singular"
#~ msgid_plural "plural"
#~ msgstr[0] "singular"
#~ msgstr[1] "plural"

#~ msgid "asdasd"
#~ msgstr "asdasd"
1 change: 1 addition & 0 deletions translations/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ msgstr ""

#: tests/dummy/app/controllers/application.js:12:10
#: tests/dummy/app/templates/test-page.hbs:19:0
#: tests/dummy/app/templates/test-page.hbs:20:0
#: tests/unit/services/l10n-test.js:152:6
msgid "en"
msgstr ""
Expand Down

0 comments on commit 0c7f43f

Please sign in to comment.