Hey all,
I want to translate my theme. But I’m not getting it to work and as far as I see there is not yet documentation of sage 10, so I’m asking for some pointers. When I run get_locale()
I get the same result as the translated files.
Question:
How do I localize my theme?
Current approach
- run
yarn translate
- this installs a pot file in
/resources/lang/sage.pot
- I create a new language translation with
poedit
for my desired language and translate the strings. - I don’t know if I should anything extra in
poedit
- I add
load_theme_textdomain()
to/app/setup.php
(example below)
add_action('after_setup_theme', function () {
load_theme_textdomain('my-domain', get_stylesheet_directory() . '/lang');
});
current result
I don’t see any of the translated strings in the rendered page
What would be the right approach?