Skip to content

Commit

Permalink
fix: restore missing .lproj directories (electron#15721)
Browse files Browse the repository at this point in the history
the empty lproj directories help macOS to understand what locales the app supports
  • Loading branch information
nornagon authored and neo291 committed Nov 16, 2018
1 parent f2a8bc8 commit 1f25fc5
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 244 deletions.
31 changes: 31 additions & 0 deletions BUILD.gn
Expand Up @@ -665,9 +665,40 @@ if (is_mac) {
]
}

action("electron_app_lproj_dirs") {
outputs = []

foreach(locale, locales_as_mac_outputs) {
outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
}
script = "build/mac/make_locale_dirs.py"
args = rebase_path(outputs)
}

foreach(locale, locales_as_mac_outputs) {
bundle_data("electron_app_strings_${locale}_bundle_data") {
sources = [
"$target_gen_dir/app_infoplist_strings/$locale.lproj",
]
outputs = [
"{{bundle_resources_dir}}/$locale.lproj",
]
public_deps = [
":electron_app_lproj_dirs",
]
}
}
group("electron_app_strings_bundle_data") {
public_deps = []
foreach(locale, locales_as_mac_outputs) {
public_deps += [ ":electron_app_strings_${locale}_bundle_data" ]
}
}

bundle_data("electron_app_resources") {
public_deps = [
":app2asar",
":electron_app_strings_bundle_data",
":js2asar",
]
sources = [
Expand Down
20 changes: 20 additions & 0 deletions build/mac/make_locale_dirs.py
@@ -0,0 +1,20 @@
# usage: make_locale_dirs.py locale_dir [...]
#
# This script is intended to create empty locale directories (.lproj) in a
# Cocoa .app bundle. The presence of these empty directories is sufficient to
# convince Cocoa that the application supports the named localization, even if
# an InfoPlist.strings file is not provided. Chrome uses these empty locale
# directoires for its helper executable bundles, which do not otherwise
# require any direct Cocoa locale support.

import os
import sys


def main(args):
for dirname in args:
os.makedirs(dirname)


if __name__ == '__main__':
main(sys.argv[1:])
45 changes: 0 additions & 45 deletions tools/mac/apply_locales.py

This file was deleted.

56 changes: 0 additions & 56 deletions tools/mac/copy-locales.py

This file was deleted.

11 changes: 0 additions & 11 deletions tools/mac/create-framework-subdir-symlinks.sh

This file was deleted.

93 changes: 0 additions & 93 deletions tools/mac/find_sdk.py

This file was deleted.

39 changes: 0 additions & 39 deletions tools/mac/make_locale_dirs.sh

This file was deleted.

0 comments on commit 1f25fc5

Please sign in to comment.