You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Load the translation catalog in main, and translate the menu and dialog titles #623
Several modules build their sentences in main and send them to the renderer, and some of those modules run in both processes (pr-checkout.cjs, legacy-site.cjs, merge-in-progress.cjs, wporg-handle.cjs, patch-provenance.cjs, project-type.cjs). Without a catalog in main, wrapping them gives a translated screen showing English sentences from main. Keep the code mappings that exist (prCheckoutRefusal, ticket-trunk-notice.cjs); don't turn the rest into codes.
What to do
Move the body of the i18n:locale handler in src/main.js into one memoised localeReply(). The handler returns it, and whenReady awaits it and applies it in main.
Apply it with applyLocale() from src/renderer/locale-setup.cjs, passing setLocaleData from @wordpress/i18n and addFilter from @wordpress/hooks. It has no DOM dependency, and the en-XA filters then cover main's strings too.
That call must run before Menu.setApplicationMenu and createWindow().
Wrap the two labels in src/menu.js ("Open App Log", "Show Logs Folder"). Leave Electron's role menus alone. Translating those means writing every submenu by hand; that's a separate issue if anyone wants it.
Wrap the native dialog titles and filter names in main.js: the save-patch dialog (about line 1036), "Choose a patch file" (about 2390) and "Choose the application to open this folder in" (about 3299).
About 10 strings.
Tests
tests/unit/menu.test.cjs: labels with a pseudo filter.
tests/unit/ipc-wiring.test.cjs: the handler and main apply the same reply, resolved once.
Journey: launch with lang: 'en-XA'. Read the Help menu labels with app.evaluate(({ Menu }) => …). Replace dialog.showOpenDialog the way answerFileDialog does and check the title it was given.
Activity
Load translations for the OS language, not only the languages Chromiu…
Load the translation catalog in main, and translate the menu and dial…
Load the translation catalog in main, and translate the menu and dial…