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

Linux Fix \n errors in translation file lang/po/pt_BR.po --- lazy sed fix #34392

Closed
samuelmattjohnston opened this issue Oct 2, 2019 · 3 comments
Labels
(S4 - Invalid) wontfix / can't reproduce / notabug Translation I18n

Comments

@samuelmattjohnston
Copy link

samuelmattjohnston commented Oct 2, 2019

Describe the bug

When you're running make in linux, fails to compile due to people not following conventions on formatting lines.

Steps To Reproduce

cmake ../ -DTILES=1 -DSOUND=1 -DCMAKE_BUILD_TYPE=Release 
make

Try to run make on linux, after running cmake with release flags

Expected behavior

Builds w/o errors

Code:

[$USERNAME@$USERNAME build (master)]$ make
[  0%] Built target translations_prepare
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:87826: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:87931: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:88396: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:103537: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:103572: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:103587: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:103618: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:103626: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:103658: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:181301: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:181313: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:181321: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:181345: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:184286: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:186177: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:186245: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:187711: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:191309: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:191343: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:191377: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:196137: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:204142: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209648: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209686: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209739: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209783: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209818: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209853: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209889: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209915: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209952: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:209997: 'msgid' and 'msgstr' entries do not both begin with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:213622: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:221309: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:221317: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:221325: 'msgid' and 'msgstr' entries do not both end with '\n'
/home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po:222467: 'msgid' and 'msgstr' entries do not both end with '\n'
/usr/bin/msgfmt: found 38 fatal errors
make[2]: *** [lang/CMakeFiles/translations_compile.dir/build.make:68: translations_compile] Error 1
make[1]: *** [CMakeFiles/Makefile2:1054: lang/CMakeFiles/translations_compile.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Versions and configuration

  • Ubuntu 18.10
  • Game Version: Current master as of this post

Additional context

Fixing yourself locally:

sed 's/"\nmsgstr/\\n"\nmsgstr/' /home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po | sed 's/\\n\\n"\nmsgstr/\\n"\nmsgstr/' > /home/$USERNAME/Cataclysm-DDA/lang/po/pt_BR.po

replace location as needed/users

How the stupid line works:

Look for string "\nmsgstr -- which comes out to readable:

"
msgstr

replace with : \\n"\nmsgstr/ -- which comes out to:

\n"
msgstr

issue -- you'll have double \n\n lines. So we pipe that output into a search for: \\n\\n"\nmsgstr -- which means:

\n\n"
msgstr

and replace it with the same from above:

\n"
msgstr

Why?

I'm not going to manually edit 30 lines in a translation file I don't care about. 💯

@ZhilkinSerg ZhilkinSerg added (S4 - Invalid) wontfix / can't reproduce / notabug Translation I18n labels Oct 2, 2019
@ZhilkinSerg
Copy link
Contributor

ZhilkinSerg commented Oct 2, 2019

We know, but translations are managed via Transifex and it should be fixed there.

@samuelmattjohnston
Copy link
Author

samuelmattjohnston commented Oct 2, 2019

@ZhilkinSerg Nice response time. I commented not just for myself, but for others in case this kinda thing happens again. Dirty quick fix for stuff like this.

Your second link just took me back to this repo, unless my browser is being idiotic. So not sure where to push this issue to.

@ZhilkinSerg
Copy link
Contributor

Links were updated. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S4 - Invalid) wontfix / can't reproduce / notabug Translation I18n
Projects
None yet
Development

No branches or pull requests

2 participants