Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Translate the problem types in a dropdown #1948

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

int-y1
Copy link
Contributor

@int-y1 int-y1 commented May 29, 2022

Go to /problems/. ru contains a translation for String Algorithms, so the dropdown looks like:

Capture

@codecov-commenter
Copy link

Codecov Report

Merging #1948 (3dd5d88) into master (966b37d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1948   +/-   ##
=======================================
  Coverage   46.46%   46.46%           
=======================================
  Files         236      236           
  Lines       13114    13114           
=======================================
  Hits         6093     6093           
  Misses       7021     7021           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 966b37d...3dd5d88. Read the comment docs.

@@ -52,7 +52,7 @@ <h3>{{ _('Problem search') }} <i class="fa fa-search"></i>
<select id="types" name="type" multiple>
{% for type in problem_types %}
<option value="{{ type.id }}"{% if type.id in selected_types %} selected{% endif %}>
{{ type.full_name }}
{{ user_trans(type.full_name) }}
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to add a similar change for problem categories?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Problem categories are out of scope. In particular, they require these steps:

  • Modify makedmojmessages to get all problem categories. Example:
    for name in ProblemType.objects.values_list('full_name', flat=True):
    if self.verbosity > 2:
    self.stdout.write('processing problem type name "%s"\n' % name)
    self._emit_message(potfile, name)
  • Wait for Crowdin translators to translate those strings, and an admin to get those translations.
  • Use user_trans in the appropriate templates.

Copy link
Member

Choose a reason for hiding this comment

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

I see, this is out of scope.

Copy link
Member

@Xyene Xyene left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Xyene Xyene merged commit 041487e into DMOJ:master Jul 18, 2022
@int-y1 int-y1 deleted the i18n-problem-type branch July 25, 2022 06:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants