File tree 4 files changed +22
-30
lines changed
4 files changed +22
-30
lines changed Original file line number Diff line number Diff line change 63
63
fi
64
64
65
65
- name : Run script to import strings
66
- run : sh ./bootstrap.sh --importLocales
66
+ run : sh ./firefox-ios/import-strings.sh
67
67
68
68
- name : Update new strings
69
69
run : |-
Original file line number Diff line number Diff line change 6
6
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
7
#
8
8
# Use the --force option to force a re-build locales.
9
- # Use the --importLocales option to fetch and update locales only
10
-
11
- getLocale () {
12
- echo " Getting locale..."
13
- rm -rf LocalizationTools
14
- git clone https://github.com/mozilla-mobile/LocalizationTools.git || exit 1
15
-
16
- echo " Creating firefoxios-l10n Git repo"
17
- rm -rf firefoxios-l10n
18
- git clone --depth 1 https://github.com/mozilla-l10n/firefoxios-l10n firefoxios-l10n || exit 1
19
- }
20
9
21
10
if [ " $1 " == " --force" ]; then
22
- rm -rf firefoxios-l10n
23
- rm -rf LocalizationTools
24
11
rm -rf build
25
12
fi
26
13
27
- if [ " $1 " == " --importLocales" ]; then
28
- # Import locales
29
- if [ -d " /firefoxios-l10n" ] && [ -d " /LocalizationTools" ]; then
30
- echo " l10n directories found. Not downloading scripts."
31
- else
32
- echo " l10n directory not found. Downloading repo and scripts."
33
- getLocale
34
- fi
35
-
36
- ./firefox-ios/import-strings.sh
37
- exit 0
38
- fi
39
-
40
14
# Download the nimbus-fml.sh script from application-services.
41
15
NIMBUS_FML_FILE=./firefox-ios/nimbus.fml.yaml
42
16
curl --proto ' =https' --tlsv1.2 -sSf https://raw.githubusercontent.com/mozilla/application-services/main/components/nimbus/ios/scripts/bootstrap.sh | bash -s -- --directory ./firefox-ios/bin $NIMBUS_FML_FILE
Original file line number Diff line number Diff line change 5
5
// swiftlint:disable line_length
6
6
import Foundation
7
7
8
+ // MARK: - Localization bundle setup
9
+ class BundleClass { }
10
+
8
11
public struct Strings {
9
- // This is a little workaround to get localizations
10
- // FXIOS-10838 will fix this by moving localizations or this struct into the appropriate place
11
- public static let bundle = Bundle ( identifier: " org.mozilla.ios.Localizations " ) ?? . main
12
+ public static let bundle = Bundle ( for: BundleClass . self)
12
13
}
13
14
14
15
// MARK: - Localization helper function
Original file line number Diff line number Diff line change 1
1
2
+ echo " \n\n[*] Cloning required repo to import strings"
3
+
4
+ if [ -d " LocalizationTools" ] || [ -d " firefoxios-l10n" ]; then
5
+ rm -rf LocalizationTools
6
+ rm -rf firefoxios-l10n
7
+ fi
8
+
9
+ git clone https://github.com/mozilla-mobile/LocalizationTools.git || exit 1
10
+ git clone --depth 1 https://github.com/mozilla-l10n/firefoxios-l10n || exit 1
11
+
12
+ pip install -r firefoxios-l10n/.github/scripts/requirements.txt
13
+ python3 firefoxios-l10n/.github/scripts/rewrite_original_attribute.py --path firefoxios-l10n
14
+
2
15
echo " \n\n[*] Building tools/Localizations"
3
16
(cd LocalizationTools && swift build)
4
17
@@ -9,3 +22,7 @@ echo "\n\n[*] Importing Strings - takes a minute. (output in import-strings.log)
9
22
--l10n-project-path " $PWD /../firefoxios-l10n" ) > import-strings.log 2>&1
10
23
11
24
echo " \n\n[!] Strings have been imported. You can now create a PR."
25
+
26
+ echo " \n\n[*] Clean up cloned repos"
27
+ rm -rf LocalizationTools
28
+ rm -rf firefoxios-l10n
You can’t perform that action at this time.
0 commit comments