Skip to content

kiwicom/stranger-strings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e053499 Β· Oct 30, 2021
Aug 27, 2019
Oct 2, 2020
Oct 30, 2021
Aug 27, 2019
Oct 30, 2021
Aug 27, 2019
Sep 27, 2018
Sep 27, 2018
Sep 19, 2019
Oct 30, 2021
Oct 31, 2018
Sep 27, 2018
Sep 19, 2019
Sep 25, 2019
Oct 5, 2020
Feb 1, 2019
Aug 27, 2019
Sep 27, 2018
Oct 5, 2020
Oct 30, 2021
Sep 27, 2018

Repository files navigation

Stranger Strings

image

πŸ“ Description

Stranger Strings is open-source Firebase web application for analyzing localisation and exploring inconsistencies and mistakes in translations. It currently supports Github repos with JSON loc files or Phrase loc projects.

config_preview2

βœ… Checks:

  • Placeholders - Detects missing / excess / inconsistent placeholders
  • HTML tags - Detects invalid / inconsistent / prohibited HTML tags
  • Length - Detects suspicious variations in length
  • Spelling - Detects spelling mistakes (supported languages can be chosen by enabling dictionaries in config file, uses nspell)
  • Style - Detects stylistic issues – passive voice, weasel words, overuse of adverbs, cliches and similar (available only for english and german translations, uses write-good)
  • Insensitiveness - Detects gender favouring, polarising, race related, religion inconsiderate, or other unequal phrasing (available only for english translations, uses Alex)
  • Values - Detects values, that should/could be replaced by placeholders, because values are likely to change over time
  • First character - Detects inconsistencies of first character
  • Last character - Detects inconsistencies of last character

πŸ›  Project setup

πŸ“Œ Requirements

  • Firebase project with (Flame/Blaze Plan*)
  • Firebase Realtime Database
  • GitHub repository with localizations in flat JSON format or Phrase account

* Flame and Blaze plans are required for Google Cloud Functions outbound API calls (e.g. GitHub). Stranger Strings is a very lightweight application so if you choose Blaze plan you shouldn't pay anything at all

🧩 Installation

1. Configure .env file (e.g.:)

# note: select one data source and fill it's data

################ DATASOURCE: PhraseApp ################

VUE_APP_PHRASEAPP_PROJECT_ID="yourPhraseAppProjectID"
VUE_APP_PHRASEAPP_TOKEN="yourPhraseAppToken"

################# DATASOURCE: GitHub ##################

VUE_APP_GITHUB_USER="yourGitHubUserAccontName"
VUE_APP_GITHUB_PASSWORD="youtGitHubUserPassword"
VUE_APP_GITHUB_REPO="https://github.com/yourRepository/yourTranslations"

#######################################################

VUE_APP_FIREBASE_MESSAGING_SENDER_ID="seeImagesBelow"
VUE_APP_FIREBASE_API_KEY="seeImagesBelow"
VUE_APP_FIREBASE_AUTH_DOMAIN="seeImagesBelow"
VUE_APP_FIREBASE_DATABASE_URL="seeImagesBelow"
VUE_APP_FIREBASE_PROJECT_ID="seeImagesBelow"
VUE_APP_FIREBASE_STORAGE_BUCKET="seeImagesBelow"
VUE_APP_FIREBASE_APP_ID="seeImagesBelow"

config_preview2

2. Install dependencies

yarn install --all && yarn --cwd ./functions

3. Login to Firebase and select target project

firebase login
firebase use *your_Firebase_project_ID*

4. (Optional) Adjust access rights and sign-in method in/common/config.js

5. Deploy

yarn deploy

6. Enable sign-in providers accordingly to config const SIGN_IN_METHOD in /common/config.js in Firebase Console (default Anonymous)

authproviderss

πŸ’½ Data sources

Stranger Strings supports importing translations from Phrase or GitHub.

:octocat: GitHub repository structure

.
β”œβ”€β”€ en-GB.json              # file containing en-GB localization
β”œβ”€β”€ ...
└── xx-XX.json

:octocat: JSON format

Supports only basic key-value format where key is translation key and value is translation content.

flat form:

{
  ...
  "translation.key": "Translation content 1.",
  "translation.keyTwo": "Translation content 2.",
  "another.translation.key": "Another translation content.",
  ...
}

or nested form:

{
  ...
  "translation": {
    "key": "Translation content 1.",
    "keyTwo": "Translation content 2."
  },
  "another": {
    "translation": {
      "key": "Another translation content."
    }
  },
  ...
}