Skip to content

The new profile pages need to be better prepared for i18n #673

Description

@tobifjellner

When translating some new strings in the WordPress.org project, I stumbled upon some strings from the new efforts, co-ordinated by @yani- that are currently not well prepared for translation/localization.

Ref: https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/page-pledges.php

Code sample:

__( '%1$s &mdash; %2$s contributor. The <strong>%3$s</strong> filter is excluding you.', 'wporg-5ftf' ),
                    esc_html( $standing_user['name'] ),
                    empty( $standing_user['sponsored'] ) ? esc_html__( 'independent', 'wporg-5ftf' ) : esc_html__( 'sponsored', 'wporg-5ftf' ),
                    esc_html( $exclusion_label )
        ) );

Problem:
You should never build words/expressions/phrases/sentences by concatenating together smaller strings. Don't take for granted that all target languages have the same word and sentence structure as English.

Here are a couple of articles that cover most of the things that often make WordPress code unnecessary hard to translate:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions