Skip to content

[FIXES #7015] makemessages command will set fixture translations to inactive #7019

Merged
afabiani merged 4 commits intomasterfrom
ISSUE_7015
Mar 3, 2021
Merged

[FIXES #7015] makemessages command will set fixture translations to inactive #7019
afabiani merged 4 commits intomasterfrom
ISSUE_7015

Conversation

@gannebamm
Copy link
Contributor

@gannebamm gannebamm commented Mar 2, 2021

  • I have used the makemessage --no-locations command to not write out locations, since those will change due to code changes (line numbers like this #: geonode/base/init.py:29) and this will create loads of noise in the commit messages. This renders it hard to spot new translations and errors (like the ISO category translation not shown (german) #6984 regression).
  • A custom_message.py file was written, which will activate the already translated strings.
  • The .po files got stripped from all obsolete old strings (like worldmap stuff) by makemessage --no-locations --no-obsolete.

By this we will have a clean and future proof makemessage output which is easier to maintain.

Checklist

  • Are all needed old translations part of the custom_translations.py file?
  • Does the translation .po files cover all needed languages?
  • Compile .mo file and test the new translation files.
  • Write documentation
  • Change this PR template to cover the custom_translations.py file for fixtures

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.

The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):

  • There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
  • The issue connected to the PR must have Labels and Milestone assigned
  • PR for bug fixes and small new features are presented as a single commit
  • Commit message must be in the form "[Fixes #<issue_number>] Title of the Issue"
  • New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • This PR passes the QA checks: flake8 geonode
  • Commits changing the settings, UI, existing user workflows, or adding new functionality, need to include documentation updates

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.

@gannebamm gannebamm added this to the 3.2 milestone Mar 2, 2021
@gannebamm gannebamm self-assigned this Mar 2, 2021
@cla-bot cla-bot bot added the cla-signed CLA Bot: community license agreement signed label Mar 2, 2021
@gannebamm
Copy link
Contributor Author

The mo file compilation showed some errors for arabic translations:

Execution of msgfmt failed: /home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:1829: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:1884: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:2481: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:2562: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:4371: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:5069: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:5236: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/geonode/PycharmProjects/geonode_upstream_new/geonode/locale/ar/LC_MESSAGES/django.po:5588: 'msgid' and 'msgstr' entries do not both begin with '\n'
msgfmt: found 8 fatal errors

I see @t-book (?) provided those in this issue #6180. Someone capable should check those.

Apart from that the iso category strings do look ok for de/it/fr - I am only able to read de/en, therefore I am unable to proof-read those.

@codecov
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

Merging #7019 (a072772) into master (fdfda3b) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #7019      +/-   ##
==========================================
- Coverage   58.35%   58.34%   -0.01%     
==========================================
  Files         554      555       +1     
  Lines       39110    39112       +2     
  Branches     5267     5267              
==========================================
- Hits        22821    22820       -1     
- Misses      14901    14904       +3     
  Partials     1388     1388              

afabiani
afabiani previously approved these changes Mar 3, 2021
@afabiani
Copy link
Member

afabiani commented Mar 3, 2021

@gannebamm italian looks good

@afabiani afabiani added translations Issues about GeoNodes language support and removed translations Issues about GeoNodes language support labels Mar 3, 2021
@gannebamm gannebamm marked this pull request as ready for review March 3, 2021 14:48
@gannebamm
Copy link
Contributor Author

Ok. I have ticked all my boxes:

  • documentation was updated
  • mo files are compiled and tested (de/en/it)
  • PR template was updated

Open questions are: What about the errors in the AR translations?

Apart from that I think this is save to merge.

@afabiani afabiani merged commit d2deab6 into master Mar 3, 2021
@afabiani afabiani deleted the ISSUE_7015 branch March 3, 2021 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed CLA Bot: community license agreement signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants