Skip to content

Instantly share code, notes, and snippets.

View flodolo's full-sized avatar

Francesco Lodolo flodolo

View GitHub Profile
@flodolo
flodolo / check_survey.py
Last active February 15, 2024 06:30
Check survey files exported from Smartling
from glob import glob
import csv
import os
import re
import sys
# Pass a path as an argument, the script will go through all .csv files included.
if len(sys.argv) < 2:
sys.exit("Missing path argument")
path = os.path.abspath(sys.argv[1])
@flodolo
flodolo / phabricator_query.py
Last active January 24, 2024 20:18
Query reviews on phabricator
#!/usr/bin/env python3
import argparse
import datetime
import json
import urllib.parse as url_parse
import urllib.request as url_request
from collections import defaultdict
api_token = "TOKEN"
@flodolo
flodolo / convert.sh
Last active January 28, 2024 08:13
Convert l10n repos to monorepo
#! /usr/bin/env bash
# This script requires git-cinnabar and jq installed
# https://github.com/glandium/git-cinnabar
# https://jqlang.github.io/jq/download/
#
# If you pass a path to the script, it will search for locale clones in that folder.
# If that's not available, it will clone the remote repository for the locale.
clones_path=$1
@flodolo
flodolo / verify_windowsbg_experiment.py
Last active May 22, 2023 13:48
Verify Windows Background Notifications experiment
import json
import sys
from urllib.request import urlopen
# Get translations
translations_url = "https://raw.githubusercontent.com/mozilla-l10n/nimbus-l10n/main/.github/storage/windows_bg_notifications_2023.json"
try:
r = urlopen(translations_url)
translations = json.load(r)["translations"]
except Exception as e:
@flodolo
flodolo / podcasts.md
Last active April 18, 2023 06:06
List of podcasts

Podcasts marked as (new) are still in review, and might be removed if they don't deliver.

Entertainment

  • SmartLess - Jason Bateman, Sean Hayes, Will Arnett
  • Conan O’Brien Needs A Friend - Team Coco & Earwolf
  • (new) The Problem With Jon Stewart

Localization

@flodolo
flodolo / focus.py
Last active February 28, 2023 17:12
Focus locales missing from Fenix
#! /usr/bin/env python3
import json
from urllib.parse import quote as urlquote
from urllib.request import urlopen
def main():
query = """
{
@flodolo
flodolo / gist:ee76904421ad7a820a65b690e27e2542
Created December 20, 2022 19:59
Analyze Fenix data with CSV
#!/usr/bin/env python3
"""
This script is used to check top locales for Fenix in specific countries,
and try to find a best match in Pontoon locales.
It expects a CSV file stored as "android_data.csv" from this query
https://sql.telemetry.mozilla.org/queries/89302
"""
#!/usr/bin/env python
"""
This script uses https://hg.mozilla.org/projects/comm-l10n/ repository to
create repositories with source strings only for Thunderbird and Seamonkey.
"""
import datetime
import os
import shutil
import subprocess
@flodolo
flodolo / import_translation_bar.py
Created October 19, 2022 12:18
Import translations for Firefox Translations notification bar
#! /usr/bin/env python3
import argparse
from copy import deepcopy
import json
import os
from urllib.request import urlopen
def main():
parser = argparse.ArgumentParser()
@flodolo
flodolo / messages.json
Created October 19, 2022 10:02
Translations without DTDs
{
"extensionName": {
"message": "Firefox Translations",
"description": "Name of the extension. Do NOT translate, keep the name in English."
},
"extensionDescription": {
"message": "Translate websites in your browser without using the cloud.",
"description": "Description of the extension."
},
"loadingTranslationEngine": {