food-and-drink-menu
food-and-drink-menu copied to clipboard
Add wpml/polyang support (wpml-config.xml)
wpml-config.xml
for plugin/theme is loaded automatically by wpml/polylang:
<wpml-config>
<custom-fields>
<custom-field action="translate">fdm_item_price</custom-field>
<custom-field action="translate">fdm_menu_column_one</custom-field>
<custom-field action="translate">fdm_menu_column_two</custom-field>
<custom-field action="translate">fdm_menu_footer_content</custom-field>
</custom-fields>
<custom-types>
<custom-type translate="1">fdm-menu</custom-type>
<custom-type translate="1">fdm-menu-item</custom-type>
</custom-types>
<taxonomies>
<taxonomy translate="1">fdm-menu-section</taxonomy>
</taxonomies>
</wpml-config>
Can you describe in more detail the problem that you're raising and the change you're proposing?
I can see that this makes a couple of changes to the existing wpml-config.xml file:
- It adds
fdm_item_price
to thecustom-fields
list with instructions totranslate
. - It changes
fdm_menu_column_one
andfdm_menu_column_two
fromcopy
totranslate
.
For (1), I have deliberately left this open, because some users want to copy
and some users want to translate
. Leaving it unspecified will let you configure the behaviour you want in WPML.
For (2), I don't think translate
is the right action. I believe copy
is more appropriate, as the layout doesn't typically change from one language to another.
I'll close this as wontfix
for now, but feel free to reopen if you want to press the case for either change.
@NateWr: Apparently it is necessary to translate fdm_menu_column_one
and fdm_menu_column_two
because Polylang creates a different post (with different ID) for each translation (language).
Hence copying these fields instead of independently translating them results in
the menu columns being cleared in the other translations.
Related issue: https://github.com/NateWr/food-and-drink-menu/issues/50