Unable to add alias for locale containing '@' character

Description

When I try to add an alias for the sr@latin the page simply scrolls to the top and no text entry field to input the alias is displayed. This same problem occurs for other locales/languages that contain a '@' character.

Environment

fedora.zanata.org. In a project's version settings, languages tab

Activity

Show:

Former user 18 July 2017 at 03:42

Do you want me to submit a patch for that?

Yes please.

Former user 14 July 2017 at 00:16
Edited

not sure if you submitted a fix for this yet, but it should be changing line 56 to:

var id = '#locale-alias-form-' + localeId.replace('@', '\\@');

If our jQuery version is 3+, we can use jQuery.escapeSelector()

There are also several other lines using localeId to make a jQuery selector, so those would need updating too. Probably need an escape(localeId) function to keep it consistent and easy to deal with other escapes if needed.

Do you want me to submit a patch for that?

Former user 13 July 2017 at 22:42
Edited

Verified this is a UX bug in Zanata page. Issue is with jquery does not work well for special char in query and need to escape the char.

Files:
settings-tab-languages.js
method to escape: jqSelector in components-script.js

Carlos Munoz 13 July 2017 at 17:29

I know you worked on this part of the code, perhaps you are the best person to diagnose the problem.

Details

Assignee

Reporter

Tested Version/s

Components

Affects versions

Priority

More fields

Created 12 July 2017 at 21:13
Updated 18 July 2017 at 03:42

Flag notifications