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

encoding bug of " for non-default language #3421

Closed
jmfrenzel opened this issue Nov 16, 2018 · 9 comments · Fixed by #3786
Closed

encoding bug of " for non-default language #3421

jmfrenzel opened this issue Nov 16, 2018 · 9 comments · Fixed by #3786

Comments

@jmfrenzel
Copy link
Contributor

jmfrenzel commented Nov 16, 2018

Descriptive summary

encoding bug of „ “ for German language

Expected behavior

Übertragung des Eigentums von „Fedora“

Guillemets are preferred in German. I started to correct this earlier in https://github.com/samvera/hyrax/pull/2443/files
So #3421 requests to display all quotations as for example: https://nurax-dev.curationexperts.com/concern/generic_works/gm80hv50h/edit?locale=de
... im Abschnitt „Freigeben“ einen bestimmten ...

Actual behavior

https://nurax-dev.curationexperts.com/works/hd76s024f/transfers/new?locale=de

Steps to reproduce the behavior

  1. https://nurax-dev.curationexperts.com/works/hd76s024f/transfers/new?locale=de

Related work

Link to related tickets or prior related work here.

@jmfrenzel jmfrenzel added the bug label Nov 16, 2018
@no-reply no-reply added this to the 2.x series milestone Nov 16, 2018
@no-reply no-reply added this to Backlog in Hyrax WG -- Sprint 6 via automation Nov 26, 2018
@no-reply no-reply moved this from Backlog to Ready in Hyrax WG -- Sprint 6 Nov 26, 2018
@vantuyls vantuyls added this to Backlog in Hyrax 3.0.0 Release Dec 7, 2018
@laritakr laritakr self-assigned this Jan 21, 2019
laritakr pushed a commit that referenced this issue Jan 22, 2019
Fixes #3421

Note: This could be related to the process which automatically builds the
translation files, but since it only happened in German, it may have
some other cause. We should probably watch to make sure this doesn't
recur.
@laritakr laritakr moved this from Ready to Review in Hyrax WG -- Sprint 6 Jan 22, 2019
@laritakr laritakr moved this from Review to In progress in Hyrax WG -- Sprint 6 Jan 22, 2019
@jmfrenzel
Copy link
Contributor Author

Changed description, see:
#3476 (comment)

@ghost ghost moved this from Backlog to In Progress in Hyrax 3.0.0 Release Apr 17, 2019
@ghost ghost self-assigned this Apr 17, 2019
@ghost ghost moved this from In Progress to Ready in Hyrax 3.0.0 Release Apr 17, 2019
@jmfrenzel
Copy link
Contributor Author

jmfrenzel commented Apr 17, 2019

German locale
should display „Fedora“
Quotes

English locale
Quotes

@cjcolvar
Copy link
Member

Was this fixed by #3767?

@jmfrenzel
Copy link
Contributor Author

No it wasn't.
The template does not render correctly, see

<h1><span class="fa fa-arrows-h" aria-hidden="true"></span><%= t(:'.title', work_title: @proxy_deposit_request.to_s) %></h1>

This is the line in the German locale being affected.
title: Übertragung des Eigentums von &ldquor;%{work_title}&ldquo;

To me I seems the is with the variable %{work_title}

The other non working rendering is the help text on the same page

sr_only_description: Wählen Sie einen Benutzer aus, um &ldquor;%{work_title}&ldquo; zu senden, fügen Sie optionale Kommentare hinzu und drücken Sie dann Übertragung.

@fritzfreiheit
Copy link
Contributor

fritzfreiheit commented May 22, 2019

I think a general solution to this problem would be to allow for html characters to remain html characters when processed by I18n.translate, rather than replace strings like '„' with '&ldquor;'.

Edit: further research reveals... see below.

@fritzfreiheit
Copy link
Contributor

fritzfreiheit commented May 23, 2019

@jmfrenzel -- I did some research into this, and it turns out that the I18n.translate mechanism accepts hex and unicode escapes, so you can do this (note the double quotes are necessary):

title: "\xDCbertragung des Eigentums von \u201E%{work_title}\u201D"

Produces:

Übertragung des Eigentums von „Der Titel

Given the above, I assume the German yaml files can be updated to produce the desired quote characters without resorting programming. I'm not sure how the internationalization files are updated, but we could either change this ticket to do the updates for all quotes in the German yaml translation files, or a new ticket could be opened to review and do the updates (which may need more than the quote punctuations updated).

Note: Unicode translations were found here: https://www.quackit.com/character_sets/unicode/general_punctuation_unicode_character_codes.cfm

@jmfrenzel
Copy link
Contributor Author

@fritzfreiheit since hyrax will deliver utf-8 what if in the yaml we explicitly use "„ " and "“" ? This would more convenient to maintain. Could you test this? I don't have a dev instance at hand.

@fritzfreiheit
Copy link
Contributor

@jmfrenzel -- Yes, I just tried it on my development instance of Hyrax, and the explicit use of utf-8 characters worked.

@kellyChex
Copy link

Screen Shot 2019-07-09 at 11 12 26 PM

Confirmed the quotations are showing

@kellyChex kellyChex moved this from QA to Done in Hyrax 3.0.0 Release Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
6 participants