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

Generating empty file #3

Closed
maximejobin opened this issue Apr 16, 2019 · 3 comments
Closed

Generating empty file #3

maximejobin opened this issue Apr 16, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@maximejobin
Copy link
Contributor

If WordPress, a theme or a plugin generated PO file should not contain anything because there is no translation to merge or validate, a message should be displayed like this:

The query could not generate any strings to merge. Please check if the project is already fully translated.
@maximejobin maximejobin added the bug Something isn't working label Apr 16, 2019
@maximejobin
Copy link
Contributor Author

maximejobin commented Apr 16, 2019

As of now (there is no translation to do), the following command creates the problem:

wp po merge fr-ca fr 4.3 --diff-only

It produces this file:

# Translation of WordPress - 4.3.x in French (Canada)
# This file is distributed under the same license as the WordPress - 4.3.x package.
msgid ""
msgstr ""
"PO-Revision-Date: 2019-02-02 18:13:20+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: GlotPress/2.4.0-alpha\n"
"Language: fr_CA\n"
"Project-Id-Version: WordPress - 4.3.x\n"

It should produce no file and simply display a message.

PavelZaharciuc added a commit to PavelZaharciuc/po-merger that referenced this issue Apr 17, 2019
@maximejobin
Copy link
Contributor Author

@PavelZaharciuc

I ran the command:

wp po merge fr-ca fr 5.1 --diff-only

... and got the following result:

image

Here is the current status of that project:

image

Shouldn't the "Administration" sub project return these 68 strings as they are not approved ?

@PavelZaharciuc
Copy link
Contributor

PavelZaharciuc commented Apr 26, 2019

The parameter "--diff-only" applies the filter "untranslated" to the download URL. Since the project doesn't have any untranslated strings, the request returns the PO file containing only the definition header.
Thus, this behavior is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants