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

updateTimestamp: false not working #76

Closed
themenow opened this issue Mar 21, 2018 · 8 comments
Closed

updateTimestamp: false not working #76

themenow opened this issue Mar 21, 2018 · 8 comments

Comments

@themenow
Copy link

themenow commented Mar 21, 2018

Still the date is updated without other changes, I'm using the latest version 1.0.2

makepot: {
    theme: {
        options: {
            cwd: '',
            mainFile: 'style.css',
            domainPath: 'languages/',
            exclude: ['node_modules/.*'],
            potFilename: '<%= x %>.pot',
            potHeaders: { 'report-msgid-bugs-to': 'http://theme-homepage' },
            type: 'wp-theme',
            updateTimestamp: false,
        }
    }
};

By the way, do I need to add also '.svn' to exclude ?

@bradyvercher
Copy link
Member

I haven't had time to look into this, but there is a passing test for this . If anyone can demonstrate this behavior with a failing test, that would be helpful.

@av3nger
Copy link

av3nger commented Dec 19, 2018

updateTimestamp: false regenerates the .pot file for me as well with only the changed timestamp

diff --git a/languages/default.pot b/languages/default.pot
index ea5f43f1..7e9ad854 100644
--- a/languages/default.pot
+++ b/languages/default.pot
@@ -4,7 +4,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Project Name\n"
-"POT-Creation-Date: 2018-12-19 10:38:42+00:00\n"
+"POT-Creation-Date: 2018-12-19 10:39:15+00:00\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"

@bradyvercher
Copy link
Member

@av3nger I haven't been able to replicate this. If you could submit a failing test or step through the code to determine where the issue is, that would be helpful.

@av3nger
Copy link

av3nger commented Dec 20, 2018

@bradyvercher , I don't know if this helps, but it's failing at Pot.prototype.sameAs()
the pot.content contains X-Generator: grunt-wp-i18n1.0.2 which this.contents does not contain. thus the hashes for the files do not match

@bradyvercher
Copy link
Member

Thanks, but that doesn't really give me any ideas. Is there a reason you know of that would cause the generated POT to be missing the X-Generator header?

The Grunt tasks adds that header to the options, then sends those along to the node package. The node package reads the existing POT file, generates a new one, then compares the original with the generated version to see if there have been any changes. The X-Generator header should be in both versions.

@av3nger
Copy link

av3nger commented Dec 21, 2018

@bradyvercher, you can configure a separate test task, run it with grunt and compare pot.content and this.contents - they do not match. X-Generator is present in the headers of both outputs, but it's not there in msgstr section in one of the files

bradyvercher added a commit to cedaro/node-wp-i18n that referenced this issue Dec 21, 2018
This causes the test to fail due to the way headers are stored in the POT object
after being parsed. See cedaro/grunt-wp-i18n#76
@bradyvercher
Copy link
Member

@av3nger Ah, thanks for sticking with me on that. I think I figured out what was going on and hopefully this commit should take care of it.

@bradyvercher
Copy link
Member

I believe this should be good to go in 1.0.3. Feel free to reopen with more details if it still doesn't work.

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