[wp-trac] [WordPress Trac] #56435: Alleviate translation workload

WordPress Trac noreply at wordpress.org
Thu Aug 25 02:11:29 UTC 2022


#56435: Alleviate translation workload
--------------------------+-----------------------------
 Reporter:  anrghg        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Checking out https://translate.wordpress.org/projects/wp/dev/af/default/
 I’m scared by the unnecessary workload and strain put on:

 1. Translators of WordPress Core;
 2. Translators of plugins.

 I’d suggest taking urgent corrective action to address two issues, and to
 improve practice in order to prevent these issues:

 1. Gettext strings in WordPress Core are very messy and don’t follow all
 rules set out on
 https://developer.wordpress.org/plugins/internationalization/how-to-
 internationalize-your-plugin/#best-practices-for-writing-strings:

 * Avoid unusual markup and unusual control characters – do not include
 tags that surround your text
 * Do not put unnecessary HTML markup into the translated string

 There are 150+ messages with HTML in them.

 Examples:
 {{{
 #: wp-includes/js/dist/block-library.js:31347
 msgid "Commenter avatars come from <a>Gravatar</a>"
 msgstr ""

 #. translators: %s: Comment author link.
 #: wp-includes/js/dist/block-library.js:31319
 msgid "%s <span>says:</span>"
 msgstr ""

 #. translators: %s: URL to media library.
 #: wp-includes/widgets/class-wp-widget-media.php:501
 msgid "That file cannot be found. Check your <a href=\"%s\">media
 library</a> and make sure it was not deleted."
 msgstr ""
 }}}

 I’d prefer using two placeholders like so (uneven spacing is intentional):
 {{{
 #. translators: 1, 2: start and end link tags.
 msgid "That file cannot be found. Check your %1$s media library%2$s and
 make sure it was not deleted."
 }}}

 * Try to use the same words and same symbols so not multiple strings needs
 to be translated

 Example:
 {{{
 #: wp-activate.php:183 wp-includes/post-template.php:1728
 #: wp-admin/includes/meta-boxes.php:203
 msgid "Password:"
 msgstr "Wagwoord:"

 #: wp-includes/general-template.php:518 wp-login.php:1407
 #: wp-admin/includes/class-wp-posts-list-table.php:1712
 #: wp-admin/includes/file.php:2351 wp-admin/install.php:137
 #: wp-admin/install.php:427 wp-admin/options-writing.php:167
 #: wp-admin/setup-config.php:225 wp-admin/user-new.php:564
 msgid "Password"
 msgstr "Wagwoord"
 }}}

 2. I’d suggest to withdraw the recommendation “If there are strings in
 your plugin that are also used in WordPress core (e.g. ‘Settings’), you
 should still add your own text domain to them, otherwise they’ll become
 untranslated if the core string changes (which happens).” on
 https://developer.wordpress.org/plugins/internationalization/how-to-
 internationalize-your-plugin/#add-text-domain-to-strings.

 Trying to streamline a plugin’s Gettext strings I’m looking into the first
 WordPress Core PO file, that I’m using as a reference for the Portable
 Object Message Catalog of WordPress Core.

 In plugins, as many strings as possible should be synced with WordPress
 Core, to benefit from any existing translations. There is a caveat to
 this, @see link above. But those strings are very unlikely to change.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56435>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list