@chouby Also, please remember that WPML now allows only single key name to register all theme mods. It means no need to add theme mods one by one.
<admin-texts>
<key name="theme_mods_themename">
</key>
</admin-texts>
In your code, you should also check if there is no sub key, if the it is a “theme_mods_***” then add all theme mods available.
Something like this;
protected function translate_strings_recursive( $values, $key ) {
$children = $key->children();
if ( count( $children ) ) {
foreach ( $children as $child ) {
$attributes = $child->attributes();
$name = (string) $attributes['name'];
if ( isset( $values[ $name ] ) ) {
$values[ $name ] = $this->translate_strings_recursive( $values[ $name ], $child );
}
}
} else {
//$values = pll__( $values );
if(is_array($values)){
$mods = get_theme_mods("themename");
foreach{
//regiter
}
}
}
return $values;
}