-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Display multilingual relation labels #344
Conversation
Also, make the values in the 'label' dict singular, so we can use them to label each relation ('Relation 1', 'Relation 2'...). This will make the form less confusing now we have texts in all for languages for the relations, going from two fields to five per relation.
d37da2f
to
b7826c7
Compare
b7826c7
to
091bca0
Compare
""" | ||
relations = _get_relations_from_storage(data) | ||
if not relations: | ||
relations = get_relations_from_form(data) | ||
|
||
data_empty = {'title': '', 'url': ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were using three different terms for the text of a relation in various places in the code (label
, title
, text
) and it was a mess. I'm eliminating title
to simplify things a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
@@ -2,13 +2,13 @@ | |||
{% set publisher = h.ogdch_publisher_form_helper(data) %} | |||
|
|||
{# Input for publisher names in multiple languages #} | |||
{% for lang in ['fr', 'de', 'it', 'en'] %} | |||
{% for lang in h.fluent_form_languages(field, entity_type, object_type, schema) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the order of languages the same as in the other multilingual form snippets.
label=lang.upper() ~ ' ' + h.scheming_language_text(field.label_name), | ||
placeholder=lang.upper() ~ ' ' + h.scheming_language_text(field.form_placeholder_name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the multilingual labels and placeholders consistent with the other multilingual form snippets.
@@ -2,19 +2,24 @@ | |||
|
|||
{% set relations_rows = h.ogdch_relations_form_helper(data) %} | |||
{%- for row in relations_rows -%} | |||
<h4 class="relation-label {{row.css_class}}">{{h.scheming_language_text(field.label) ~ ' ' ~ row.index}}</h4> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
firstHiddenRows.addClass('ogdch-show-row'); | ||
var firstHiddenLabel = $('.relation-label.ogdch-hide-row') | ||
.slice(0, 1); | ||
firstHiddenLabel.addClass('ogdch-show-row') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
firstHiddenLabel.addClass('ogdch-show-row');
; - should be added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
""" | ||
relations = _get_relations_from_storage(data) | ||
if not relations: | ||
relations = get_relations_from_form(data) | ||
|
||
data_empty = {'title': '', 'url': ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my
""" | ||
relations = _get_relations_from_storage(data) | ||
if not relations: | ||
relations = get_relations_from_form(data) | ||
|
||
data_empty = {'title': '', 'url': ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
@@ -2,19 +2,24 @@ | |||
|
|||
{% set relations_rows = h.ogdch_relations_form_helper(data) %} | |||
{%- for row in relations_rows -%} | |||
<h4 class="relation-label {{row.css_class}}">{{h.scheming_language_text(field.label) ~ ' ' ~ row.index}}</h4> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
No description provided.