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

Sort output option added to Po generator #227

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vaites
Copy link
Contributor

@vaites vaites commented Oct 1, 2019

Separated pull request as requested ;)

@@ -27,6 +29,12 @@ public static function toString(Translations $translations, array $options = [])

$lines[] = '';

if ($options['sortOutput'] == true) {
$translations->uasort(function (Translation $translation1, Translation $translation2) {
return strcmp($translation1->getOriginal(), $translation2->getTranslation());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand - sorting by comparing original with the translation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault. The comparison must be this:

return strcmp($translation1->getOriginal(), $translation2->getOriginal());

Sorry. Must I send a fix or can you change it?

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

2 participants