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

Json-Generator: Show all strings with pretty print #104

Closed
wants to merge 2 commits into from
Closed

Json-Generator: Show all strings with pretty print #104

wants to merge 2 commits into from

Conversation

ScreamingDev
Copy link
Contributor

The Json-Generator filtered untranslated string out for the JSON-File.
With such file a developer needs more time to translate things
because he needs to look it up several times.

For a better workflow all translatable strings are included in the JSON-File.
With pretty-print (>= PHP 5.4) the JSON is more human readable.

The Json-Generator filtered untranslated string out for the JSON-File.
With such file a developer needs more time to translate things
because he needs to look it up several times.

For a better workflow all translatable strings are included in the JSON-File.
With pretty-print (>= PHP 5.4) the JSON is more human readable.
@mlocati
Copy link
Member

mlocati commented Mar 20, 2016

What happens on PHP 5.3 (JSON_PRETTY_PRINT is not defined)?

@ScreamingDev
Copy link
Contributor Author

Wow. You like to keep that PHP 5.3 support?
PHP itself does not support that anymore.

I might be able to fix this.

@mlocati
Copy link
Member

mlocati commented Mar 20, 2016

Yes, this library still supports 5.3 (as you can read from the composer.json file)

@ScreamingDev
Copy link
Contributor Author

Thanks. I contributed to some projects and some like to drop old PHP.
For yours I've taken a workaround from http://php.net/manual/en/function.json-encode.php#80339

Feel free to merge or not :)

@oscarotero
Copy link
Member

I think a better way is to allow to configure how the json can be generated, using a public static variable. For example:

Gettext\Generators\JsonDictionary::$options = JSON_PRETTY_PRINT;

@oscarotero
Copy link
Member

I close this pull request because I've added the $options static property to JsonDictionary generator

@oscarotero oscarotero closed this Apr 12, 2016
@ScreamingDev
Copy link
Contributor Author

Thank you! I didn't had time for that recently due to so much community driven events.
I'll add that to my project https://github.com/sourcerer-mike/wp-easy-translate after all the trouble ;)

@ScreamingDev ScreamingDev deleted the json-with-missing-translations branch April 13, 2016 10:06
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

Successfully merging this pull request may close these issues.

None yet

3 participants