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

setLang does not work quite righ #1388

Open
Spokt1 opened this issue Aug 9, 2023 · 3 comments
Open

setLang does not work quite righ #1388

Spokt1 opened this issue Aug 9, 2023 · 3 comments

Comments

@Spokt1
Copy link

Spokt1 commented Aug 9, 2023

Hello, I have a big project with maps, pm is registered globally and because of this, setLang does not work quite right, I mean that in fact the merge of the object happens, and not clone , if I use fallback lang , then return to the original i I can't. Only after reloading the page.

@Falke-Design
Copy link
Collaborator

Without your code we can't help you much. Please create a demo: https://jsfiddle.net/o1dwu2vg/

Are you doing following?

// from default en to de
map.pm.setLang('de'); 

and later:

// from de to en
map.pm.setLang('en'); 

@Spokt1
Copy link
Author

Spokt1 commented Aug 9, 2023

map.pm.setLang('custom', { buttonTitles: { drawMarkerButton: 'Поиск в точке', drawLineButton: 'Поиск по кривой', drawRectButton: 'Поиск в прямоугольнике', drawPolyButton: 'Поиск в полигоне' } }, 'en')

and later:

map.pm.setLang('end')

don't work.The custom translation will remain

example

@georgs-tumans
Copy link

georgs-tumans commented Aug 15, 2023

I second this. I have my own custom language and switching to it works just fine:
map.value.pm.setLang('lv', geomanTranslation, 'en');

However, afterwards the switch back to English does not work:
map.value.pm.setLang('en');
Custom language remains as the current translation.

Instead of switching back to English, I tried some other languages like de and ru - both actually worked just fine. Seems that there is a particular problem with switching back to English.

For now I had to add English as another custom translation as use it as one.

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

No branches or pull requests

3 participants