added language routing system

This commit is contained in:
sdarbinyan
2026-02-26 22:23:08 +04:00
parent a4765ffe98
commit e4206d8abc
34 changed files with 197 additions and 98 deletions

View File

@@ -45,7 +45,8 @@ export class App implements OnInit {
.subscribe((event) => {
const navEnd = event as NavigationEnd;
const url = navEnd.urlAfterRedirects || navEnd.url;
this.isHomePage.set(url === '/' || url === '/home' || url === '');
// Home pages: /ru, /en, /hy (with or without trailing slash)
this.isHomePage.set(/^\/[a-z]{2}\/?$/.test(url) || url === '/' || url === '');
});
}