-
Notifications
You must be signed in to change notification settings - Fork 228
Technical Tutorial on Setting Up a New Language
For the purposes of this tutorial, we assume the new language is Portuguese, with the ISO 639-1 2-letter language code PT
This is a tracking ticket for [technical tasks related to starting the $$$ team](https://github.com/programminghistorian/jekyll/wiki/Technical-Tutorial-on-Setting-Up-a-New-Language).
- [ ] Create new defaults in _config.yml
- [ ] Add new language line to all snippets
- [ ] Copy core pages to the new language directory
- [ ] Push core pages to gh-pages branch so language team can begin translation
- [ ] Create language logo and set theme color
- [ ] Update CSS to include new colors
- [ ] Add the new language to the RSS feed XML
- [ ] Enable full text search stemming support
- [ ] Add the new team to [this](https://github.com/programminghistorian/jekyll/blob/15f818d6d11d9cee17f17e1689655b294d69397d/_includes/project-team-loop.html#L28) loop once editors have been added to the team's data files.
- [ ] Create Favicon
- [ ] Request DOIs from provider for new language
- [ ] Make pages public
- [ ] Open an issue for adding it to the Twitter bot when you reach a lesson threshold (usually seven lessons)
You must add three new scope entries:
- the entire
pt
directory - the
pt
"lessons" directory (updated as needed to match to the directory name as eventually translated by the PT team) - the
pt
"retired lessons" directory (updated as needed to match to the directory name as eventually translated by the PT team)
defaults:
- scope:
path: "pt"
values:
lang: "pt"
- scope:
path: "pt/licoes"
values:
lesson: true
- scope:
path: "pt/licoes/retirado"
values:
lesson: false
retired: true
In _config.yml
we want to temporarily exclude these pages from being built:
exclude:
- deprecated
- vendor
- Gemfile
- Gemfile.lock
- archive
- pt
We will remove this exclusion when it is time to publish.
In snippets.yml
every entry needs to have a new line added with pt:
. As needed, follow the pattern you see in existing snippets, such as the unique pattern used for the menu links:
# top nav bar
menu-home:
en: /
es: /es
fr: /fr
pt: /pt
menu-about:
en: About
es: Acerca
fr: À propos
pt:
menu-about-overview:
en:
title: About PH
link: /en/about
es:
title: Acerca
link: /es/acerca-de
fr:
title: À propos
link: /fr/apropos
pt:
title:
link:
As with all YAML, you must be exact about whitespace. After making all these changes, I strongly recommend trying a test build locally to see if you have any YAML errors here before moving on.
Note: Do NOT add the new language to language-list
at the top of the file until you are ready to publish
Create a new directory /pt
and copy in the core pages from the /en
folder, not including the lessons directory.
Make the following edits to each file:
- Remove any extra YAML fields like
redirect_only
(these are needed to maintain our old URLs from prior to our multilingual restructuring). The only fields that you should keep are:title
layout
-
skip_validation
(if present) -
skip_concordance
(if present)
- Add the
original
field to each page, and set it to the English base filename (soabout.md
should haveoriginal: about
)
Create a directory for lessons and retired lessons, and add an empty file in the retired folder called .keep
which will make sure the new folders get commited. For PT, we created the directory structure: /pt/licoes/retirado/.keep
. (If the PT team decides to change those directory names, make sure to change the entries in _config.yml
to match their decisions.
Once the previous changes are done, the translation team can begin to work on translating and renaming pages to their language. They may submit PRs and merge them to gh-pages
during this phase without affecting the public site, so not every single page needs to be translated and added in a single PR. All pages must be translated and merged to gh-pages
before the final step where the pages are made public, however.
The following changes can happen while translation is going on:
Once the language team has settled on a logo variant and a theme color, add the hexadecimal color code to snippets.yml
under background_color
Using that same color, go to the "ProgrammingHistorian logos" folder on the [email protected] Google drive and make new copies of the source files, the logo with and without the URL.
- Adjust the filenames to match the naming convention of the other files
- Adjust the color, URL, and logo typography as needed
- Download the new files as SVG and save them in
/images/logos
In css/style.css, in the block starting at line 56 you need to set the background color for the new language, like so:
.pt-back {
background-color: {{ site.data.snippets.background_color.pt }};
}
We recently updated the RSS feed to add new language material automatically. Check /feed.xml on the site preview to ensure the new language's material appears. If not, you'll need to edit the logic in /feed.xml
A dedicated lunr language stemmer needs to be added to the /js/vendor
directory. Work with the technical team and consult the Technical Tutorial on Search for this step.
In /images/favicons/ create a .ico file with the format LANGABBREV_favicon.ico. You'll want to take the logo file from /images/logos/ and use photoshop to create one in the same format as the others.
Ask @drjwbaker (or someone else on ProgHist Ltd) on behalf of the Ltd to check with the DOI provider that they are happy provide DOIs for a new publication. If the provider cannot supply DOIs the new publication will run without DOIs until the Ltd finds a solution
- Add the language abbreviation to
language-list
in snippets.yml - Edit
_config.yml
to remove the new language directory from the "excluded" paths. This means Jekyll will now attempt to build it. - Ensure that all checks pass. The first full build you try will probably have errors, particularly with incorrect links between the core pages! Be patient and read the errors carefully. Try to do this step locally first to clean up most major errors before opening up the pull request.
In order to actually troubleshoot the new translated pages as they come in, you will want to:
- Run the site locally.
- Make sure that pages you are looking at do not have 'skip_validation: true' in the YML.
- Temporarily make the site appear as part of the project. This means adding the language abbreviation to 'language-list' in snippets.yml and editing the '_config.yml' file so that it is not excluded from building. Important: this means the site will be built and displayed. You need to remember to undo these steps before pushing anything, or else you will have a half-built language site as part of the main, live project.
- Check the terminal for validation errors
- Click through the pages for any obvious syntax issues. Might be easier to just type the URLs in directly.
- Report back
- Repeat
Note that you can merge in portions of the site and not worry about affecting the site as a whole. None of that material will be public until you take steps under "FINALLY: Make pages public."
- Copyediting
- Copyedit comments
- Typesetting
- Archival Hyperlinks
- Copyright
- DOI
- Gallery image
- Checklist comment
- Handover comment
- Closing comment
- Opening comment Phase 0
- Phase change comment 1 to 2
- Phase change comment 2 to 3
- Phase change comment 3 to 4
- Opening comment Phase 4
- Phase change comment 4 to 5
- Phase change comment 5 to 6
- Phase change comment 6 to 7
- Tracking lesson phase changes
- Organisational Structure
- Trustee Responsibilities
- Trustee and Staff Roles
- Services to Publications
- Funding
Training
- Onboarding-Process-for-New-Editors
- Leading-a-Shadowing-process
- Board-of-Director---Continuing-Development
The Ombudsperson Role
Technical Guidance
- Making Technical Contributions
- Creating Blog Posts
- Service Integrations
- Brand Guidelines
- French Translation Documentation
- Technical Tutorial on Translation Links
- Technical Tutorial on Setting Up a New Language
- Technical Tutorial on Search
- Twitter Bot
- Achieving-Accessibility-Alt-text-Colour-Contrast
- Achieving-Accessibility:-Training-Options
Editorial Guidance
- Achieving Sustainability: Copyediting, Typesetting, Archival Links, Copyright Agreements
- Achieving Sustainability: Lesson Maintenance Workflow
- Achieving Sustainability-Agreed-terminology-PH-em-português
- Training and Support for Editorial Work
- The-Programming-Historian-Digital-Object-Identifier-Policy-(April-2020)
- How to Request a New DOI
- Service-Agreement-Publisher-and-Publications
- ProgHist-services-to-Publications
- Technical Tutorial on Setting Up a New Language
- Editorial Recruitment
Social Guidance
Finances
- Project Costs
- Spending-Requests-and-Reimbursement
- Funding Opportunities
- Invoice Template
- Donations and Fundraising Policies
Human Resources
- Privileges-and-Responsibilities-of-Membership
- Admin-when-team-members-step-down
- Team-Leader-Selection-Process
- Managing-Editor-Handover
- Checklist-for-Sabbaticals
- New Publications Policy
- Parental-Leave-Policy
Project Management
Project Structure
Board of Trustees