question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ngettext definition not in resulting .po-file

See original GitHub issue

Hi,

I have the following code-block in my application, which is not detected by the parser and thus not included in the resulting .po-file:

import { ngettext, msgid } from 'ttag.macro';

export const timespanTypePluralNameFunc = {
  [TimespanType.WEEK]: count => ngettext(msgid`Woche`, `Wochen`, count),
  [TimespanType.MONTH]: count => ngettext(msgid`Monat`, `Monate`, count),
  [TimespanType.YEAR]: count => ngettext(msgid`Jahr`, `Jahre`, count),
};

Other functions with ngettext are working perfectly fine, f.ex. this is included and working:

  import { ngettext, msgid } from 'ttag.macro';

  getDaysLine() {
    const { days = 0 } = this.props.entry;

    return (
      <span>
        {days} {ngettext(msgid`Tag`, `Tage`, days)}
      </span>
    );
  }

Maybe it’s not a bug and I do not understand the upper scope correctly? It is really unexpected anyway.


Acutally it is include in the .po file, but only as singular form:

#: src/maps/index.js:75
msgid "Woche"
msgstr "Woche"

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
aldipowercommented, May 26, 2020

Ok @AlexMost, that was easy to reproduce.

https://github.com/aldipower/ttag-test

Plural forms of src/test-map/index.js should show up in i18n/en.po after running npm run i18n-update, but the do not.

0reactions
aldipowercommented, May 26, 2020

Yes, let me try to reproduce it in a clean repo. Please hold the line. 😉 Could take me a while…

Read more comments on GitHub >

github_iconTop Results From Across the Web

GNU gettext utilities
Concatenating the empty string does not change the resulting overall string, but it is a way for us to comply with the necessity...
Read more >
Analyzing Queries Using Query Profile
A query whose result is computed based purely on metadata, without accessing any data. These queries are not processed by a virtual warehouse....
Read more >
sp_send_dbmail (Transact-SQL) - SQL Server - Microsoft Learn
When no profile_name is specified, sp_send_dbmail uses the default private profile for the current user. If the user does not have a default...
Read more >
Data definition language (DDL) statements in ... - Google Cloud
The following example creates a clustered table named myclusteredtable in mydataset using the result of a query. The table is not partitioned. CREATE...
Read more >
13.7.7.30 SHOW PROFILE Statement
The SHOW PROFILE and SHOW PROFILES statements display profiling information that indicates resource usage for ... MEMORY is not currently implemented.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found