The wpml-config.xml file

The wpml-config.xml file

The WordPress multilingual plugin WPML has been created far before Polylang and thus some plugins and themes have been written to play nicely with it. Polylang does support the WPML language configuration file wpml-config.xml to avoid double work for themes and plugins author.
Here is an example which is pretty much self explanatory:
123456789101112131415161718192021222324            quantity        custom-title                book        DVD                genre                                                                                                                    
custom-fields: the custom field name needs to be provided and also the action that Polylang is expected to take:

「ignore」: no action from Polylang
「translate」: the custom field is copied from the source post but may be modified
「copy」: the custom field is copied from the source post and synchronized accross translations

custom-types: the custom post types that Polylang should manage. Allowed values for the 「translate」 attribute are 1 (managed by Polylang) and 0 (not managed by Polylang). In both cases, users cannot change this choice in Polylang settings.
taxonomies: the custom taxonomies that Polylang should manage. Allowed values for the 「translate」 attribute are 1 (managed by Polylang) and 0 (not managed by Polylang). In both cases, users cannot change this choice in Polylang settings.
admin-texts: When themes and plugins use 『get_option』, Polylang can filter these calls and provide translation to the values of these options. To translate a single option, add a key entry under admin-texts (as simple_string_option in the example above). To translate a serialized array, add several keys under a key (as in my_plugin_options in the example above).
Polylang does not support the section.
Developpers must place the wpml-config.xml file in the root directory of the plugin or theme. It is also possible for users to create their own wpml-config.xml file and to upload it in /wp-content/polylang/ (create the directory if it does not exist).

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注