I’ve updated several sites with Vantage theme to WordPress 6.7 this morning and have lost translations on all of them.
Rerouting back to WP 6.6.2 resolves the problem.
I’ve narrowed it down to the language selection in function.php, which uses an old line code no longer supported in WP 6.7:
load_theme_textdomain( ‘YOURTEXTDOMAIN’, get_template_directory() . ‘/languages’ );
Change to:
load_textdomain( ‘YOURTEXTDOMAIN’, get_template_directory() . ‘/languages/’ . determine_locale() . ‘.mo’ );
Hi Morten,
Thanks for getting in touch. Where are you storing your modified language files? If it’s in the wp-content/themes/vantage directory you’ll lose any changes made after a theme update as that’s not an update-safe area.
6.7 expects custom translations to be at wp-content/languages/themes/. You can add them to alternative places using load_theme_textdomain or load_textdomain (both are fine) and a child theme, or with a translation plugin like Loco Translate to make loading custom translation files easier.
That code is present for backward compatibility and isn’t used in 6.7 – at least in the context of the parent theme. It won’t produce an error, or result in the loss of translation files. load_textdomain is not required for theme translations to be loaded.
Kind regards,
Alex