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

[Bug] grasswxpy_de.po: has a duplicate message definition #3465

Open
wenzeslaus opened this issue Mar 1, 2024 · 4 comments · May be fixed by #3735
Open

[Bug] grasswxpy_de.po: has a duplicate message definition #3465

wenzeslaus opened this issue Mar 1, 2024 · 4 comments · May be fixed by #3735
Labels
bug Something isn't working translation Message translation related

Comments

@wenzeslaus
Copy link
Member

Describe the bug

Compilation reports a warning: file <grasswxpy_de.po> has some problems: <b'po/grasswxpy_de.po:20658: duplicate message definition...found 1 fatal error>

This does not cause the compilation to fail. It just appears in the compilation output.

To Reproduce
Steps to reproduce the behavior:

make distclean
./configure ...
make

Screenshots

make[3]: Entering directory '.../grass/locale'
GISBASE=".../grass/dist.x86_64-pc-linux-gnu" python3 ./grass_po_stats.py
WARNING: file <grasswxpy_de.po> has some problems: <b'po/grasswxpy_de.po:20658: duplicate message definition...\npo/grasswxpy_de.po:4581: ...this is the location of the first definition\nmsgfmt: found 1 fatal error'>
make[3]: Leaving directory '.../grass/locale'

System description

  • Operating System: Linux, Pop!_OS 20.04 LTS (Ubuntu 20.04)
  • GRASS GIS version: main branch

Additional context

Everything works for me in English, but just noticed this warning when compiling.

@wenzeslaus wenzeslaus added bug Something isn't working translation Message translation related labels Mar 1, 2024
@neteler
Copy link
Member

neteler commented Mar 2, 2024

Technically it would work like this:

# clean PO catalogue of duplicated messages
mv grasswxpy_de.po grasswxpy_de.po.BAD
# --no-wrap or  --width=XX?
msguniq --use-first --width=80 grasswxpy_de.po.BAD > grasswxpy_de.po

Just I don't seem to get the width right in order to have minimal changes.
Well, perhaps that doesn't matter and Weblate would reformat the file anyway...

@HuidaeCho
Copy link
Member

Technically it would work like this:

# clean PO catalogue of duplicated messages
mv grasswxpy_de.po grasswxpy_de.po.BAD
# --no-wrap or  --width=XX?
msguniq --use-first --width=80 grasswxpy_de.po.BAD > grasswxpy_de.po

Just I don't seem to get the width right in order to have minimal changes. Well, perhaps that doesn't matter and Weblate would reformat the file anyway...

I thought make update-po takes care of merging.

grass/locale/Makefile

Lines 70 to 80 in 76bcffb

@cd ./po/ ; for po in `ls *_*.po 2>/dev/null` ; do \
suffix=`echo $$po | cut -d'_' -f2-`; \
lingua=`basename $$suffix .po`; \
prefix=`echo $$po | cut -d'_' -f1`; \
if msgmerge -o $$prefix\_$$suffix.new $$prefix\_$$suffix ../templates/$$prefix.pot; then\
mv $$prefix\_$$suffix.new $$prefix\_$$suffix; \
echo "Merged new messages into $$prefix\_$$suffix" ; \
else \
echo "Merging failed"; \
fi \
done

@neteler
Copy link
Member

neteler commented May 24, 2024

I thought make update-po takes care of merging.

AFAIK no, as msguniq is missing in make update-po.

neteler added a commit to neteler/grass that referenced this issue May 24, 2024
Add gettext message deduplication to `make update-po` step.

Fixes OSGeo#3465
@neteler neteler linked a pull request May 24, 2024 that will close this issue
@neteler
Copy link
Member

neteler commented May 24, 2024

AFAIK no, as msguniq is missing in make update-po.

Addressed in #3735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working translation Message translation related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants