Skip to content

Commit c6089ce

Browse files
committed
refactor: deviceLanguage function renamed by getDeviceLanguage
1 parent f453f4d commit c6089ce

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,26 @@ import { numberFormat } from "@freakycoder/react-native-helpers";
102102
103103
## DeviceInfo Props
104104
105-
| Property | Type | Description |
106-
|-----------------|:-------:|----------------------------------------------------------------------------------------------------------------------------|
107-
| isIOS | boolean | returns if it is an iOS device or not |
108-
| isAndroid | boolean | returns if it is an Android device or not |
109-
| ScreenWidth | number | get the device's screen width |
110-
| ScreenHeight | number | get the device's screen height |
111-
| ScreenScale | number | get the device's screen scale ratio |
112-
| ScreenFontScale | number | get the device's screen font scale ratio (depends on the user's device font scale setting) |
113-
| WindowWidth | number | get the device's window width |
114-
| WindowHeight | number | get the device's window height |
115-
| WindowScale | number | get the device's window scale ratio |
116-
| WindowFontScale | number | get the device's window font scale ratio (depends on the user's device font scale setting) |
117-
| PlatformVersion | number | returns the platform version |
118-
| ScreenMin | number | get the device's screen width/height which are **minimum** depend on the landscape or portrait mode |
119-
| ScreenMax | number | get the device's screen width/height which are **maximum** depend on the landscape or portrait mode |
120-
| vh | number | get the device's height but as a **viewport unit** |
121-
| vw | number | get the device's width but as a **viewport unit** |
122-
| vmin | number | get the device's screen width/height as a **viewport unit** which are **minimum** depend on the landscape or portrait mode |
123-
| vmax | number | get the device's screen width/height as a **viewport unit** which are **maximum** depend on the landscape or portrait mode |
124-
| deviceLanguage | string | get the device's language (en_US) |
105+
| Property | Type | Description |
106+
|-------------------|:-------:|----------------------------------------------------------------------------------------------------------------------------|
107+
| isIOS | boolean | returns if it is an iOS device or not |
108+
| isAndroid | boolean | returns if it is an Android device or not |
109+
| ScreenWidth | number | get the device's screen width |
110+
| ScreenHeight | number | get the device's screen height |
111+
| ScreenScale | number | get the device's screen scale ratio |
112+
| ScreenFontScale | number | get the device's screen font scale ratio (depends on the user's device font scale setting) |
113+
| WindowWidth | number | get the device's window width |
114+
| WindowHeight | number | get the device's window height |
115+
| WindowScale | number | get the device's window scale ratio |
116+
| WindowFontScale | number | get the device's window font scale ratio (depends on the user's device font scale setting) |
117+
| PlatformVersion | number | returns the platform version |
118+
| ScreenMin | number | get the device's screen width/height which are **minimum** depend on the landscape or portrait mode |
119+
| ScreenMax | number | get the device's screen width/height which are **maximum** depend on the landscape or portrait mode |
120+
| vh | number | get the device's height but as a **viewport unit** |
121+
| vw | number | get the device's width but as a **viewport unit** |
122+
| vmin | number | get the device's screen width/height as a **viewport unit** which are **minimum** depend on the landscape or portrait mode |
123+
| vmax | number | get the device's screen width/height as a **viewport unit** which are **maximum** depend on the landscape or portrait mode |
124+
| getDeviceLanguage | string | get the device's language (en_US) |
125125
126126
## DeviceInfo Props
127127

lib/helpers/device/DeviceInfo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Platform, Dimensions, NativeModules } from "react-native";
22

33
// i.e: en_US
4-
const deviceLanguage =
4+
const getDeviceLanguage =
55
Platform.OS === "ios"
66
? NativeModules.SettingsManager.settings.AppleLocale ||
77
NativeModules.SettingsManager.settings.AppleLanguages[0] //iOS 13
@@ -57,5 +57,5 @@ export {
5757
WindowScale,
5858
WindowFontScale,
5959
PlatformVersion,
60-
deviceLanguage,
60+
getDeviceLanguage,
6161
};

lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
WindowScale,
1717
WindowFontScale,
1818
PlatformVersion,
19-
deviceLanguage,
19+
getDeviceLanguage,
2020
} from "./helpers/device/DeviceInfo";
2121

2222
import {
@@ -47,7 +47,7 @@ export {
4747
WindowScale,
4848
WindowFontScale,
4949
PlatformVersion,
50-
deviceLanguage,
50+
getDeviceLanguage,
5151
getStatusBarHeight,
5252
hasNotch,
5353
hasNotchOnly,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@freakycoder/react-native-helpers",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "All helpers in one; iPhone series support, dimensions helper, hasNotch helper, normalize text helper and text helpers for React Native with very easy use",
55
"keywords": [
66
"ios",

0 commit comments

Comments
 (0)