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

Feature Request: Option to skip source-file information #410

Open
arneee opened this issue Mar 15, 2020 · 2 comments
Open

Feature Request: Option to skip source-file information #410

arneee opened this issue Mar 15, 2020 · 2 comments

Comments

@arneee
Copy link

arneee commented Mar 15, 2020

Hi,

it would be great if the file-source item in the translation file could be skipped by the extract command. Maybe make it configurable via the translation.yaml.

Background: When changing translations, I like to review all changes in the xliff files before committing them to git. The problem is that if I've been working on same pages and files, the changeset is always huge since a lot of line numbers change. That makes it really hard to see what translations were added, removed or changed.

I don't have any use for the file-source information.

@odolbeau
Copy link
Member

Hi @arneee
I think this could be linked to #404 maybe?

Some huge changes are planned in php-translation foundation in order to fix a bunch of bugs at the same time, including #404.
I let your issue open for now and we'll see later if it's still a needed change.

@barthy-koeln
Copy link

We've been struggling with this for a few years, too. It's a huge pain for code reviews, merge requests, merge conflicts, etc...
We do not have any use for the information as well, because we follow file and key naming conventions that give enough context.

Quick Tip: we added a bash command as a pre-commit hook:

sed -i '/category="file-source"/d' $(find translations -name '*.xlf')

This will remove any line that contains category="file-source". If you want to go even further and strip all notes:

sed -i '/<\/\?notes\?/d' $(find translations -name '*.xlf')

Remember to stage the changes again so that they will be part of the commit:

git update-index --again

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

3 participants