Answer the question
In order to leave comments, you need to log in
How to translate Carbon fields using WP multilang?
How to translate Carbon fields using WP multilang. This plugin supports ACF, how can I make Carbon support?
Answer the question
In order to leave comments, you need to log in
First option:
function carbon_lang_prefix() {
$current = wpm_get_language();
$prefix = '';
if ( ! $current ) {
return $prefix;
}
if ( $current == 'ru') {
return $prefix;
}
$prefix = '_' . $current;
return $prefix;
}
function crb_get_i18n_suffix() {
$suffix = '';
if ( ! defined( 'ICL_LANGUAGE_CODE' ) ) {
return $suffix;
}
$suffix = '_' . ICL_LANGUAGE_CODE;
return $suffix;
}
function crb_get_i18n_theme_option( $option_name ) {
$suffix = crb_get_i18n_suffix();
return carbon_get_theme_option( $option_name . $suffix );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question