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

Missing translation tags in layer_list and layer_detail #6534

Closed
obersupermega opened this issue Oct 19, 2020 · 11 comments
Closed

Missing translation tags in layer_list and layer_detail #6534

obersupermega opened this issue Oct 19, 2020 · 11 comments
Labels
translations Issues about GeoNodes language support

Comments

@obersupermega
Copy link

Expected Behavior

In all languages, the name and description of the data categories should be displayed in the appropriate language.

Actual Behavior

(missing {% trans item.category__gn_description} in _resourcebase_snippet.html e.g.)

Steps to Reproduce the Problem

  1. Change language, e.g. to french
  2. Go to layer list or go to layers detail page

Bildschirmfoto von 2020-10-19 11-49-09
Bildschirmfoto von 2020-10-19 11-50-04

Specifications

  • GeoNode version: 3.x
  • Installation method: SPCGeoNode Docker
  • Platform: Ubuntu
  • Additional details:
@gannebamm
Copy link
Contributor

I think since those Topic Categories are now part of the datamodel itself instead of pre-modelled the translation strings will vary. See e.G. http(s)://your.geonode.url/de/admin/base/topiccategory/

There you have the topic description and name as part of the database model. I am not sure how those would get translated. @t-book and @afabiani ? What is your suggestion?

@obersupermega
Copy link
Author

That's right. But if the information is processed in _resourcebase_snippet.html you should still be able to translate the received variable as a string with "{% trans item.category__gn_description}" or a similar call.
On index.html/iso_categories.html it works:
Uploading pic1.png…

@obersupermega
Copy link
Author

screenshot

@gannebamm
Copy link
Contributor

I've just got two infos:
First: gannebamm@c7ea759#r43512134
The msgids are commented in some translation.po files, since they are no longer part of the html and therefore do not get create with the create_message django command (or get even commented out, like in the german one I've edited yesterday).
Second: The currently by fixtures inserted iso-category descriptions do sometimes differ from the msgids strings in the po files. Eg. the Oceans iso-cat must start with uppercase 'F' and end with a '.'. If these are changed in the django admin, the help text will get translated aswell. Ssee @obersupermega example above with france shortname but english description and mine:
Screenshot from 2020-10-23 12-07-00

@gannebamm
Copy link
Contributor

See my draft PR: #6565

@t-book t-book added the translations Issues about GeoNodes language support label Oct 23, 2020
@gannebamm
Copy link
Contributor

I tried to use {% trans ... } but it did not work as expected due to angular I think. Any hints are very much appreciated.
☝️ 26. Oktober 2020 10:07

gannebamm added a commit to gannebamm/geonode that referenced this issue Oct 26, 2020
@gannebamm
Copy link
Contributor

@afabiani @t-book The initial data json fixture is not matching with the .po file strings. There are two options:
a) change the po file msgid for all languages,
b) change the fixture

I have not enough experience to tell which of those options is better in terms of updateability and djangoness. See the fixture changes here:
gannebamm@2819ea6

I´ve tested that locally and it does work fine for a new instance.

@afabiani
Copy link
Member

afabiani commented Nov 9, 2020

@gannebamm the best option would be to change the fixture imho.

@gannebamm
Copy link
Contributor

See my PR: #6565
Most of the issue is solved there.

afabiani pushed a commit that referenced this issue Nov 10, 2020
…#6565)

* updated geo limit texts and cart [#6131]

* iso-categories translation msgid fix

* layer detail trans tags [FIXES #6534]

* adds layer list objects and layer detail iso category translations.

* Revert " - Add django-grappelli==2.14.2 admin interface"

This reverts commit c9f594c

* get Iso categories po texts back and updated german trans for geoapps. Defuzzied some strings

* added compiled .mo file

* - Revert "grappelli" removal

Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it>
(cherry picked from commit 437914c)
@obersupermega
Copy link
Author

Great job.But unfortunately, not all the passages are translated. Shall we reopen the issue?
unequal

@gannebamm
Copy link
Contributor

Just for documentation purposes:
@obersupermega see my thoughts about that here #6565 (comment)
In short: those are fetched from the (soon) old API and I would have to write a custom serializer for it - AFAIK. This is currently out of scope for me. Nevertheless the rest of the translations should get merged for 3.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translations Issues about GeoNodes language support
Projects
None yet
Development

No branches or pull requests

4 participants