Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

WPML for Theme Setting

Open rdanusha opened this issue 8 years ago • 2 comments

I have created custom theme setting page. framework-customizations/theme/options/settings.php I need to translate this setting page fields into another language. could you please help me on this? How can I do this? I used WPML plugin.

rdanusha avatar Jul 16 '18 15:07 rdanusha

Here is the docs of wpml how you can translate these fields in theme settings: https://wpml.org/documentation/support/language-configuration-files/

See below an example of the wmpl-config.xml The key fw_theme_settings_options:the-core is a key from db logo_settings is a key in the fw_theme_settings_options:the-core and so on

<wpml-config>
    <admin-texts>
        <key name="fw_theme_settings_options:the-core">
            <key name="logo_settings">
                <key name="logo">
                    <key name="image">
                        <key name="image_logo">
                            <key name="url"/>
                        </key>
                    </key>
                </key>
            </key>
        </key>
        <key name="fw_theme_settings_options:the-core">
            <key name="footer_settings">
                <key name="copyright"/>
            </key>
            <key name="header_settings">
                <key name="enable_header_top_bar">
                    <key name="yes">
                        <key name="header_text"/>
                    </key>
                </key>
            </key>
        </key>
        <key name="fw_theme_settings_options:the-core">
            <key name="posts_settings">
                <key name="button_options">
                    <key name="label" />
                </key>
            </key>
        </key>
    </admin-texts>
</wpml-config>

ViorelEremia avatar Jul 17 '18 06:07 ViorelEremia

my theme setting file is like this, $options = array( 'header_logo' => array( 'type' => 'upload', 'attr' => array('class' => 'custom-class', 'data-foo' => 'bar'), 'label' => __('Header Logo', '{domain}'), 'desc' => __('Add header logo image', '{domain}'), 'images_only' => true, ), 'footer_logo' => array( 'type' => 'upload', 'attr' => array('class' => 'custom-class', 'data-foo' => 'bar'), 'label' => __('Footer Logo', '{domain}'), 'desc' => __('Add footer logo image', '{domain}'), 'images_only' => true, ), 'copyright_text' => array( 'label' => __('Copyright Text', '{domain}'), 'type' => 'text', 'value' => '© '. date('Y') .' HammerTech Inc.
All Rights Reserved', ), ); how do i configure above xml file for this. thanks in advance,

chamara2 avatar Aug 30 '18 04:08 chamara2