I have an Angular 12 app with two languages (spanish and english). In index page I have a login screen with Toolbar-menu with language selecction.
I have used i18n as way to internazionalice the app. When I build the angular app the menu to switch between languages works fine. The results language-app are 'dist/es' and 'dist/en'
The component.html code:
<mat-menu #idiomas="matMenu">
<a mat-menu-item i18n href="/es">Español</a>
<a mat-menu-item i18n href="/en">Inglés</a>
</mat-menu>
The main.js to inizialice Electron:
const { app, BrowserWindow } = require('electron')
const url = require("url");
const path = require("path");
function createWindow () {
//Obtenemos el idioma del usuario//get user locale
const language = app.getLocale();
const win = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
})
win.loadFile(__dirname+'/dist/'+language+'/index.html')
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
Electron loads fine getting de user locale with: __dirname+'/dist/'+language+'/index.html'
When I click at language angular menu the screen becomes blanck, and I don't see anything in console
Thanks for the help!