Skip to content

Commit

Permalink
i18n: Remove the wp_get_jed_locale_data() function.
Browse files Browse the repository at this point in the history
This function was used as a translation workaround in the Gutenberg plugin, it has been replaced in core with the `wp_set_script_translations()` functionality, instead.

See #45111.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43910 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
pento committed Nov 21, 2018
1 parent 1254637 commit 0693a11
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/wp-includes/l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -1469,32 +1469,3 @@ function is_locale_switched() {

return $wp_locale_switcher->is_switched();
}

/**
* Returns Jed-formatted localization data.
*
* @since 5.0.0
*
* @param string $domain Translation domain.
* @return array Jed-formatted localization data.
*/
function wp_get_jed_locale_data( $domain ) {
$translations = get_translations_for_domain( $domain );

$locale = array(
'' => array(
'domain' => $domain,
'lang' => determine_locale(),
),
);

if ( ! empty( $translations->headers['Plural-Forms'] ) ) {
$locale['']['plural_forms'] = $translations->headers['Plural-Forms'];
}

foreach ( $translations->entries as $msgid => $entry ) {
$locale[ $msgid ] = $entry->translations;
}

return $locale;
}

1 comment on commit 0693a11

@fgheorghe
Copy link

@fgheorghe fgheorghe commented on 0693a11 Dec 17, 2018

Choose a reason for hiding this comment

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

This commit breaks these examples:
https://github.com/WordPress/gutenberg-examples
In particular this fix for that example:
WordPress/gutenberg-examples#51

Any clue what a proper fix might be?

Thank you!

Please sign in to comment.