Skip to content

Instantly share code, notes, and snippets.

View flodolo's full-sized avatar

Francesco Lodolo flodolo

View GitHub Profile
#! /usr/bin/env python3
from copy import deepcopy
from lxml import etree
import os
script_path = os.path.abspath(os.path.dirname(__file__))
tree = etree.parse("full.tmx")
root = tree.getroot()
@flodolo
flodolo / check_monitor_locales.py
Last active January 12, 2021 16:49
Check monitor locales
#!/usr/bin/env python3
import json
from urllib.parse import quote as urlquote
from urllib.request import urlopen
def main():
# Get completion stats for locales from Pontoon

Guida alla localizzazione dei testi di Firefox

Questo documento ha lo scopo di agevolare la creazione e la localizzazione dei testi e di garantire la loro stesura e la loro coerenza a livelli ottimali. Il documento è costantemente aggiornato ed esprime la nostra situazione attuale. Gli aggiornamenti rispecchieranno fedelmente la costante evoluzione espressiva del nostro brand.

Perché la guida è importante per la localizzazione dei testi di marketing di Firefox?

Questa guida ha l'obiettivo di aiutarti a entrare in piena sintonia con il brand Firefox per capire come tradurre al meglio nella tua lingua. Inoltre, condivideremo dei termini specifici e approvati a livello aziendale, spelling incluso, per semplificare la localizzazione.

#! /usr/bin/env python
#
# update_other_locales.py <base_l10n_folder> <xliff_filename> [optional list of locales]
#
# For each folder (locale) available in base_l10n_folder:
#
# 1. Read existing translations, store them in an array: IDs use the structure
# file_name:string_id:source_hash. Using the hash of the source string
# prevent from keeping an existing translation if the ID doesn't change
# but the source string does.
af
am
ar
as
az
be
bg
bs
ca
chr
#! /usr/bin/env python3
# Note: this wont work on python 2.7
# This script must be executed at the root of the repository.
import xml.etree.ElementTree as ET
import os
THRESHOLD = 0.70 # 70% Target Completeness for import
FILES = []
@flodolo
flodolo / locales.py
Last active July 29, 2020 18:17
Output CSV with selected products+locales
#! /usr/bin/env python3
import json
from urllib.request import urlopen
from urllib.parse import quote as urlquote
try:
query = '''
{
projects {
@flodolo
flodolo / locales.py
Created July 29, 2020 17:16
Check android-l10n locales
#! /usr/bin/env python3
import json
from urllib.request import urlopen
from urllib.parse import quote as urlquote
try:
query = '''
{
projects {
@flodolo
flodolo / check_not_shipping.py
Created June 24, 2020 06:57
Check Thunderbird l10n status
#! /usr/bin/env python3
import json
import os
from collections import OrderedDict
from operator import itemgetter
from urllib.parse import quote as urlquote
from urllib.request import urlopen
@flodolo
flodolo / check_bug1643221.py
Created June 5, 2020 05:40
Check translations for bug 1643221
#! /usr/bin/env python3
import json
from urllib.request import urlopen
base_key = 'browser-data-{}-2'
browsers = [
'ie',
'edge',