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

Default to display field when first setting labels enabled on a layer #30245

Merged
merged 7 commits into from
Jun 19, 2019

Conversation

nyalldawson
Copy link
Collaborator

Helps with new users -- they see an immediate effect after setting labels enabled on a layer

@nyalldawson nyalldawson added Labeling Related to QGIS map labeling GUI/UX Related to QGIS application GUI or User Experience labels Jun 17, 2019
@nyalldawson nyalldawson added this to the 3.8.0 milestone Jun 17, 2019
src/core/qgsvectorlayer.cpp Outdated Show resolved Hide resolved
@m-kuhn
Copy link
Member

m-kuhn commented Jun 17, 2019

Good one!

@nirvn
Copy link
Contributor

nirvn commented Jun 17, 2019

Would it be overthinking it to add a few translated strings in there? French, German, etc.?

@Gustry
Copy link
Contributor

Gustry commented Jun 17, 2019

Why not using a tag list like in processing algorithms? So the list is translated and it's easy to add more in transifex.

@nyalldawson
Copy link
Collaborator Author

OK, translated list it is! (although I wonder how a translator would ever interpret the string "name,desc,street,road,id" correctly, without any additional context...)

@m-kuhn
Copy link
Member

m-kuhn commented Jun 18, 2019

-1 as it currently is.

  • Some people I know use QGIS in German, some in English. They deal with the same datasets.
  • Very often data schemas are done in English and then populated with localized data.
  • Many datasets found in the net are in English.
  • Sometimes I receive French datasets too.

I'm not sure how to deal with the last one (configurable list?) but I would hate to let the English list go in favour of only a translated one.

@DelazJ
Copy link
Contributor

DelazJ commented Jun 18, 2019

To translate tag list, I personally keep original words in English then complete with translated. That way, knowing an alg reference in English or French, I'm sure it'll be found in the toolbox.
I don't understand the context here but that trick may (?) work if you're afraid of losing English tags...

@Gustry
Copy link
Contributor

Gustry commented Jun 18, 2019

Yes, I was going to add what @DelazJ said. It's what we do for French in Transifex. It's not done by all translators unfortunately I think. Something to add the translation guidelines?

It would be nice to get the untranslated string automatically and to merge translated and untranslated in the application but it seems not possible: https://stackoverflow.com/questions/31613339/qt-convert-translated-text-to-english

@m-kuhn I agree with your points except:

Very often data schemas are done in English and then populated with localized data.

Because you are from Switzerland and you are internationals and multi-linguist there ;-) I worked one year in one small French administration, 99% of fields names and data schemas were in French ;-)

@nirvn
Copy link
Contributor

nirvn commented Jun 18, 2019

Sorry, what I meant to imply is adding translated names, not translatable strings :)

Ie, name,nom,heibt, etc. :)

@DelazJ
Copy link
Contributor

DelazJ commented Jun 18, 2019

How do you decide the languages to use?

@nirvn
Copy link
Contributor

nirvn commented Jun 18, 2019

I'd be arbitrary, take say the top 5 languages across the globe, derived from latin (the latter being an historical restriction pre unicode).

That or the top 5 language derived from our user base.

@m-kuhn
Copy link
Member

m-kuhn commented Jun 18, 2019

Let's not go the Excel way where data is interpreted based on the locale

@3nids
Copy link
Member

3nids commented Jun 18, 2019

wouldn't it make sense to actually use the user's language?
(not sure if you can keep the static variable)

@nirvn
Copy link
Contributor

nirvn commented Jun 18, 2019

That could make sense.

QStringLiteral( "name" ) << tr( "name" ) << ...

@nirvn
Copy link
Contributor

nirvn commented Jun 18, 2019

That said, I'd still go for a few hardcoded translations.

QStringLiteral( "name" ) << QStringLiteral( "nom" ) << ... << tr( "name" ) ...

That'd be the most flexible way forward.

@nyalldawson
Copy link
Collaborator Author

Ok, going for a hardcoded list of strings, including localized ones. Let's see if this works in practice and revisit if needed.

@nyalldawson nyalldawson merged commit 6eaaf92 into qgis:master Jun 19, 2019
@nyalldawson nyalldawson deleted the displ_expression branch June 19, 2019 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI/UX Related to QGIS application GUI or User Experience Labeling Related to QGIS map labeling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants