Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option for formatOptions - origins - lineNumbers: true / false #805

Closed
alesn opened this issue Nov 1, 2020 · 6 comments · Fixed by #1007
Closed

Add config option for formatOptions - origins - lineNumbers: true / false #805

alesn opened this issue Nov 1, 2020 · 6 comments · Fixed by #1007

Comments

@alesn
Copy link

alesn commented Nov 1, 2020

The issue is described in #587

The current state is there is an option in Lingui configuration "origins", which enables / disables including file paths -and- line numbers of origin in the catalog. Origins provide some context information for the translator but at the same time, especially line numbers change regularly. The file part of the origin doesn't change that much and is the part that gives context to translation. My proposal is - if there is some use for keeping line numbers in origins for someone, to add an option to 'origins' - something like 'lineNumbers: true/false" (possibly making false the default). If there isn't really need to keep the line numbers in 'origins', to remove them. What do you think?

@stale
Copy link

stale bot commented Dec 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 31, 2020
@stale stale bot closed this as completed Jan 7, 2021
@nathanforce
Copy link

I'd also like to keep origins but remove line numbers. In our case the line numbers are incorrect and they don't offer much other than noise in PRs.

@semoal
Copy link
Contributor

semoal commented Mar 23, 2021

Released right now with 3.8.0! :)

@timonbimon
Copy link

timonbimon commented Jul 7, 2021

A question: I tried setting lineNumbers to false which works great for the default (english) translation messages, but doesn't for the second (German) messages.po file? There I get a bunch of "empty" origins (see below). Any ideas how to also get the origins (without line numbers) in the second messages.po file?

This is my config

export default {
    locales: ['en', 'de'],
    sourceLocale: 'en',
    catalogs: [
        {
            path: 'src/locales/{locale}/messages',
            include: ['src'],
        },
    ],
    formatOptions: {
        origins: true,
        lineNumbers: false,
    },
    format: 'po',
    orderBy: 'origin',
    compileNamespace: 'ts',
};

image
image

@alesn
Copy link
Author

alesn commented Jul 7, 2021

@timonbimon: Are you using the latest version of Lingui? This was happening in a previous version but it's working fine for me in the latest

@timonbimon
Copy link

Thanks updating helped indeed! Sorry for the noise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants