Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

164 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Session Shared Scripts

This repo houses scripts which are shared between the different platform repos for Session, it also contains a number of Actions used to automatically sync some shared elements across the repos.

Crowdin Translation Workflow

Automated workflow that downloads translations from Crowdin, validates them, and creates PRs for iOS and Android platforms and for the Typescript Localization Module for Desktop and QA.

Required Secrets

Secret Description
CROWDIN_API_TOKEN Crowdin personal access token (see scopes below)
CROWDIN_PR_TOKEN GitHub token with PR creation permissions

Crowdin token scopes

Crowdin scopes personal access tokens per endpoint family, so a token missing one scope returns 403 Forbidden on just those endpoints while every other call keeps working. The scripts in this repo need:

Scope Value Needed for
Projects project Project details and the target-language list
Source files & strings project.source Listing source strings (approve_strings.py, multiple-translations report)
Translations project.translation Translation exports, plus reading/adding approvals and translations
Glossaries glossary Non-translatable strings (glossary terms)

Note: Scopes only cap what a token may do — they don't grant anything the token's Crowdin account can't already do, so the account also needs a project role that allows it (manager/proofreader for anything that writes, e.g. the approvals POST in approve_strings.py).

Workflow Inputs

Input Default Description
UPDATE_PULL_REQUESTS true Create/update PRs for all platforms
SKIP_VALIDATION_ERRORS false Continue even if string validation fails

Schedule

Runs automatically every Monday at 00:00 UTC.

Validation Rules

All Strings (including plurals)

  • Valid {variable} syntax - No broken braces ({, }, {}, { space })
  • Allowed HTML tags only - Only <b>, <br/>, <span>
  • Valid tag syntax - No malformed < (e.g., <script>, <123>)

Non-Plural Strings Only

  • Variables match English - Same {variables} as source locale
  • Tag count matches English - Same number of tags (warning only)

All Locales

  • No extra keys - No strings that don't exist in English

Note: Plural strings skip variable/tag comparison because languages have different plural forms (English: 2, Arabic: 6, Russian: 4). It would be nice to add suppot for plural validation in the future.

Workflow Failure Notificaiton

If a workflow fails and is in the list of workflows monitored by the failure notificaiton workflow, the failure notificaiton workflow will send a message to a discord webhook.

Required Secrets

Secret Description
DISCORD_WEBHOOK_URL Url for the Discord webhook
DISCORD_ROLE_ID Discord role id to tag in messages

Trigger Test Notification

The failure notification can be triggered by manualy running the Test Failure Notification workflow.

About

scripts for updating strings projects

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages