software-o-o icon indicating copy to clipboard operation
software-o-o copied to clipboard

Software page error navigating in Catalan

Open Davidmp1 opened this issue 5 years ago • 8 comments

When navigating beyond (and from) the landing page selecting the catalan language, an error message appears:

(): mapping values are not allowed in this context at line 1 column 21

See, for instance, the catalan version for the following page, and then change it to any other language:

https://software.opensuse.org/distributions/leap

Is this due to a bad translated string or is it the page? Does it need some refreshing? It happens since last update for the 15.1 release.

This issue is also filed as a bug:

https://bugzilla.opensuse.org/show_bug.cgi?id=1136684

Thanks.

Davidmp1 avatar May 29 '19 18:05 Davidmp1

Thanks for your report! This definitely needs some investigation, translations should not break :cry:

This issue is also filed as a bug

In the future, please stick to one issue tracker (preferably this one). If there are two tickets for the same problem they could go out of sync.

agraul avatar May 31 '19 14:05 agraul

any news on that? I just got hit by this again.

mbgg avatar Aug 23 '19 05:08 mbgg

I did not get around to looking at this yet :cry:

agraul avatar Aug 23 '19 08:08 agraul

I found the cause: In the application, we load the distribution information from YAML files that contain strings that are translated. When the strings that are translated into Catalan are inserted in the file, it results in YAML-data that can't be parsed. This is due to the fact that the Catalan translations end with colons in places they should not, e.g. https://github.com/openSUSE/software-o-o/blob/master/locale/ca/software.po#L516.

That example string results in basically this code:

require 'yaml'

YAML.safe_load("- name: Instal·lació:")

which causes a backtrace with the error message that you see on the webpage:

Traceback (most recent call last):
        4: from repro-ca.rb:3:in `<main>'
        3: from /usr/lib64/ruby/2.6.0/psych.rb:349:in `safe_load'
        2: from /usr/lib64/ruby/2.6.0/psych.rb:390:in `parse'
        1: from /usr/lib64/ruby/2.6.0/psych.rb:456:in `parse_stream'
/usr/lib64/ruby/2.6.0/psych.rb:456:in `parse': (<unknown>): mapping values are not allowed in this context at line 1 column 21 (Psych::SyntaxError)

agraul avatar Aug 27 '19 18:08 agraul

Hello,

I have changed it on weblate. There were tree more similar cases: the tab titles. Feel free to make other corrections. Many regards,

David

Missatge de Alexander Graul [email protected] del dia dt., 27 d’ag. 2019 a les 20:06:

I found the cause: In the application, we load the distribution information from YAML files that contain strings that are translated. When the strings that are translated into Catalan are inserted in the file, it results in YAML-data that can't be parsed. This is due to the fact that the Catalan translations end with colons in places they should not, e.g. https://github.com/openSUSE/software-o-o/blob/master/locale/ca/software.po#L516 .

That example string results in basically this code:

require 'yaml'

YAML.safe_load("- name: Instal·lació:")

which causes a backtrace with the error message that you see on the webpage:

Traceback (most recent call last):

    4: from repro-ca.rb:3:in `<main>'
    3: from /usr/lib64/ruby/2.6.0/psych.rb:349:in `safe_load'
    2: from /usr/lib64/ruby/2.6.0/psych.rb:390:in `parse'

    1: from /usr/lib64/ruby/2.6.0/psych.rb:456:in `parse_stream'

/usr/lib64/ruby/2.6.0/psych.rb:456:in `parse': (): mapping values are not allowed in this context at line 1 column 21 (Psych::SyntaxError)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openSUSE/software-o-o/issues/596?email_source=notifications&email_token=ACB5LZG5BYK5OG46SA6ZCDDQGVUJFA5CNFSM4HQQXLF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5ITZYY#issuecomment-525417699, or mute the thread https://github.com/notifications/unsubscribe-auth/ACB5LZBI3SL6PEFX425L6FDQGVUJFANCNFSM4HQQXLFQ .

Davidmp1 avatar Aug 30 '19 20:08 Davidmp1

Unfortunately the corrected translations don't work either, but that is something on our side I think - the side does load, but switching tabs don't work. I think it is due to the fact that we overuse the translations, they are also used for html ids

agraul avatar Sep 03 '19 15:09 agraul

I can confirm that the tabs not working is due to spaces in the tab names. I try to come up with a solution that does not require the translations to change

agraul avatar Sep 03 '19 16:09 agraul

@agraul

I think it is due to the fact that we overuse the translations, they are also used for html ids

Translations shouldn't be used for the ids, I'll take a look! :wink:

Ana06 avatar Oct 30 '20 14:10 Ana06