-
Notifications
You must be signed in to change notification settings - Fork 14
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
Language switching fixed #134
base: main
Are you sure you want to change the base?
Conversation
Just a side note, in the map editor is using decodeTextFieldProperty from the style-expressions repo. Basically we decode an expression, analyze from AST what it contains and with updater we replace value where we need to. |
Thanks @slaviczavik , i'd like to have a look but i don't have access to this repo. Do you think you can let me in? |
src/tools.ts
Outdated
* Tst if a string matches the pattern "{name:xx}" in a exact way or is a loose way (such as "foo {name:xx}") | ||
*/ | ||
export function checkNamePattern(str: string): { contains: boolean; exactMatch: boolean } { | ||
const regex = /\{name:[a-zA-Z]{2}\}/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are languages with code not matching this regex: name:zh-Hans
, name:latin
, ... (https://github.com/maptiler/maptiler-client-js/blob/main/src/language.ts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh true! I'll fix that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in the last commit
RD-438
The language switching is now working better and is more robust when there is advance styling or ramping