Hey together,
there are some strings who are translated in Weblate on translate.peeringdb.com, but still don't appear as translated on beta.peeringdb.com. The strings are as follows:
Can someone check what the reason could be for that?
Thank you! :)
@peeringdb/oc could you please check. My understanding is that translated text automatically makes it to beta.
I've found the problem and am working on a solution.
Fixed!
Please re-open if not. :-)
Hey @ccaputo ,
after waiting some time there are still translations who doesn't appear. :(
This is fixed:
All other strings doesn't appear.
Does that make sense?
I've found the problem and am working on a solution.
Could you please have a look again, @ccaputo
At this point, I believe any strings you are not seeing be translated are due to the same problem as what is causing https://github.com/peeringdb/peeringdb/issues/714.
For example, while "Organization" is being correctly translated in some places, in others it is missing a {% trans " and " %} wrapper, ala https://github.com/peeringdb/peeringdb/blob/69de96dbe9427863a9ece2f9125a9197396f5795/peeringdb_server/templates/site/view_network_side.html#L190
and so it doesn't get translated. Just submitted pull request https://github.com/peeringdb/peeringdb/pull/728 for that.
Searching these down in the web site is pretty challenging and more so finding the bug in the code base, although it will often be in https://github.com/peeringdb/peeringdb/tree/master/peeringdb_server/templates/site
At a minimum, please post example URL to strings you are finding not be translated. Even better would be to find the problem in the source code and submit pull requests. As a sample, I just did two: https://github.com/peeringdb/peeringdb/pull/728 & https://github.com/peeringdb/peeringdb/pull/729
This way hopefully the fixes will make into the next beta drop.
HTML strings to be translated get a {% trans " and " %} wrapper while Python strings to be translated get a _(" and ") wrapper.
At a minimum, please post example URL to strings you are finding not be translated. Even better would be to find the problem in the source code and submit pull requests. As a sample, I just did two: #728 & #729
Okay, will post an example URL the next time. :)
For all strings where I could find the bug in the code, I just created the pull request #731
This way hopefully the fixes will make into the next beta drop.
HTML strings to be translated get a
{% trans "and" %}wrapper while Python strings to be translated get a_("and")wrapper.
Thank you for the explanation!
For the following strings I wasn't able to find the bug in the code, maybe you guys have an idea where the problem could be.
To check it on the website, the best would be to change the language to Korean, because then it's obvious and more easy to recognize non translated strings. :)
Is this kind of explanation better?
@ccaputo is this issue resolved?
@ccaputo is this issue resolved?
IMHO, not until the PRs are completed and integrated.
For the following strings I wasn't able to find the bug in the code, maybe you guys have an idea where the problem could be.
- kosovo
_Explanation: Country list in the Exchange Advanced Search (https://beta.peeringdb.com/advanced_search)._
https://github.com/peeringdb/peeringdb/blob/7ee0fa73f9d175e79561059959196ccc4f305e43/mainsite/settings/__init__.py#L512 looks correct for django-countries and the translation is available to be used by it. I don't know why django-countries is not using it. @grizz?
- Abuse (But appears at the drop down menu)
- Sales (But appears at the drop down menu)
- Technical (But appears at the drop down menu)
- Policy (But appears at the drop down menu)
_Explanation: All the strings appear if you edit the Contact Information for an Network. In the final list it's not translated. If you use the drop down menu in the edit mode, you see it translated._
These are all in https://github.com/peeringdb/django-peeringdb/blob/master/django_peeringdb/const.py and the strings have been translated. @grizz why in https://github.com/peeringdb/peeringdb/blob/master/peeringdb_server/templates/site/view_network_bottom.html when poc_roles are listed for editing are they translated, but when presented for viewing are they not? That seems to be the issue.
- Open
- Selective
- Restrictive
_Explanation: These strings appear on an IX Site in the "Peers at this Exchange Point" list in the Policy Row._
The answer to the above would likely match for these.
For the following strings I wasn't able to find the bug in the code, maybe you guys have an idea where the problem could be.
- kosovo
_Explanation: Country list in the Exchange Advanced Search (https://beta.peeringdb.com/advanced_search)._looks correct for django-countries and the translation is available to be used by it. I don't know why django-countries is not using it. @grizz?
I don't either, might be a loading order issue.
These are all in https://github.com/peeringdb/django-peeringdb/blob/master/django_peeringdb/const.py and the strings have been translated. @grizz why in https://github.com/peeringdb/peeringdb/blob/master/peeringdb_server/templates/site/view_network_bottom.html when poc_roles are listed for editing are they translated, but when presented for viewing are they not? That seems to be the issue.
Looks like a bug to me, although I don't immediately see it. Maybe https://github.com/peeringdb/peeringdb/blob/7ee0fa73f9d175e79561059959196ccc4f305e43/peeringdb_server/templates/site/view_network_bottom.html#L74 ?
For the following strings I wasn't able to find the bug in the code, maybe you guys have an idea where the problem could be.
- kosovo
_Explanation: Country list in the Exchange Advanced Search (https://beta.peeringdb.com/advanced_search)._looks correct for django-countries and the translation is available to be used by it. I don't know why django-countries is not using it. @grizz?
I don't either, might be a loading order issue.
How to fix? :-)
These are all in https://github.com/peeringdb/django-peeringdb/blob/master/django_peeringdb/const.py and the strings have been translated. @grizz why in https://github.com/peeringdb/peeringdb/blob/master/peeringdb_server/templates/site/view_network_bottom.html when poc_roles are listed for editing are they translated, but when presented for viewing are they not? That seems to be the issue.
Looks like a bug to me, although I don't immediately see it. Maybe
?
From https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#internationalization-in-template-code I wonder if what is needed is {% trans p.role %} instead of {{ p.role }}. @vegu ?
Added missing strings to #752
Most helpful comment
At this point, I believe any strings you are not seeing be translated are due to the same problem as what is causing https://github.com/peeringdb/peeringdb/issues/714.
For example, while "Organization" is being correctly translated in some places, in others it is missing a
{% trans "and" %}wrapper, ala https://github.com/peeringdb/peeringdb/blob/69de96dbe9427863a9ece2f9125a9197396f5795/peeringdb_server/templates/site/view_network_side.html#L190and so it doesn't get translated. Just submitted pull request https://github.com/peeringdb/peeringdb/pull/728 for that.
Searching these down in the web site is pretty challenging and more so finding the bug in the code base, although it will often be in https://github.com/peeringdb/peeringdb/tree/master/peeringdb_server/templates/site
At a minimum, please post example URL to strings you are finding not be translated. Even better would be to find the problem in the source code and submit pull requests. As a sample, I just did two: https://github.com/peeringdb/peeringdb/pull/728 & https://github.com/peeringdb/peeringdb/pull/729
This way hopefully the fixes will make into the next beta drop.
HTML strings to be translated get a
{% trans "and" %}wrapper while Python strings to be translated get a_("and")wrapper.