mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Generate .pak for each locale.
This commit is contained in:
33
tools/posix/make_locale_paks.sh
Executable file
33
tools/posix/make_locale_paks.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# usage: make_locale_paks locale_dir [...]
|
||||
#
|
||||
# This script creates the .pak files under locales directory, it is used to fool
|
||||
# the ResourcesBundle that the locale is available.
|
||||
|
||||
set -eu
|
||||
|
||||
if [[ ${#} -eq 0 ]]; then
|
||||
echo "usage: ${0} build_dir [locale_pak...]" >& 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PRODUCT_DIR="$1"
|
||||
shift
|
||||
|
||||
LOCALES_DIR="${PRODUCT_DIR}/locales"
|
||||
if [[ ! -d "${LOCALES_DIR}" ]]; then
|
||||
mkdir "${LOCALES_DIR}"
|
||||
fi
|
||||
|
||||
cd "${LOCALES_DIR}"
|
||||
|
||||
for pak in "${@}"; do
|
||||
if [[ ! -f "${pak}.pak" ]]; then
|
||||
touch "${pak}.pak"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user