Skip to content

Add language fallback tests and enhance language setting logic #1582

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mscno
Copy link
Contributor

@mscno mscno commented Apr 29, 2025

  • Introduced new Cypress tests to verify language fallback behavior for 2-letter and 3-letter language codes.
  • Enhanced the setLang method in L.PM.Map to improve language normalization and fallback handling.
  • Added logging functionality in Cypress plugins for better debugging.

- Introduced new Cypress tests to verify language fallback behavior for 2-letter and 3-letter language codes.
- Enhanced the `setLang` method in `L.PM.Map` to improve language normalization and fallback handling.
- Added logging functionality in Cypress plugins for better debugging.
Co-authored-by: Florian Bischof <design.falke@gmail.com>
Copy link
Collaborator

@Falke-Design Falke-Design left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom translations are not working anymore:

const customTranslation = {
  tooltips: {
    placeMarker: "Custom Marker Translation",
  },
};

map.pm.setLang("customName", customTranslation, "en"); // -> should change to lang "customName" and add custom language with fallback to "en"

console.log(L.PM.activeLang) // should print "customName"

It should be also possible to add own translations for jam -> replacing customName with jam in the example above

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

Successfully merging this pull request may close these issues.

2 participants