236 posts
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
GradaStudio says

Hi, i noticed a problem if we translate theme options strings using wpml-config.xml file and then when next time we load the options panel again translated strings are there in text fields not the original ones i entered, they are lost.

is there any way to do it correctly ?

236 posts
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
GradaStudio says

:( bump..

316 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
+2 more
SyamilMJ says

What does wpml-config.xml file do?

236 posts
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
GradaStudio says

wpml-config.xml file is used by wpml plugin for translation. it looks like this

<admin-texts> <key name=”smof-option-name”> <key name=”footer_text” /> <key name=”sub_option_2” /> </key> </admin-texts>

if you see this website www.empresasbambu.com, its using smof framework and wpml plugin for translation. so we have same website in English as well as Spanish.

plugin translates the strings in english to spanish using filters on get_option for frontend but when we use get_option in framework i think filters are applied to that as well, so we see spanish text in option fields instead of english, if we hit save now spanish text will be saved and english strings are lost.

hope i didn’t confused much.

thanks

236 posts
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
GradaStudio says

wpml-config.xml file is used by wpml plugin for translation. it looks like this

<admin-texts> <key name=”smof-option-name”> <key name=”footer_text” /> <key name=”sub_option_2” /> </key> </admin-texts>

if you see this website www.empresasbambu.com, its using smof framework and wpml plugin for translation. so we have same website in English as well as Spanish.

plugin translates the strings in english to spanish using filters on get_option for frontend but when we use get_option in framework i think filters are applied to that as well, so we see spanish text in option fields instead of english, if we hit save now spanish text will be saved and english strings are lost.

hope i didn’t confused much.

thanks

316 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
+2 more
SyamilMJ says

Not really sure how WPML work, but the workaround strategy should be creating two sets of options id, e.g.

mytheme_options (default id)

mytheme_options_es (spanish option id)

Presumably that if WPML have conditional function that can determine which option is being requested on front end, then you can do something like:

if($lang == 'en') {
define( 'OPTIONS', preg_replace("/[^A-Za-z0-9 ]/", '', $theme_name).'_options' );
} elseif ($lang == 'es') {
define( 'OPTIONS', preg_replace("/[^A-Za-z0-9 ]/", '', $theme_name).'_options_es' );
}

You said WPML uses a filter in get_option, what’s the filter’s name?

Also, next time open a thread here – https://github.com/sy4mil/Options-Framework/issues

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by