Unknown language json files

  1. what are these language files for? (I guess it is for localizing javascript?)

You guessed right. The JSONs are for use specifically with the new wp_set_script_translations function in WordPress 5.

  1. is it necessary to add/commit/push them to the live server?

They are used at runtime, just like .mo files are. So yes, add them to your deployment if you want the translations to work.

(Note that currently the JSON translations are only used by admin screens, but this could change at any time and will also start applying to theme and plugin translations)

  1. why do they have such a strange name scheme? Nobody can guess what they’re for from just looking at the file name…

The names are derived from the script that uses each file.

From your example: the first string in the file is "Reusable Blocks". This is used by the script at wp-includes/js/dist/blocks.min.js – Take off the .min and the MD5 hash is 1a0cd6a7128913b15c1a10dd68951869.

It’s not possible to know which script it’s required for without searching the code, but there’s a ticket open about that.

Leave a Comment