Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the left-side menu default language? #6021

Open
1 of 3 tasks
beeeecky223 opened this issue May 2, 2024 · 2 comments
Open
1 of 3 tasks

How to change the left-side menu default language? #6021

beeeecky223 opened this issue May 2, 2024 · 2 comments

Comments

@beeeecky223
Copy link

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request
  • question about the decisions made in the repository

Issue description

Current behavior:
Hi I'm using ngx-admin for my company webpage, the original default language was English but I've changed to Japanese.
And we provide 2 available languages: English & Japanese only.
However everytime when I access to the webpage: only the main page (right-side) shows Japanese, the left-side menu keeps showing English and I need to choose "Japanese" from the language pulldown-box so that left-side menu will change to Japanese accordingly.

Expected behavior:
I hope the left-side menu will also show Japanese which is our default language, and we don't need to do anything to the language pulldown-box every time.

Steps to reproduce:

I've changed the content of "main.5ea245ffa0935998.js" but I think futher changes are needed.
Could anyone give advice on how to make the changes?

Related code:

main.5ea245ffa0935998.js
default language of left-side menu

var Fe = f(64205),
	ft = f(42466);
let Ze = (() => {
	class p {
	 constructor(o, h, M) {
		this.analytics = o, this.seoService = h, this.translate = M, M.addLangs(
			["Japanese","English"]), M.setDefaultLang("Japanese");
			const x = M.getBrowserLang();
			M.use(x.match(/English|Japanese/) ? x : "Japanese")
		}
		ngOnInit() {
		this.analytics.trackPageViews(), this.seoService.trackCanonicalChanges()
			}
		}
		return p.\u0275fac = function(o) {
		return new(o || p)(_.Y36(z), _.Y36(rt), _.Y36(ft.sK))
		}, p.\u0275cmp = _.Xpm({
		type: p,
		selectors: [
		["ngx-app"]
		],
		decls: 1,
		vars: 0,
		template: function(o, h) {
		1 & o && _._UZ(0, "router-outlet")
		},
		directives: [w.lC],
		encapsulation: 2
	}), p
})();

Other information:

It is appreciated that anyone could share how and where (or which file) to change the default language of the left-side menu.

@beeeecky223
Copy link
Author

Hello would appreciate if anyone can help..!!!

@karpovv-boris
Copy link

main.5ea245ffa0935998.js is a bundle. Don't try to analyze this file for this question.

Answering to your question, you could use any translation library, which will load needed translation by select change.
On current project, we're using transloco. Here small preview with menu translation.
image

And here is how lang change is happening. We're using windows.location.reload cause not all theme components change their content according to language change.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants