0

I built contact form plugin in in wordpress. I am planing to translate field name to diffrent languages. In that cause i will use Poedit. My question is does wordpress has some language options in database, wich could be used. For example when wp is installed you could choose diffrent lang options? So my question how i will trigger translation for my plugin? I read something about constant in wp-config, is there any way to trigger change of language without this constant, cuz i am having separate plugin

  • 1
    That's out of logic, because I'm using a whole site in lang=xyz, and I'm comfortable there, but I want a specific one in lang=abc because it's my wish. Isn't that clumsy? – Mayeenul Islam Nov 18 '14 at 9:38
0

You get the current language of the install with the function get_locale(). WordPress save the language in theoptions table, option_name is WPLANG. But inside the Multisite install is in the table sitemeta.

But is not important. You should use the default functions to load a language file inside the theme template or the plugin.

  • Theme: load_theme_textdomain()
  • Plugin: load_plugin_textdomain()

You find a small example inside this contact form template, public.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.