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

newly pulled translations faild build at po/af/entries.po.new:29045:50: invalid control sequence #15

Open
lkocman opened this issue Nov 30, 2023 · 6 comments
Assignees

Comments

@lkocman
Copy link
Contributor

lkocman commented Nov 30, 2023

From https://build.suse.de/package/live_build_log/home:lkocman:branches:SUSE:SLE-15-SP5:Update/desktop-translations/standard/x86_64
[ 47s] + ./50-tools/build-entries-po.sh
[ 47s] af/update-desktop-files-apps.po
[ 47s] po/af/entries.po.new:29045:50: invalid control sequence
[ 47s] po/af/entries.po.new:29049:57: invalid control sequence
[ 47s] po/af/entries.po.new:29054:66: invalid control sequence
[ 47s] msgfmt: found 3 fatal errors

@lkocman lkocman self-assigned this Nov 30, 2023
@lkocman
Copy link
Contributor Author

lkocman commented Nov 30, 2023

build_log.txt

@lkocman
Copy link
Contributor Author

lkocman commented Nov 30, 2023

In all cases it complains about these records.

#: /usr/share/applications/wine-browsedrive.desktop:3
msgid "Name(wine-browsedrive.desktop): Browse C:\ Drive"
msgstr ""

#: /usr/share/applications/wine-browsedrive.desktop:4
msgid "GenericName(wine-browsedrive.desktop): Browse C:\ Drive"
msgstr ""

#: /usr/share/applications/wine-browsedrive.desktop:10
#, fuzzy
msgid "Comment(wine-browsedrive.desktop): Browse your virtual C:\ drive"
msgstr "Blaai met die lêerbestuurder deur die lêerstelsel"

@lkocman
Copy link
Contributor Author

lkocman commented Nov 30, 2023

This is the probleamtic entry. First thing to notice is "C:\" vs "C:\\".

[Desktop Entry]
X-SuSE-translate=false
Name=Browse C:\\ Drive
GenericName=Browse C:\\ Drive
Name[sv]=Bläddra i C:\\
Name[de]=Durchsuche C:\\
Name[fi]=Selaa C:\\-asemaa
Name[pl]=Przeglądaj napęd C:\\
Name[ca]=Navegeu per l'unitat C:\\
Comment=Browse your virtual C:\\ drive
Comment[sv]=Bläddra i virtuella enheten C:\\
Comment[de]=Durchsuche das virtuelle C:\\ Laufwerk
Comment[fi]=Selaa virtuaalista C:\\-asemaa
Comment[pl]=Przeglądanie wirtualnego napędu C:\\
Comment[ca]=Navegeu per la vostra unitat virtual C:\\
Exec=xdg-open .wine/dosdevices/c:
Terminal=false
Type=Application
Icon=wine-winefile
Categories=System;Emulator;

@lkocman
Copy link
Contributor Author

lkocman commented Nov 30, 2023

Okay we seem to have following in 50-tool/build-entries-po.sh

  # cp $file po/$lang/entries.po
  # instead of copying, convert to the old inline format
  # with the first awk, filter "\n", "\\ ", and "\ " in translations
  # (msgfilter does not work for me in this case)
  msgattrib -o - --width=1000 --no-obsolete $file | awk '/^msgctxt/ {
  body = 1;print;next}
body == 1 {
  sub(/\\n/, " ")
  sub(/\\\\ /, " ")
  sub(/\\ /, " ")
  print;next}
{print}' | awk '/^msgctxt/ {
  body = 1
  ctxt=gensub(/msgctxt \"(.+)\"/, "\\1", "g")
  gsub(/&/, "\\\\&", ctxt)
  next}
/^msgid/ && body == 1 {
  sub(/msgid \"/, "&" ctxt ": ")
  print
  next}
{print}

@lkocman
Copy link
Contributor Author

lkocman commented Nov 30, 2023

Interestingly

going around the awk substitution and passing "C:\\" to gettext's msgfmt fixes the issue. I wonder why do we really substitute "\\" to "\\".

lkocman@localhost:~/Workspace/opensuse/desktop-file-translations> msgfmt po/af/entries.po.new -o po/af/entries.mo
po/af/entries.po.new:29045:50: invalid control sequence
po/af/entries.po.new:29049:57: invalid control sequence
po/af/entries.po.new:29054:66: invalid control sequence
msgfmt: found 3 fatal errors
lkocman@localhost:~/Workspace/opensuse/desktop-file-translations> vim po/af/entries.po.new
lkocman@localhost:~/Workspace/opensuse/desktop-file-translations> msgfmt po/af/entries.po.new -o po/af/entries.mo

@lkocman
Copy link
Contributor Author

lkocman commented Nov 30, 2023

And this package seems to be the only one who actually references it in the name. Seems like a proper fix for us would be to escape every single one. Qustion is whether we should manually substitute "\" to "" in the first place.

lkocman@localhost:~/Workspace/opensuse/desktop-file-translations/51-xml/download/extracted> grep -R '\\' * | grep Name
wine/usr/share/applications/wine-browsedrive.desktop:Name=Browse C:\ Drive
wine/usr/share/applications/wine-browsedrive.desktop:GenericName=Browse C:\ Drive
wine/usr/share/applications/wine-browsedrive.desktop:Name[sv]=Bläddra i C:\
wine/usr/share/applications/wine-browsedrive.desktop:Name[de]=Durchsuche C:\
wine/usr/share/applications/wine-browsedrive.desktop:Name[fi]=Selaa C:\-asemaa
wine/usr/share/applications/wine-browsedrive.desktop:Name[pl]=Przeglądaj napęd C:\
wine/usr/share/applications/wine-browsedrive.desktop:Name[ca]=Navegeu per l'unitat C:\
wine-staging/usr/share/applications/wine-browsedrive.desktop:Name=Browse C:\ Drive
wine-staging/usr/share/applications/wine-browsedrive.desktop:GenericName=Browse C:\ Drive
wine-staging/usr/share/applications/wine-browsedrive.desktop:Name[sv]=Bläddra i C:\
wine-staging/usr/share/applications/wine-browsedrive.desktop:Name[de]=Durchsuche C:\
wine-staging/usr/share/applications/wine-browsedrive.desktop:Name[fi]=Selaa C:\-asemaa
wine-staging/usr/share/applications/wine-browsedrive.desktop:Name[pl]=Przeglądaj napęd C:\
wine-staging/usr/share/applications/wine-browsedrive.desktop:Name[ca]=Navegeu per l'unitat C:\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant