diff --git a/app/(auth)/_layout.tsx b/app/(auth)/_layout.tsx index f038d7f..a7f5560 100644 --- a/app/(auth)/_layout.tsx +++ b/app/(auth)/_layout.tsx @@ -1,6 +1,5 @@ import { Stack } from 'expo-router' -import Locales from '@/lib/locales' import { StackHeader } from '@/lib/ui' const Layout = () => ( @@ -10,8 +9,8 @@ const Layout = () => ( header: (props) => , }} > - - + + ) diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index 760dd58..295de0b 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -3,7 +3,6 @@ import { Tabs, router } from 'expo-router' import React from 'react' import { Appbar, Menu, Tooltip } from 'react-native-paper' -import Locales from '@/lib/locales' import { TabBar, TabsHeader } from '@/lib/ui' const TabLayout = () => { @@ -20,10 +19,10 @@ const TabLayout = () => { ( <> - + router.push('/search')} @@ -34,7 +33,7 @@ const TabLayout = () => { visible={visible} onDismiss={() => setVisible(false)} anchor={ - + setVisible(true)} @@ -43,17 +42,17 @@ const TabLayout = () => { } > router.push('/(tabs)/settings')} /> router.push('/modal')} /> router.push('/drawer')} /> @@ -72,16 +71,16 @@ const TabLayout = () => { ( <> - + router.push('/search')} /> - + router.push('/(tabs)/settings')} @@ -101,9 +100,9 @@ const TabLayout = () => { ( - + router.push('/drawer')} @@ -122,5 +121,4 @@ const TabLayout = () => { ) } - export default TabLayout diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 74042d9..83a1a9e 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -1,12 +1,11 @@ import React from 'react' import { Surface } from 'react-native-paper' -import Locales from '@/lib/locales' import { ScreenInfo, styles } from '@/lib/ui' const TabsHome = () => ( - + ) diff --git a/app/(tabs)/profile.tsx b/app/(tabs)/profile.tsx index bf89a9d..5bf2ee4 100644 --- a/app/(tabs)/profile.tsx +++ b/app/(tabs)/profile.tsx @@ -2,12 +2,11 @@ import { router } from 'expo-router' import React from 'react' import { Button, Surface } from 'react-native-paper' -import Locales from '@/lib/locales' import { ScreenInfo, styles } from '@/lib/ui' const Profile = () => ( - + { const colorScheme = useColorScheme() @@ -22,12 +20,10 @@ const Settings = () => { const [message, setMessage] = React.useState({ visible: false, content: '' }) const [settings, setSettings] = React.useState({ color: 'default', - language: 'auto', theme: 'auto', }) const [display, setDisplay] = React.useState({ color: false, - language: false, theme: false, }) @@ -65,61 +61,12 @@ const Settings = () => { } > } - right={(props) => ( - - setDisplay({ ...display, language: false }) - } - anchor={ - - setDisplay({ ...display, language: true }) - } - /> - } - > - { - setSettings({ ...settings, language: 'auto' }) - setDisplay({ ...display, language: false }) - }} - /> - {Object.entries(Languages).map((lang) => ( - { - setSettings({ - ...settings, - language: lang[0] as Language, - }) - setDisplay({ ...display, language: false }) - }} - /> - ))} - - )} - /> - ( { } > { }} /> { }} /> { )} /> ( { { setSettings({ ...settings, @@ -263,10 +210,7 @@ const Settings = () => { )} - + ( - + - {Locales.t('titleNotFound')} + Not Found - {Locales.t('screen404')} + + The screen you are looking for does not exist. + - {Locales.t('goHome')} + Go Home ) diff --git a/app/_layout.tsx b/app/_layout.tsx index 099ad9d..fe335f5 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -4,14 +4,12 @@ import { JetBrainsMono_400Regular, } from '@expo-google-fonts/jetbrains-mono' import { NotoSans_400Regular } from '@expo-google-fonts/noto-sans' -import * as Localization from 'expo-localization' import { SplashScreen, Stack } from 'expo-router' import * as SecureStore from 'expo-secure-store' import React from 'react' import { Platform, useColorScheme } from 'react-native' import { PaperProvider } from 'react-native-paper' -import Locales from '@/lib/locales' import { Setting } from '@/lib/types' import { StackHeader, Themes } from '@/lib/ui' @@ -58,7 +56,6 @@ const RootLayoutNav = () => { const [settings, setSettings] = React.useState({ theme: 'auto', color: 'default', - language: 'auto', }) // Load settings from the device @@ -80,16 +77,6 @@ const RootLayoutNav = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []) - React.useEffect(() => { - if (settings.language === 'auto') { - Locales.locale = Localization.getLocales()[0].languageCode ?? 'en' - } else { - Locales.locale = settings.language - } - - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []) - return ( { - + diff --git a/app/drawer/_layout.tsx b/app/drawer/_layout.tsx index 85ee08f..acf76b9 100644 --- a/app/drawer/_layout.tsx +++ b/app/drawer/_layout.tsx @@ -4,7 +4,6 @@ import React from 'react' import { GestureHandlerRootView } from 'react-native-gesture-handler' import { Appbar, Menu, Tooltip, useTheme } from 'react-native-paper' -import Locales from '@/lib/locales' import { DrawerContent, DrawerHeader } from '@/lib/ui' const DrawerLayout = () => { @@ -35,11 +34,11 @@ const DrawerLayout = () => { ( <> - + router.push('/search')} @@ -50,7 +49,7 @@ const DrawerLayout = () => { visible={visible} onDismiss={() => setVisible(false)} anchor={ - + setVisible(true)} @@ -59,17 +58,17 @@ const DrawerLayout = () => { } > router.push('/drawer/settings')} /> router.push('/modal')} /> router.push('/drawer')} /> @@ -81,17 +80,17 @@ const DrawerLayout = () => { ( <> - + router.push('/search')} /> - + router.push('/(tabs)/settings')} @@ -104,10 +103,10 @@ const DrawerLayout = () => { ( - + router.push('/modal')} diff --git a/app/drawer/index.tsx b/app/drawer/index.tsx index eb5ef99..539479a 100644 --- a/app/drawer/index.tsx +++ b/app/drawer/index.tsx @@ -1,12 +1,11 @@ import React from 'react' import { Surface } from 'react-native-paper' -import Locales from '@/lib/locales' import { ScreenInfo, styles } from '@/lib/ui' const DrawerHome = () => ( - + ) diff --git a/app/drawer/profile.tsx b/app/drawer/profile.tsx index bf89a9d..5bf2ee4 100644 --- a/app/drawer/profile.tsx +++ b/app/drawer/profile.tsx @@ -2,12 +2,11 @@ import { router } from 'expo-router' import React from 'react' import { Button, Surface } from 'react-native-paper' -import Locales from '@/lib/locales' import { ScreenInfo, styles } from '@/lib/ui' const Profile = () => ( - + { const colorScheme = useColorScheme() @@ -22,12 +20,10 @@ const Settings = () => { const [message, setMessage] = React.useState({ visible: false, content: '' }) const [settings, setSettings] = React.useState({ color: 'default', - language: 'auto', theme: 'auto', }) const [display, setDisplay] = React.useState({ color: false, - language: false, theme: false, }) @@ -65,61 +61,12 @@ const Settings = () => { } > } - right={(props) => ( - - setDisplay({ ...display, language: false }) - } - anchor={ - - setDisplay({ ...display, language: true }) - } - /> - } - > - { - setSettings({ ...settings, language: 'auto' }) - setDisplay({ ...display, language: false }) - }} - /> - {Object.entries(Languages).map((lang) => ( - { - setSettings({ - ...settings, - language: lang[0] as Language, - }) - setDisplay({ ...display, language: false }) - }} - /> - ))} - - )} - /> - ( { } > { }} /> { }} /> { )} /> ( { { setSettings({ ...settings, @@ -263,10 +210,7 @@ const Settings = () => { )} - + ( - + {/* Use a light status bar on iOS to account for the black space above the modal */} diff --git a/app/search.tsx b/app/search.tsx index aa337dc..782ee1d 100644 --- a/app/search.tsx +++ b/app/search.tsx @@ -1,7 +1,6 @@ import React from 'react' import { Searchbar, Surface } from 'react-native-paper' -import Locales from '@/lib/locales' import { ScreenInfo, styles } from '@/lib/ui' const Search = () => { @@ -30,7 +29,7 @@ const Search = () => { /> - + ) diff --git a/bun.lockb b/bun.lockb index ddf73ba..356344a 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/lib/locales/ar.ts b/lib/locales/ar.ts deleted file mode 100644 index 61e550f..0000000 --- a/lib/locales/ar.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Arabic Translations - */ - -const Arabic = { - login: 'تسجيل الدخول', - signup: 'إنشاء حساب', - profile: 'الملف الشخصي', - options: 'الخيارات', - search: 'البحث', - stackNav: 'التنقل المكدس', - drawerNav: 'التنقل الدرج', - appearance: 'المظهر', - language: 'اللغة', - changeLanguage: 'تغيير لغة التطبيق', - system: 'النظام', - mode: 'الوضع', - changeMode: 'التبديل بين الوضع الفاتح والوضع الداكن', - lightMode: 'فاتح', - darkMode: 'داكن', - color: 'اللون', - changeColor: 'تغيير لون السمة', - changeScreenCode: - 'قم بتغيير أي نص، احفظ الملف، وسيتم تحديث التطبيق الخاص بك تلقائيًا', - goHome: 'الذهاب إلى الشاشة الرئيسية', - openScreenCode: 'افتح الكود لهذه الشاشة', - save: 'حفظ', - screen404: 'هذه الشاشة غير موجودة', - titleHome: 'الرئيسية', - titleModal: 'مشروط', - titleNotFound: 'لم يتم العثور', - titleSettings: 'الإعدادات', - restartApp: 'أعد تشغيل التطبيق لتطبيق التغييرات', - notAvailable: 'Expo SecureStore غير متوفر للويب', - adaptive: 'تلقائي', - default: 'افتراضي', - orange: 'برتقالي', - red: 'أحمر', - violet: 'بنفسجي', - indigo: 'أزرق داكن', - blue: 'أزرق', - teal: 'أزرق فاتح', - cyan: 'سماوي', - green: 'أخضر', - lime: 'ليموني', - olive: 'زيتوني', - brown: 'بني', -} - -export default Arabic diff --git a/lib/locales/en.ts b/lib/locales/en.ts deleted file mode 100644 index 9c4e660..0000000 --- a/lib/locales/en.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * English Translations - */ - -const English = { - login: 'Log in', - signup: 'Sign up', - profile: 'Profile', - options: 'Options', - search: 'Search', - stackNav: 'Stack Navigation', - drawerNav: 'Drawer Navigation', - appearance: 'Appearance', - language: 'Language', - changeLanguage: "Change app's language", - system: 'System', - mode: 'Mode', - changeMode: 'Switch between light and dark mode', - lightMode: 'Light', - darkMode: 'Dark', - color: 'Color', - changeColor: 'Change theme color', - changeScreenCode: - 'Change any of the text, save the file, and your app will automatically update', - goHome: 'Go to home screen', - openScreenCode: 'Open up the code for this screen', - save: 'Save', - screen404: "This screen doesn't exist", - titleHome: 'Home', - titleModal: 'Modal', - titleNotFound: 'Not Found', - titleSettings: 'Settings', - restartApp: 'Restart the app to apply changes', - notAvailable: 'Expo SecureStore is not available for web', - adaptive: 'adaptive', - default: 'default', - orange: 'orange', - red: 'red', - violet: 'violet', - indigo: 'indigo', - blue: 'blue', - teal: 'teal', - cyan: 'cyan', - green: 'green', - lime: 'lime', - olive: 'olive', - brown: 'brown', -} - -export default English diff --git a/lib/locales/index.ts b/lib/locales/index.ts deleted file mode 100644 index 8387869..0000000 --- a/lib/locales/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Locales - */ - -import { I18n } from 'i18n-js' - -import Arabic from '@/lib/locales/ar' -import English from '@/lib/locales/en' -import Turkish from '@/lib/locales/tr' - -const Locales = new I18n({ - ar: Arabic, - en: English, - tr: Turkish, -}) - -Locales.enableFallback = true - -export default Locales diff --git a/lib/locales/tr.ts b/lib/locales/tr.ts deleted file mode 100644 index af9601f..0000000 --- a/lib/locales/tr.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Turkish Translations - */ - -const Turkish = { - login: 'Giriş', - signup: 'Hesap aç', - profile: 'Profil', - search: 'Ara', - drawerNav: 'Çekmece Navigasyon', - appearance: 'Görünüm', - language: 'Dil', - changeLanguage: 'Uygulamanın dilini değiştir', - system: 'Sistem', - mode: 'Mod', - changeMode: 'Aydınlık ve karanlık mod arasında geçiş yap', - lightMode: 'Aydınlık', - darkMode: 'Karanlık', - color: 'Renk', - changeColor: 'Tema rengini değiştir', - changeScreenCode: - 'Herhangi bir metni değiştirin, dosyayı kaydedin ve uygulamanız otomatik olarak güncellenecektir', - goHome: 'Ana ekrana git', - openScreenCode: 'Bu ekranın kodunu aç', - save: 'Kaydet', - screen404: 'Bu ekran mevcut değil', - titleHome: 'Ana Sayfa', - titleModal: 'Modal', - titleNotFound: 'Bulunamadı', - titleSettings: 'Ayarlar', - restartApp: 'Değişiklikleri uygulamak için uygulamayı yeniden başlatın', - notAvailable: 'Expo SecureStore web için kullanılabilir değil', - adaptive: 'adaptive', - default: 'varsayılan', - orange: 'turuncu', - red: 'kırmızı', - violet: 'mor', - indigo: 'lacivert', - blue: 'mavi', - teal: 'turkuaz', - cyan: 'gökyüzü mavi', - green: 'yeşil', - lime: 'limon yeşili', - olive: 'zeytin yeşili', - brown: 'kahverengi', -} - -export default Turkish diff --git a/lib/types/Language.ts b/lib/types/Language.ts deleted file mode 100644 index cb4f6d8..0000000 --- a/lib/types/Language.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Languages } from '@/lib/utils' - -type Language = keyof typeof Languages - -export default Language diff --git a/lib/types/Setting.ts b/lib/types/Setting.ts index 05332f8..da9a628 100644 --- a/lib/types/Setting.ts +++ b/lib/types/Setting.ts @@ -1,9 +1,8 @@ -import { Color, Language } from '@/lib/types' +import { Color } from '@/lib/types' type Setting = { color: Color theme: 'light' | 'dark' | 'auto' - language: Language | 'auto' } export default Setting diff --git a/lib/types/index.ts b/lib/types/index.ts index facd084..c2e66f9 100644 --- a/lib/types/index.ts +++ b/lib/types/index.ts @@ -3,7 +3,6 @@ */ import Color from '@/lib/types/Color' -import Language from '@/lib/types/Language' import Setting from '@/lib/types/Setting' -export type { Color, Language, Setting } +export type { Color, Setting } diff --git a/lib/ui/components/DrawerContent.tsx b/lib/ui/components/DrawerContent.tsx index ca95b6d..f3639dd 100644 --- a/lib/ui/components/DrawerContent.tsx +++ b/lib/ui/components/DrawerContent.tsx @@ -3,8 +3,6 @@ import { router } from 'expo-router' import React from 'react' import { Drawer, DrawerSectionProps } from 'react-native-paper' -import Locales from '@/lib/locales' - interface DrawerContentProps extends DrawerSectionProps { navProps: DrawerContentComponentProps } @@ -12,24 +10,24 @@ interface DrawerContentProps extends DrawerSectionProps { const DrawerContent = (props: DrawerContentProps) => ( router.replace('/')} /> router.push('/drawer')} /> router.push('/drawer/profile')} /> router.push('/drawer/settings')} diff --git a/lib/ui/components/ScreenInfo.tsx b/lib/ui/components/ScreenInfo.tsx index f8690c8..ff6cba5 100644 --- a/lib/ui/components/ScreenInfo.tsx +++ b/lib/ui/components/ScreenInfo.tsx @@ -1,6 +1,5 @@ import { Chip, Text } from 'react-native-paper' -import Locales from '@/lib/locales' import GradientBackground from '@/lib/ui/components/GradientBackground' const ScreenInfo = (props: { title: string; path: string }) => ( @@ -9,14 +8,14 @@ const ScreenInfo = (props: { title: string; path: string }) => ( {props.title} - {Locales.t('openScreenCode')} + Open the screen code to edit it. {props.path} - {Locales.t('changeScreenCode')} + Change the screen code to see updates. ) diff --git a/lib/utils/index.ts b/lib/utils/index.ts deleted file mode 100644 index 5f11243..0000000 --- a/lib/utils/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Utilities - */ - -import Languages from '@/lib/utils/languages' - -export { Languages } diff --git a/lib/utils/languages.ts b/lib/utils/languages.ts deleted file mode 100644 index 2017a74..0000000 --- a/lib/utils/languages.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Available languages - */ - -const Languages = { - ar: { - name: 'Arabic', - nativeName: 'العربية', - }, - en: { - name: 'English', - nativeName: 'English', - }, - tr: { - name: 'Turkish', - nativeName: 'Türkçe', - }, -} - -export default Languages diff --git a/package.json b/package.json index 4308858..3402ddc 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@shopify/react-native-skia": "1.2.3", "expo": "~51.0.31", "expo-font": "~12.0.5", + "expo-image": "~1.13.0", "expo-linking": "~6.3.1", "expo-localization": "~15.0.3", "expo-router": "~3.5.23", @@ -45,8 +46,7 @@ "react-native-safe-area-context": "4.10.5", "react-native-screens": "3.31.1", "react-native-web": "~0.19.6", - "yup": "^1.4.0", - "expo-image": "~1.12.15" + "yup": "^1.4.0" }, "devDependencies": { "@babel/core": "^7.20.0",