Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/SimpleExample/.bundle/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
8 changes: 8 additions & 0 deletions examples/SimpleExample/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ function AppContent() {
safeArea: useSafeAreaInsets,
storage: SecureStorage,
markdown: Markdown,
buttonFont: {
filename: 'WorkSans-Regular.ttf',
postscriptName: 'WorkSans-Regular',
},
surveyTextFont: {
filename: 'Merriweather-Regular.ttf',
postscriptName: 'Merriweather-Regular',
},
});

Iterate.onResponse((response, question, survey) => {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions examples/SimpleExample/android/link-assets-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"migIndex": 1,
"data": [
{
"path": "assets/fonts/Merriweather-Regular.ttf",
"sha1": "f4e7810e4e20d1932d3d7994bb6f6456280ee6bd"
},
{
"path": "assets/fonts/WorkSans-Regular.ttf",
"sha1": "89a5d38e1316b70da48e9475628023264af74783"
},
{
"path": "assets/fonts/WorkSans-VariableFont_wght.ttf",
"sha1": "4337ebe379f077e10794f92c7e2358d567698eb4"
}
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions examples/SimpleExample/ios/SimpleExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
6C55674377BC0F74FD15DB1D /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
89991C9D5CA142698A361BFC /* WorkSans-VariableFont_wght.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D87004600AA4F63A87843F9 /* WorkSans-VariableFont_wght.ttf */; };
B209F12DD5234CC780CEF867 /* WorkSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6019927FEB784F9D9FF97A00 /* WorkSans-Regular.ttf */; };
FDC5E126412D47D8B868282A /* Merriweather-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D43CB6966E0A4FEC98BC8633 /* Merriweather-Regular.ttf */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -20,10 +23,13 @@
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SimpleExample/Info.plist; sourceTree = "<group>"; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = SimpleExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
3B4392A12AC88292D35C810B /* Pods-SimpleExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleExample.debug.xcconfig"; path = "Target Support Files/Pods-SimpleExample/Pods-SimpleExample.debug.xcconfig"; sourceTree = "<group>"; };
3D87004600AA4F63A87843F9 /* WorkSans-VariableFont_wght.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "WorkSans-VariableFont_wght.ttf"; path = "../assets/fonts/WorkSans-VariableFont_wght.ttf"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-SimpleExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleExample.release.xcconfig"; path = "Target Support Files/Pods-SimpleExample/Pods-SimpleExample.release.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-SimpleExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SimpleExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6019927FEB784F9D9FF97A00 /* WorkSans-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "WorkSans-Regular.ttf"; path = "../assets/fonts/WorkSans-Regular.ttf"; sourceTree = "<group>"; };
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = SimpleExample/AppDelegate.swift; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = SimpleExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
D43CB6966E0A4FEC98BC8633 /* Merriweather-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "Merriweather-Regular.ttf"; path = "../assets/fonts/Merriweather-Regular.ttf"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -75,6 +81,7 @@
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
BBD78D7AC51CEA395F1C20DB /* Pods */,
FF48CEE1897A45F8A908495E /* Resources */,
);
indentWidth = 2;
sourceTree = "<group>";
Expand All @@ -98,6 +105,17 @@
path = Pods;
sourceTree = "<group>";
};
FF48CEE1897A45F8A908495E /* Resources */ = {
isa = PBXGroup;
children = (
D43CB6966E0A4FEC98BC8633 /* Merriweather-Regular.ttf */,
6019927FEB784F9D9FF97A00 /* WorkSans-Regular.ttf */,
3D87004600AA4F63A87843F9 /* WorkSans-VariableFont_wght.ttf */,
);
name = Resources;
path = "";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -161,6 +179,9 @@
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
6C55674377BC0F74FD15DB1D /* PrivacyInfo.xcprivacy in Resources */,
FDC5E126412D47D8B868282A /* Merriweather-Regular.ttf in Resources */,
B209F12DD5234CC780CEF867 /* WorkSans-Regular.ttf in Resources */,
89991C9D5CA142698A361BFC /* WorkSans-VariableFont_wght.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
8 changes: 7 additions & 1 deletion examples/SimpleExample/ios/SimpleExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<string/>
<key>RCTNewArchEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand All @@ -49,5 +49,11 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIAppFonts</key>
<array>
<string>Merriweather-Regular.ttf</string>
<string>WorkSans-Regular.ttf</string>
<string>WorkSans-VariableFont_wght.ttf</string>
</array>
</dict>
</plist>
17 changes: 17 additions & 0 deletions examples/SimpleExample/ios/link-assets-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"migIndex": 1,
"data": [
{
"path": "assets/fonts/Merriweather-Regular.ttf",
"sha1": "f4e7810e4e20d1932d3d7994bb6f6456280ee6bd"
},
{
"path": "assets/fonts/WorkSans-Regular.ttf",
"sha1": "89a5d38e1316b70da48e9475628023264af74783"
},
{
"path": "assets/fonts/WorkSans-VariableFont_wght.ttf",
"sha1": "4337ebe379f077e10794f92c7e2358d567698eb4"
}
]
}
8 changes: 8 additions & 0 deletions examples/SimpleExample/react-native.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./assets/fonts/'],
};

7 changes: 4 additions & 3 deletions src/language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ const getPreferredLanguage = (
): Language => {
const deviceLanguageWithRegion =
Platform.OS === 'ios'
? NativeModules.SettingsManager.settings.AppleLocale ??
NativeModules.SettingsManager.settings.AppleLanguages[0] // iOS 13
: NativeModules.I18nManager.localeIdentifier;
? NativeModules.SettingsManager?.settings?.AppleLocale ??
NativeModules.SettingsManager?.settings?.AppleLanguages?.[0] ?? // iOS 13
'en-US'
: NativeModules.I18nManager?.localeIdentifier ?? 'en-US';
const deviceLanguage = deviceLanguageWithRegion.substring(0, 2);

const userTraitLanguage = userTraits?.language as Language;
Expand Down