Skip to content

Fix i18n functions#516

Merged
GaryJones merged 5 commits intoTGMPA:developfrom
ramiy:develop
Apr 19, 2016
Merged

Fix i18n functions#516
GaryJones merged 5 commits intoTGMPA:developfrom
ramiy:develop

Conversation

@ramiy
Copy link
Copy Markdown
Contributor

@ramiy ramiy commented Jan 9, 2016

In WordPress 4.4 we fixed many translation functions in the core. The same coding standards should be implemented in TGM too.

@jrfnl
Copy link
Copy Markdown
Contributor

jrfnl commented Jan 9, 2016

Hi @ramiy Nice one! Thank you.
I'll look through it in detail in a moment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As this 'string' is so generic, should it not have a translators comment and a context through _x ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jrfnl,

The context is used to describe the entire string, translators comment are used to describe specific placeholders like %s, %1$s, %2$s and others.

Translators comment location

In this case, translators comment are needed because we have two placeholders in this string.

As for the context, I'm not sure. We can set "Install/Update Status" as a context, but It's not providing more information than the translator comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In this case, I'd prefer to have both the translators comment and the context. The TGMPA library is included in themes as well as plugins and in the case of wp.org hosted themes, the text-domain is replaced by the theme text-domain.
If, for whatever reason, the theme would have the same generic string in use, things could become very confusing for translators.
For the other strings, I'd think that to be far less likely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a very good point. I agree with you.

@GaryJones
Copy link
Copy Markdown
Member

I'm +1 for everything happening here. I was aware that _x ≠ translator comment, but hadn't had time to go through it, so thank you @ramiy!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Considering that the strings are now concatenated and all individual bits are escaped, I think we can get rid of the wp_kses_post() wrapper.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome! Thanks. If you could squash the commits, I'll merge it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Squash the commits??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As all the changes in the PR are related, it makes more sense, having one commit containing them all, then having four different commits for it.
Squashing is a way to achive that.

See: http://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @ramiy I'd really like to merge this. Any chance you can do the squash in the near future ? Thanks!

Let me know if you need any help with that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jrfnl can't squash this. I use SourceTree for windows, It does not support squash, only the mac version allow the squash.

Does it really matter if you merge one commit or four different commits?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can't do it, I have issues with SourceTree terminal:

screenshot

Sorry guys...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @ramiy Sorry to hear you're having trouble with this. The link I send you originally also contains a step by step example of how to do this manually if squash is not supported. Maybe that can help ?

@GaryJones GaryJones merged commit 88e8b1b into TGMPA:develop Apr 19, 2016
jrfnl added a commit that referenced this pull request May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants