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

Use FreeResponse translations #33974

Merged
merged 3 commits into from Apr 6, 2020
Merged

Use FreeResponse translations #33974

merged 3 commits into from Apr 6, 2020

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Apr 1, 2020

Use translations of FreeResponse fields (added in #33970) in the view. Also remove the placeholder placeholder we added to hold us over until now.

Links

Testing story

Added a test translation file to dashboard/config/locales/free_responses.es-MX.yml:

---
es-MX:
  data:
    placeholder:
      csp_socialBelonging_intervention_2018: "yay, a translation"

Then checked http://localhost-studio.code.org:3000/s/csp1-2018/stage/1/puzzle/3/lang/es-mx:

image

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@Hamms Hamms requested a review from daynew April 1, 2020 17:56
@Hamms Hamms requested a review from a team as a code owner April 1, 2020 17:56
Copy link
Member

@daynew daynew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except I could you double check my comment about removing the default placeholder text?

@@ -48,8 +48,7 @@
ReactDOM.render(React.createElement(dashboard.Attachments, {showUnderageWarning: !appOptions.is13Plus, readonly: #{!!@view_options.readonly_workspace}}), document.querySelector('#free-response-upload'));

- height = level.height || '80'
-# FND-984 placeholder needs to be localized level property.
- placeholder = level.placeholder || I18n.t('free_response.placeholder')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want the || I18n.t('free_response.placeholder') so the default text is still there. Most levels don't define the 'placeholder' property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, good catch!

@@ -719,8 +719,6 @@ en:
help_support: "Help and support"
documentation: "Documentation"
tutorials: "Tutorials"
free_response:
placeholder: "Enter your answer here"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to comment above. I'm not sure we want to remove this.

@Hamms Hamms requested a review from daynew April 4, 2020 16:37
@Hamms Hamms merged commit 034cb6c into staging Apr 6, 2020
@Hamms Hamms deleted the use-FreeResponse-translations branch April 6, 2020 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants