[l10n] Remove etherium-remote-client related code.

We don't use their l10n any more.
This commit is contained in:
mkarolin
2022-07-25 15:54:57 -04:00
parent 138383237f
commit 2b66a65ff3
6 changed files with 7 additions and 40 deletions
-13
View File
@@ -205,19 +205,6 @@ const l10nUtil = {
return l10nUtil.getAllBravePaths().filter((x) => ['grd', 'json'].includes(x.split('.').pop()))
},
// Helper function to retrieve ethereum-remote-client paths relative
// to the Brave paths
getEthereumRemoteClientPaths: (extensionPath) => {
let basePath = extensionPath
if (!basePath) {
basePath = '../../../ethereum-remote-client'
}
return [
`${basePath}/app/_locales/en/messages.json`
]
},
// Helper function to retrieve Greaselion script paths relative to the
// Brave paths.
//
+1 -6
View File
@@ -8,12 +8,7 @@ const pullL10n = (options) => {
cmdOptions.cwd = config.braveCoreDir
if (options.extension) {
const extensionPath = options.extension_path
if (options.extension === 'ethereum-remote-client') {
l10nUtil.getEthereumRemoteClientPaths(extensionPath).forEach((sourceStringPath) => {
util.run('python', ['script/pull-l10n.py', '--source_string_path', sourceStringPath], cmdOptions)
})
return
} else if (options.extension === 'greaselion') {
if (options.extension === 'greaselion') {
l10nUtil.getGreaselionScriptPaths(extensionPath).forEach((sourceStringPath) => {
util.run('python', ['script/pull-l10n.py', '--source_string_path', sourceStringPath], cmdOptions)
})
+1 -6
View File
@@ -12,12 +12,7 @@ const pushL10n = (options) => {
options.with_missing_translations ? '--with_missing_translations' : ''
if (options.extension) {
const extensionPath = options.extension_path
if (options.extension === 'ethereum-remote-client') {
l10nUtil.getEthereumRemoteClientPaths(extensionPath).forEach((sourceStringPath) => {
util.run('/Python39/python', ['script/push-l10n.py', '--source_string_path', sourceStringPath], cmdOptions)
})
return
} else if (options.extension === 'greaselion') {
if (options.extension === 'greaselion') {
l10nUtil.getGreaselionScriptPaths(extensionPath).forEach((sourceStringPath) => {
util.run('python', ['script/push-l10n.py', '--source_string_path', sourceStringPath], cmdOptions)
})
+2 -2
View File
@@ -185,14 +185,14 @@ program
program
.command('pull_l10n')
.option('--extension <extension>', 'Scope this command to localize a Brave extension such as ethereum-remote-client')
.option('--extension <extension>', 'Scope this command to localize a Brave extension such as greaselion')
.option('--grd_path <grd_path>', `Relative path to match end of full GRD path, e.g: 'generated_resources.grd'.`)
.option('--debug', `Dumps downloaded content for one language into TransifexCurrent.txt file in the temp directory.`)
.action(pullL10n)
program
.command('push_l10n')
.option('--extension <extension>', 'Scope this command to localize a Brave extension such as ethereum-remote-client')
.option('--extension <extension>', 'Scope this command to localize a Brave extension such as greaselion')
.option('--extension_path <extension_path>', 'Local path for extension')
.option('--grd_path <grd_path>', `Relative path to match end of full GRD path, e.g: 'generated_resources.grd'.`)
.option('--with_translations', 'Push local translations. WARNING: this will overwrite translations in Tansifex.')
+2 -11
View File
@@ -47,6 +47,7 @@ def should_use_transifex_for_file(source_string_path, filename):
return slug in transifex_handled_slugs or slug.startswith('greaselion_')
# pylint: disable=inconsistent-return-statements
def transifex_name_from_filename(source_file_path, filename):
ext = os.path.splitext(source_file_path)[1]
if 'brave_components_strings' in source_file_path:
@@ -59,11 +60,9 @@ def transifex_name_from_filename(source_file_path, filename):
return 'brave_extension'
if 'brave_rewards' in source_file_path:
return 'rewards_extension'
if 'ethereum-remote-client/app' in source_file_path:
return 'ethereum_remote_client_extension'
assert False, ('JSON files should be mapped explicitly, this '
f'one is not: {source_file_path}')
# pylint: enable=inconsistent-return-statements
def transifex_name_from_greaselion_script_name(script_name):
match = re.search(('brave-site-specific-scripts/scripts/(.*)/_locales/' +
@@ -114,18 +113,10 @@ def get_acceptable_json_lang_codes(langs_dir_path):
# Source language for Brave locales
lang_codes.discard('en_US')
# Source language for ethereum-remote-client
lang_codes.discard('en')
# Files that are not locales
lang_codes.discard('.DS_Store')
lang_codes.discard('index.json')
# ethereum-remote-client has these unsupported locales
lang_codes.discard('tml')
lang_codes.discard('hn')
lang_codes.discard('ph')
lang_codes.discard('ht')
return sorted(lang_codes)
+1 -2
View File
@@ -80,8 +80,7 @@ def main():
upload_source_strings_desc(source_string_path, filename)
# Upload local translations if requested
if ('ethereum-remote-client' in source_string_path or
'brave-site-specific-scripts' in source_string_path or
if ('brave-site-specific-scripts' in source_string_path or
args.with_translations or args.with_missing_translations):
if ext == '.grd':
upload_grd_translations_to_transifex(source_string_path, filename,