Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Outline

Internationalization

Overview

This directory contains the source data files for all internationalization on code.org and hourofcode.com. These files should not be directly modified; they will be regularly updated by the i18n sync scripts, which will also distribute changes out to the various locations in the repository where they will be handled.

Modifying/Adding a new string

When adding a string, please make the key as descriptive as possible because this is used as context for translators.

Make sure your string value only has plain text, Markdown-formatted text, and/or simple HTML. Try to always use plain text. If you want to add formatting, use Markdown. If you want to do something that Markdown can't do, you can add HTML.

If you want your string to support embedded HTML you must render it as Markdown. This is because translation strings come from unstruted sources and our Markdown renderer will remove any potentially-dangerous HTML. You can render a string as Markdown by passing markdown: true or markdown: :inline to the I18n.t method. With markdown: true option, Markdown will handle its own block-level elements like paragraphs and lists, while the markdown: inline option will produce content suitable for embedding inside an existing block-level element.

Pegasus

Modifying an existing string

  • Update the string in the i18n Gsheet
  • ssh staging.code.org and check that your changes were synced to staging/pegasus/cache/i18n/en-US.yml

Adding a new string

  • Add a unique key and your string value to the i18n Gsheet.

    • Organization is by category/page; try to prepend each string of a common category with the same key. For example, all teacher dashboard strings begin with 'dashboard' so they're easier to find.
  • ssh into staging and check that your changes were synced to staging/pegasus/cache/i18n/en-US.yml

Apps

  • Make changes in code-dot-org/apps/i18n/<app>/en_us.json
  • If you are creating a new app:
    • Add the strings in a new file in code-dot-org/apps/i18n/<new app>/en_us.json

Dashboard

  • Make changes in dashboard/config/locales. Choose from the following files depending on where it best fits categorically.
    • en.yml - general strings used throughout Code Studio or if it doesn't fit in any of the other files
    • data.en.yml - mostly strings related to accelerated course and video titles
    • devise.en.yml - sign in, sign up, account related
    • scripts.en.yml - course descriptions and stage names. Should be generated by editing the course on levelbuilder, but can be updated directly.
    • slides.en.yml - the screenshots and transcripts that accompany each tutorial video
    • unplugged.en.yml - titles and descriptions for unplugged levels.

Content Changes

Several Dashboard i18n files are updated automatically from levelbuilder content and should not be edited directly. These include:

  • authored_hints.en.yml
  • callouts.en.yml
  • courses.en.yml
  • dsls.en.yml
  • failure_message_overrides.en.yml
  • short_instructions.en.yml
  • long_instructions.en.yml

Updating UI Tests

Many UI tests compare against strings on the page to validate expected results. Follow the instructions in the Dashboard UI Tests README to verify that the UI tests still pass after changing a string, or update them if necessary.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.