Created
November 8, 2024 06:39
-
-
Save flodolo/6d8ac07489e750aa74b8ca4266256711 to your computer and use it in GitHub Desktop.
Extract spotlight completion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from urllib.request import urlopen | |
string_ids = [ | |
"browser/browser/newtab/asrouter.ftl:device-migration-fxa-spotlight-sync-body", | |
"browser/browser/newtab/asrouter.ftl:device-migration-fxa-spotlight-sync-header", | |
"browser/browser/newtab/asrouter.ftl:device-migration-fxa-spotlight-sync-primary-button", | |
] | |
locales = {} | |
for string_id in string_ids: | |
url = "https://transvision.flod.org/api/v1/entity/gecko_strings/?id={}".format(string_id) | |
response = urlopen(url) | |
data = json.load(response) | |
for loc in data: | |
if loc not in locales: | |
locales[loc] = 1 | |
else: | |
locales[loc] += 1 | |
print(f"Total locales: {len(locales.keys())}") | |
full_locales = [loc for loc in locales if locales[loc] == 3] | |
full_locales.sort() | |
print(f"Complete locales: {len(full_locales)}\n") | |
print(",".join(full_locales)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment