Skip to content

Broken translations #26

@justintadlock

Description

@justintadlock

I'm looking through the content templates, and one of the common issues I see with a lot of themes is broken translation strings like so:

%%DATE   before="<?php _e( 'Posted on ', 'cherry' ); ?>"%%

Generally, in straight PHP, this is best handled like so:

<?php printf( __( 'Posted on %s', 'cherry' ), get_the_date() ); ?>

The need for placeholders like %s is very important because not all languages have the same sentence structures. That's why Posted on %s is better; it allows translators to properly move the pieces of the strings around to match their language.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions