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

Russian translate #157

Closed
Alexei055 opened this issue Feb 1, 2021 · 6 comments · Fixed by #170
Closed

Russian translate #157

Alexei055 opened this issue Feb 1, 2021 · 6 comments · Fixed by #170
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Alexei055
Copy link

Alexei055 commented Feb 1, 2021

Environment

  • Python version: 3.8.2
  • django-comments-dab version: 2.5.1

Proposed Functionality

I am translating your module into Russian, and I cannot correctly organize the substitution of plural endings to words, since there are 3 forms of endings for plurals in Russian, it is not difficult to write this into a formula, but I do not understand where to write the endings themselves, except for changing the library's source code, to be exact the line below:

{% blocktrans with plural_str=reply_count|pluralize:"y,ies" %} Repl{{ plural_str }} {% endblocktrans %}

Use Case

Database Changes

No

@abhiabhi94
Copy link
Collaborator

Thanks for the feedback. Could you just test whether changing the line that you mentioned to the code below solve your issue:

{% blocktranslate count reply_count %}Reply{% plural %}Replies{% endblocktranslate %}

I have tried to use this on my machine for the language Hindi. This seems to work on my end.

@Alexei055
Copy link
Author

It's not working

@abhiabhi94
Copy link
Collaborator

Did you run the python manage.py makemessages -l ru command again? The changes will only be reflected in the .po files only after this command is run.

@Radi85 Radi85 added bug Something isn't working and removed feature labels Feb 3, 2021
@Radi85
Copy link
Owner

Radi85 commented Feb 3, 2021

This line should be updated as @abhiabhi94 mentioned:

{% blocktrans count reply_count=reply_count %}{{ reply_count }} Reply{% plural %}{{ reply_count }} Replies{% endblocktrans %}

I also see that the timesince is not translated, this needs to be fixed as well.

Screenshot 2021-02-03 at 14 02 20

@Alexei055 Alexei055 reopened this Feb 3, 2021
@abhiabhi94
Copy link
Collaborator

This line should be updated as @abhiabhi94 mentioned:
{% blocktrans count reply_count=reply_count %}{{ reply_count }} Reply{% plural %}{{ reply_count }} Replies{% endblocktrans %}

The reply_count value is already displayed above:

{% get_replies_count comment user as reply_count %}
| <span class="js-reply-number {% block reply_count_cls %}text-dark{% endblock reply_count_cls %}">{{ reply_count }}</span>
<a class="js-reply-link {% block reply_link_cls %}btn btn-link ml-1{% endblock reply_link_cls %}" href="#">
{% blocktrans with plural_str=reply_count|pluralize:"y,ies" %} Repl{{ plural_str }} {% endblocktrans %}
</a>

If we use the code recommended by you, it will not allow for potential customization of the HTML class to the reply_count value.

@Radi85
Copy link
Owner

Radi85 commented Feb 6, 2021

If we use the code recommended by you, it will not allow for potential customization of the HTML class to the reply_count value.

In fact I suggested what worked for me. Your suggestion didn't work, I think the reply_count should be passed as an optional arg reply_count=reply_count not positional arg.
However, I don't mind using your suggestion as long as the bug will be fixed.

@Radi85 Radi85 added this to the 2.6.0 milestone Feb 13, 2021
@Radi85 Radi85 self-assigned this Feb 27, 2021
Radi85 added a commit that referenced this issue Feb 27, 2021
Radi85 added a commit that referenced this issue Feb 27, 2021
Radi85 added a commit that referenced this issue Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants