-
Notifications
You must be signed in to change notification settings - Fork 45
Registering Post Meta fields for translation
Babble provides an API which allows developers to register post meta fields (keys) for translation. Meta fields not listed for translation have the data synced from the canonical language into the other languages. We take this approach because not all meta fields need translation, and because we need the developer to specify which UI element is appropriate for that field; e.g. single line text field, text area, rich-text editor. Often when the meta fields provided to a user
We include an example plugin to specify the fields for translation in the WordPress SEO plugin, so you can see this in action (and hopefully see that it is not a complex process).
To specify a field, you must hook the bbl_translated_meta_fields filter, which passes an array of objects. Each index in the array corresponds to the meta_key which is to be translated, and each contains an instance of either Babble_Meta_Field_Text, Babble_Meta_Field_Textarea, or Babble_Meta_Field_Editor which specifies the UI to be provided to the translator.