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

[Q] How to turn off locations of strings in po file? #143

Closed
zaigham opened this issue Mar 24, 2017 · 2 comments
Closed

[Q] How to turn off locations of strings in po file? #143

zaigham opened this issue Mar 24, 2017 · 2 comments

Comments

@zaigham
Copy link

zaigham commented Mar 24, 2017

How can I achieve the following with \Gettext\Generators\Po::toFile ?

'--no-location’
Do not write ‘#: filename:line’ lines.

I want to remove strings locations from code files in generated PO file.
Thanks.

Ref: https://www.gnu.org/software/gettext/manual/html_node/msgattrib-Invocation.html

@oscarotero
Copy link
Member

Currently this is not supported, but it's easy to implement.
Meanwhile, you can remote the references before generate the PO file:

foreach ($translations as $translation) {
    $translation->deleteReferences();
}

$translations->toPoFile('locales.po');

@oscarotero
Copy link
Member

I've added this option to po generator (ref: 97d7b7d):

$translations->toPoFile('locales.po', ['noLocation' => true]);

It will be released in the new version.

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

No branches or pull requests

2 participants