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

Add translation for redlining draw layer #329

Closed
wants to merge 3 commits into from

Conversation

cazitouni
Copy link
Contributor

Hello @manisandro,

I would like to submit this PR because I received feedback from many users who don't understand why the default redlining layer is named like this, even in other languages. It can be confusing for people who don't understand basic English.

So, this PR aims to use the translation tools to name the layer according to the user's browser language. I hope the code is correct, but please let me know if it isn't.

Thanks in advance,
Regards, Clément.

@@ -22,6 +22,7 @@
import FeatureStyles from '../../utils/FeatureStyles';
import MapUtils from '../../utils/MapUtils';
import MeasureUtils from '../../utils/MeasureUtils';
import LocaleUtils from '../../utils/LocaleUtils';

Check failure

Code scanning / ESLint

enforce sorted imports Error

Expected "../../utils/LocaleUtils" to come before "../../utils/MeasureUtils"
@@ -574,7 +575,7 @@ class RedliningSupport extends React.Component {
feature.crs = this.props.mapCrs;
const layer = {
id: this.props.redlining.layer,
title: this.props.redlining.layerTitle,
title: LocaleUtils.tr(this.props.redlining.layerTitle),
Copy link
Member

Choose a reason for hiding this comment

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

This line here is incorrect, layerTitle is already translated (see line 81 in Redlining.jsx).

Copy link
Contributor Author

@cazitouni cazitouni Jul 12, 2024

Choose a reason for hiding this comment

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

I belived too, but if I do not use it here it goes back to it's untranslated state as soon as you add a point or anything in the layer.

@manisandro
Copy link
Member

Should be done in 1c59153 and 52d942f

@manisandro manisandro closed this Jul 26, 2024
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