Skip to content

Instantly share code, notes, and snippets.

@flodolo
Last active May 7, 2018 17:00
Show Gist options
  • Save flodolo/f7fb7afa04a4e662344b909e1bfa55dd to your computer and use it in GitHub Desktop.
Save flodolo/f7fb7afa04a4e662344b909e1bfa55dd to your computer and use it in GitHub Desktop.
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from
# from fluent.migrate.helpers import MESSAGE_REFERENCE, EXTERNAL_ARGUMENT, transforms_from
# from fluent.migrate import COPY, CONCAT, REPLACE
def migrate(ctx):
"""Bug 1457948 - Migrate in-content/privacy.js to Fluent, part {index}."""
class COPY_FROM_PROPERTIES(COPY):
def __init__(self, key):
super(COPY_FROM_PROPERTIES, self).__init__(
"browser/chrome/browser/preferences/preferences.properties", key)
ctx.add_transforms(
'browser/browser/preferences/permissions.ftl',
'browser/browser/preferences/permissions.ftl',
transforms_from(
"""
permissions-invalid-uri-title = { COPY_FROM_PROPERTIES("invalidURITitle") }
permissions-invalid-uri-label = { COPY_FROM_PROPERTIES("invalidURI") }
permissions-exceptions-tracking-protection-window =
.title = { COPY_FROM_PROPERTIES("trackingprotectionpermissionstitle") }
.style = { permissions-window.style }
permissions-exceptions-tracking-protection-desc = { COPY_FROM_PROPERTIES("trackingprotectionpermissionstext2") }
permissions-exceptions-cookie-window =
.title = { COPY_FROM_PROPERTIES("cookiepermissionstitle1") }
.style = { permissions-window.style }
permissions-exceptions-cookie-desc = { COPY_FROM_PROPERTIES("cookiepermissionstext1") }
permissions-exceptions-popup-window =
.title = { COPY_FROM_PROPERTIES("popuppermissionstitle2") }
.style = { permissions-window.style }
permissions-exceptions-popup-desc = { COPY_FROM_PROPERTIES("popuppermissionstext") }
permissions-exceptions-saved-logins-window =
.title = { COPY_FROM_PROPERTIES("savedLoginsExceptions_title") }
.style = { permissions-window.style }
permissions-exceptions-saved-logins-desc = { COPY_FROM_PROPERTIES("savedLoginsExceptions_desc3") }
permissions-exceptions-addons-window =
.title = { COPY_FROM_PROPERTIES("addons_permissions_title2") }
.style = { permissions-window.style }
permissions-exceptions-addons-desc = { COPY_FROM_PROPERTIES("addonspermissionstext") }
permissions-site-notification-window =
.title = { COPY_FROM_PROPERTIES("notificationspermissionstitle2") }
.style = { permissions-window.style }
permissions-site-notification-desc = { COPY_FROM_PROPERTIES("notificationspermissionstext6") }
permissions-site-notification-disable-label =
.label = { COPY_FROM_PROPERTIES("notificationspermissionsdisablelabel") }
permissions-site-notification-disable-desc = { COPY_FROM_PROPERTIES("notificationspermissionsdisabledescription") }
permissions-site-location-window =
.title = { COPY_FROM_PROPERTIES("locationpermissionstitle") }
.style = { permissions-window.style }
permissions-site-location-desc = { COPY_FROM_PROPERTIES("locationpermissionstext2") }
permissions-site-location-disable-label =
.label = { COPY_FROM_PROPERTIES("locationpermissionsdisablelabel") }
permissions-site-location-disable-desc = { COPY_FROM_PROPERTIES("locationpermissionsdisabledescription") }
permissions-site-camera-window =
.title = { COPY_FROM_PROPERTIES("camerapermissionstitle") }
.style = { permissions-window.style }
permissions-site-camera-desc = { COPY_FROM_PROPERTIES("camerapermissionstext2") }
permissions-site-camera-disable-label =
.label = { COPY_FROM_PROPERTIES("camerapermissionsdisablelabel") }
permissions-site-camera-disable-desc = { COPY_FROM_PROPERTIES("camerapermissionsdisabledescription") }
permissions-site-microphone-window =
.title = { COPY_FROM_PROPERTIES("microphonepermissionstitle") }
.style = { permissions-window.style }
permissions-site-microphone-desc = { COPY_FROM_PROPERTIES("microphonepermissionstext2") }
permissions-site-microphone-disable-label =
.label = { COPY_FROM_PROPERTIES("microphonepermissionsdisablelabel") }
permissions-site-microphone-disable-desc = { COPY_FROM_PROPERTIES("microphonepermissionsdisabledescription") }
"""
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment