Ticket #3607 (closed defect: fixed)

Opened 13 months ago

Last modified 12 months ago

Override file message is not totally translated

Reported by: humitos Owned by: humitos
Priority: Unspecified by Maintainer Milestone: Unspecified by Release Team
Component: InfoSlicer Version: Unspecified
Severity: Unspecified Keywords:
Cc: humitos, godiard, cjl Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

Steps to reproduce it:

  1. Open InfoSlicer
  2. Edit an article
  3. Export your work
  4. Export your work again

Issue:

You will see that the message is partially translated (see screenshot)

Behavior:

Show the message totally translated.

Environment:

  • git version of info slicer

Attachments

info-slicer-english-message.png Download (22.0 KB) - added by humitos 13 months ago.
0001-Change-encoding-to-UTF8-SL-3607.patch Download (15.9 KB) - added by humitos 13 months ago.
0001-reflow-long-gettext-strings.patch Download (2.3 KB) - added by walter 13 months ago.
file.log Download (8.0 KB) - added by humitos 13 months ago.

Change History

Changed 13 months ago by humitos

Changed 13 months ago by humitos

There is a problem with multiple lines strings and gettext:

Changed 13 months ago by walter

I split lines all the time (for help strings in Turtle Art) and have never encountered this bug, but then again, I am using UTF-8. So maybe it is as simple as telling infosclicer about UTF-8?

Changed 13 months ago by humitos

Changed 13 months ago by cjl

I believe our L10n infrastructure is dependent on UTF-8 encoding in order to capture the full array of characters we may need to represent in the many languages we work with.

Changed 13 months ago by walter

I used a slightly different approach that seems to fix the problem:

See attached patch.

Changed 13 months ago by walter

Changed 13 months ago by humitos

Did you test your patch?

When I run "genpot" with your patch applied I get this error:

xol.py:62: warning: internationalized messages should not contain the `\r' escape sequence

I go to the .pot file and effectively I see the same behavior that this ticket mentions.

The solution is re-encode the file as I did. We have to change the end-of-line style:

  • This is wrong for us (DOS format)
    $ file xol.py
    xol.py: Python script, ASCII text executable, with CRLF line terminators
    
  • This is right
    $ file xol.py
    xol.py: Python script, ASCII text executable
    

How to change this:

vim xol.py
:set fileformat=unix
:wq

That command will modify all the lines of the file to change the end-of-line.

We don't want to deal with DOS end-of-line style, it's from 70's :)

Changed 13 months ago by walter

I didn't run genpot, I ran build and got no warnings. And when I ran the activity, I got the proper strings in Spanish.

But I see that the POT file is wrong. I don't understand why I never encounter this problem with TurtleArt.

Changed 13 months ago by humitos

TurtleArt has no "CRLF line terminators" in any of its .py files. Take a look at the log attached. That is why you didn't notice this problem.

Changed 13 months ago by humitos

Changed 13 months ago by walter

Let's solve the problem by getting side of the CRLFs.

Changed 12 months ago by humitos

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.