Skip to content

Commit

Permalink
refactor: deviceLanguage function renamed by getDeviceLanguage
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathChaos committed Sep 9, 2023
1 parent f453f4d commit c6089ce
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,26 @@ import { numberFormat } from "@freakycoder/react-native-helpers";
## DeviceInfo Props
| Property | Type | Description |
|-----------------|:-------:|----------------------------------------------------------------------------------------------------------------------------|
| isIOS | boolean | returns if it is an iOS device or not |
| isAndroid | boolean | returns if it is an Android device or not |
| ScreenWidth | number | get the device's screen width |
| ScreenHeight | number | get the device's screen height |
| ScreenScale | number | get the device's screen scale ratio |
| ScreenFontScale | number | get the device's screen font scale ratio (depends on the user's device font scale setting) |
| WindowWidth | number | get the device's window width |
| WindowHeight | number | get the device's window height |
| WindowScale | number | get the device's window scale ratio |
| WindowFontScale | number | get the device's window font scale ratio (depends on the user's device font scale setting) |
| PlatformVersion | number | returns the platform version |
| ScreenMin | number | get the device's screen width/height which are **minimum** depend on the landscape or portrait mode |
| ScreenMax | number | get the device's screen width/height which are **maximum** depend on the landscape or portrait mode |
| vh | number | get the device's height but as a **viewport unit** |
| vw | number | get the device's width but as a **viewport unit** |
| vmin | number | get the device's screen width/height as a **viewport unit** which are **minimum** depend on the landscape or portrait mode |
| vmax | number | get the device's screen width/height as a **viewport unit** which are **maximum** depend on the landscape or portrait mode |
| deviceLanguage | string | get the device's language (en_US) |
| Property | Type | Description |
|-------------------|:-------:|----------------------------------------------------------------------------------------------------------------------------|
| isIOS | boolean | returns if it is an iOS device or not |
| isAndroid | boolean | returns if it is an Android device or not |
| ScreenWidth | number | get the device's screen width |
| ScreenHeight | number | get the device's screen height |
| ScreenScale | number | get the device's screen scale ratio |
| ScreenFontScale | number | get the device's screen font scale ratio (depends on the user's device font scale setting) |
| WindowWidth | number | get the device's window width |
| WindowHeight | number | get the device's window height |
| WindowScale | number | get the device's window scale ratio |
| WindowFontScale | number | get the device's window font scale ratio (depends on the user's device font scale setting) |
| PlatformVersion | number | returns the platform version |
| ScreenMin | number | get the device's screen width/height which are **minimum** depend on the landscape or portrait mode |
| ScreenMax | number | get the device's screen width/height which are **maximum** depend on the landscape or portrait mode |
| vh | number | get the device's height but as a **viewport unit** |
| vw | number | get the device's width but as a **viewport unit** |
| vmin | number | get the device's screen width/height as a **viewport unit** which are **minimum** depend on the landscape or portrait mode |
| vmax | number | get the device's screen width/height as a **viewport unit** which are **maximum** depend on the landscape or portrait mode |
| getDeviceLanguage | string | get the device's language (en_US) |
## DeviceInfo Props
Expand Down
4 changes: 2 additions & 2 deletions lib/helpers/device/DeviceInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Platform, Dimensions, NativeModules } from "react-native";

// i.e: en_US
const deviceLanguage =
const getDeviceLanguage =
Platform.OS === "ios"
? NativeModules.SettingsManager.settings.AppleLocale ||
NativeModules.SettingsManager.settings.AppleLanguages[0] //iOS 13
Expand Down Expand Up @@ -57,5 +57,5 @@ export {
WindowScale,
WindowFontScale,
PlatformVersion,
deviceLanguage,
getDeviceLanguage,
};
4 changes: 2 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
WindowScale,
WindowFontScale,
PlatformVersion,
deviceLanguage,
getDeviceLanguage,
} from "./helpers/device/DeviceInfo";

import {
Expand Down Expand Up @@ -47,7 +47,7 @@ export {
WindowScale,
WindowFontScale,
PlatformVersion,
deviceLanguage,
getDeviceLanguage,
getStatusBarHeight,
hasNotch,
hasNotchOnly,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@freakycoder/react-native-helpers",
"version": "2.2.0",
"version": "2.2.1",
"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",
"keywords": [
"ios",
Expand Down

0 comments on commit c6089ce

Please sign in to comment.