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

Use native language names #250

Merged
merged 2 commits into from
Aug 4, 2021
Merged

Use native language names #250

merged 2 commits into from
Aug 4, 2021

Conversation

sikmir
Copy link
Contributor

@sikmir sikmir commented Jun 8, 2021

No description provided.

@Krakonos
Copy link
Member

Not entirely opposed, but I'd like to keep some languages denoted as not properly translated (some of them are really not). I couldn't find a way to automate that part. Any ideas?

@sikmir
Copy link
Contributor Author

sikmir commented Jun 15, 2021

Not entirely opposed, but I'd like to keep some languages denoted as not properly translated (some of them are really not). I couldn't find a way to automate that part. Any ideas?

What about:

  ...
  auto code = filename.mid(baseName.length(), filename.length() - baseName.length() - 3);
  std::vector<std::string> less50Complete { "de_AT", "et", "fi", "pt", "sk", "vi", "zh_CN" };
  if (std::find(less50Complete.begin(), less50Complete.end(), code) != less50Complete.end()) {
    aBox->addItem(QString{QLatin1String("[less than 50% complete] ") + QLocale(code).nativeLanguageName()}, code);
  } else {
    aBox->addItem(QLocale(code).nativeLanguageName(), code);
  }
  ...

less50Complete list could be moved to CMake variable.

@Krakonos
Copy link
Member

Sounds good. I think having two variables in cmake TRANSLATIONS_FULL and _PARTIAL would make sense, one language being in one of these only and file names generated from the codes. In this way, each language file is represented only once. I think removing the language lookup (directory traversal) could be removed from c++ and done only in CMake (either by a glob, or by specifying all the codes by hand).

@sikmir
Copy link
Contributor Author

sikmir commented Jun 17, 2021

I'd like to keep some languages denoted as not properly translated (some of them are really not).

I'm just wondering what's the reason to keep almost not translated languages in release distribution?

  • de_AT - 0%
  • et - 9%
  • fi - 36%
  • pt - 34%
  • sk - 38%
  • vi - 36%
  • zh_CN - 0%

It could be somehow useful for translator, but not for normal user. Production ready threshold could be at least 80%. What about excluding such incomplete translations from installation package? Translator can just put .qm file to translations path recognized by merkaartor to test interested translation.

@Krakonos
Copy link
Member

No specific reason. You're right that they probably don't need to be distributed. Looking into the tx tool, there appears to be a way to only download some translations. So perhaps changing the workflow could be done in this way:

rm translations/merkaartor_*.ts
tx pull --minimum-perc=X
git status # and commit changes; some of the files may be dropped from repo at this point, due to the rm - if they dropped under the threshold

and modify the CMake to just glob translations_*.ts, omitting <50% code entirely, keeping the detection as you originally proposed it.

@sikmir
Copy link
Contributor Author

sikmir commented Jun 27, 2021

Looking into the tx tool, there appears to be a way to only download some translations.

I've added minimum_perc = 50 to .tx/config.

@Krakonos
Copy link
Member

Finally got around to review, I only have one question: is it necessary to have all the languages listed in .tx/config? I'm not honestly sure why they would be there, as my tx client never inserted them there nor did I.

@sikmir
Copy link
Contributor Author

sikmir commented Aug 4, 2021

I only have one question: is it necessary to have all the languages listed in .tx/config?

I've removed them and it seems to work.

@Krakonos Krakonos merged commit 8ea6af5 into openstreetmap:master Aug 4, 2021
@Krakonos
Copy link
Member

Krakonos commented Aug 4, 2021

Merged, thanks for the contribution!

@sikmir sikmir deleted the native-lang-names branch August 4, 2021 20:15
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