I want to inform you that the translation of your Author Box with WPML is not working properly. I contacted WPML and they fixed the problem. The WPML team and I tried a lot of things before until we noticed that it has to be the theme. However, I want to let you know what code they had to put into the Theme in order to make this work.
Here is the instructions they gave me:
In \wp-content\themes\thegem\inc\content.php change line 619, change:
Then the translation via String Translation works (after input translation and clearing cache). I would very appreciate if you can implement this in the next Theme Update. You call the theme translation-ready and made me use WPML because "WPML is the only supported translation plugin". Then, please fix this issue.
If you want to use something else you need to create your own author box function and use it in templates.
This method "wpml_translate_single_string" is not good because it will not work with other translation plugins. But if you use the_author_meta and get_the_author_meta functions then you can use next hooks "get_the_author_{$field}" and "the_author_{$field}".
Thanks for the thorough response. I just wanted to inform you that the translation of the author box (the one I can enable via Theme Options) is not working at the moment and that the WPML team helped me to fix this. Basically, I was just the informant. If you can make it work with the next theme update, it would be highly appreciated :) The code WPML implemented will be overwritten with the next update anyways.
I want to inform you that the translation of your Author Box with WPML is not working properly. I contacted WPML and they fixed the problem. The WPML team and I tried a lot of things before until we noticed that it has to be the theme. However, I want to let you know what code they had to put into the Theme in order to make this work.
Here is the instructions they gave me:
In \wp-content\themes\thegem\inc\content.php change line 619, change:
<div class="name title-h5"><?php echo $user_data->data->display_name; ?> <span class="light"><?php esc_html_e('/ About Author', 'thegem'); ?></span></div>
TO
<div class="name title-h5"><?php echo apply_filters( 'wpml_translate_single_string', $user_data->data->display_name, 'Authors', 'display_name_'.$user_id ); ?> <span class="light"><?php esc_html_e('/ About Author', 'thegem'); ?></span></div>
And in the same file line 621:
<div class="post-author-description"><?php echo $user_data->description; ?>
change it to:
<div class="post-author-description"><?php echo apply_filters( 'wpml_translate_single_string', $user_data->description, 'Authors', 'description_'.$user_id ); ?></div>
Then the translation via String Translation works (after input translation and clearing cache). I would very appreciate if you can implement this in the next Theme Update. You call the theme translation-ready and made me use WPML because "WPML is the only supported translation plugin". Then, please fix this issue.
We checked wordpress documentation.
Correct use of the author's fields is this https://codex.wordpress.org/Function_Reference/the_author_meta or this - https://developer.wordpress.org/reference/functions/get_the_author_meta/.
Thereby we can change our code like this (and we did it for next theme update):
If you want to use something else you need to create your own author box function and use it in templates.
This method "wpml_translate_single_string" is not good because it will not work with other translation plugins. But if you use the_author_meta and get_the_author_meta functions then you can use next hooks "get_the_author_{$field}" and "the_author_{$field}".
Thanks for the thorough response. I just wanted to inform you that the translation of the author box (the one I can enable via Theme Options) is not working at the moment and that the WPML team helped me to fix this. Basically, I was just the informant. If you can make it work with the next theme update, it would be highly appreciated :) The code WPML implemented will be overwritten with the next update anyways.