Update Popup Screen Localization Patch

This commit is contained in:
cyberalby2 2026-03-06 23:24:27 +01:00
parent 8677939111
commit 70be0cf8f2
3 changed files with 389 additions and 350 deletions

View file

@ -13,6 +13,7 @@ import { useTheme } from '../contexts/ThemeContext';
import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useSafeAreaInsets } from 'react-native-safe-area-context';
import * as Haptics from 'expo-haptics'; import * as Haptics from 'expo-haptics';
import AndroidUpdatePopup from './AndroidUpdatePopup'; import AndroidUpdatePopup from './AndroidUpdatePopup';
import { t } from 'i18next';
const { width, height } = Dimensions.get('window'); const { width, height } = Dimensions.get('window');
@ -87,41 +88,46 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
animationType="fade" animationType="fade"
statusBarTranslucent={true} statusBarTranslucent={true}
presentationStyle="overFullScreen" presentationStyle="overFullScreen"
supportedOrientations={['portrait', 'landscape', 'landscape-left', 'landscape-right']} supportedOrientations={[
'portrait',
'landscape',
'landscape-left',
'landscape-right',
]}
> >
<View style={styles.overlay}> <View style={styles.overlay}>
<View style={[ <View
style={[
styles.popup, styles.popup,
{ {
backgroundColor: currentTheme.colors.darkBackground || '#1a1a1a', backgroundColor: currentTheme.colors.darkBackground || '#1a1a1a',
borderColor: currentTheme.colors.elevation2 || '#333333', borderColor: currentTheme.colors.elevation2 || '#333333',
marginTop: insets.top + 20, marginTop: insets.top + 20,
marginBottom: insets.bottom + 20, marginBottom: insets.bottom + 20,
} },
]}> ]}
>
{/* Header */} {/* Header */}
<View style={styles.header}> <View style={styles.header}>
<View style={[ <View
style={[
styles.iconContainer, styles.iconContainer,
{ backgroundColor: `${currentTheme.colors.primary}20` } { backgroundColor: `${currentTheme.colors.primary}20` },
]}> ]}
>
<MaterialIcons <MaterialIcons
name="system-update" name="system-update"
size={32} size={32}
color={currentTheme.colors.primary} color={currentTheme.colors.primary}
/> />
</View> </View>
<Text style={[ <Text style={[styles.title, { color: currentTheme.colors.highEmphasis }]}>
styles.title, {t('update_popup.update_available')}
{ color: currentTheme.colors.highEmphasis }
]}>
Update Available
</Text> </Text>
<Text style={[ <Text
styles.subtitle, style={[styles.subtitle, { color: currentTheme.colors.mediumEmphasis }]}
{ color: currentTheme.colors.mediumEmphasis } >
]}> {t('update_popup.new_version')}
A new version of Nuvio is ready to install
</Text> </Text>
</View> </View>
@ -133,17 +139,16 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
size={16} size={16}
color={currentTheme.colors.primary} color={currentTheme.colors.primary}
/> />
<Text style={[
styles.infoLabel,
{ color: currentTheme.colors.mediumEmphasis }
]}>
Version:
</Text>
<Text <Text
style={[ style={[
styles.infoValue, styles.infoLabel,
{ color: currentTheme.colors.highEmphasis } { color: currentTheme.colors.mediumEmphasis },
]} ]}
>
{t('update_popup.version')}
</Text>
<Text
style={[styles.infoValue, { color: currentTheme.colors.highEmphasis }]}
numberOfLines={3} numberOfLines={3}
ellipsizeMode="tail" ellipsizeMode="tail"
selectable selectable
@ -154,10 +159,12 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
{!!getReleaseNotes() && ( {!!getReleaseNotes() && (
<View style={styles.descriptionContainer}> <View style={styles.descriptionContainer}>
<Text style={[ <Text
style={[
styles.description, styles.description,
{ color: currentTheme.colors.mediumEmphasis } { color: currentTheme.colors.mediumEmphasis },
]}> ]}
>
{getReleaseNotes()} {getReleaseNotes()}
</Text> </Text>
</View> </View>
@ -171,7 +178,7 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
styles.button, styles.button,
styles.primaryButton, styles.primaryButton,
{ backgroundColor: currentTheme.colors.primary }, { backgroundColor: currentTheme.colors.primary },
isInstalling && styles.disabledButton isInstalling && styles.disabledButton,
]} ]}
onPress={handleUpdateNow} onPress={handleUpdateNow}
disabled={isInstalling} disabled={isInstalling}
@ -180,12 +187,12 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
{isInstalling ? ( {isInstalling ? (
<> <>
<MaterialIcons name="install-mobile" size={18} color="white" /> <MaterialIcons name="install-mobile" size={18} color="white" />
<Text style={styles.buttonText}>Installing...</Text> <Text style={styles.buttonText}>{t('update_popup.installing')}</Text>
</> </>
) : ( ) : (
<> <>
<MaterialIcons name="download" size={18} color="white" /> <MaterialIcons name="download" size={18} color="white" />
<Text style={styles.buttonText}>Update Now</Text> <Text style={styles.buttonText}>{t('update_popup.update_now')}</Text>
</> </>
)} )}
</TouchableOpacity> </TouchableOpacity>
@ -198,17 +205,19 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
{ {
backgroundColor: currentTheme.colors.darkBackground || '#2a2a2a', backgroundColor: currentTheme.colors.darkBackground || '#2a2a2a',
borderColor: currentTheme.colors.elevation3 || '#444444', borderColor: currentTheme.colors.elevation3 || '#444444',
} },
]} ]}
onPress={handleUpdateLater} onPress={handleUpdateLater}
disabled={isInstalling} disabled={isInstalling}
activeOpacity={0.7} activeOpacity={0.7}
> >
<Text style={[ <Text
style={[
styles.secondaryButtonText, styles.secondaryButtonText,
{ color: currentTheme.colors.mediumEmphasis } { color: currentTheme.colors.mediumEmphasis },
]}> ]}
Later >
{t('update_popup.later')}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
@ -219,17 +228,19 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
{ {
backgroundColor: currentTheme.colors.darkBackground || '#2a2a2a', backgroundColor: currentTheme.colors.darkBackground || '#2a2a2a',
borderColor: currentTheme.colors.elevation3 || '#444444', borderColor: currentTheme.colors.elevation3 || '#444444',
} },
]} ]}
onPress={handleDismiss} onPress={handleDismiss}
disabled={isInstalling} disabled={isInstalling}
activeOpacity={0.7} activeOpacity={0.7}
> >
<Text style={[ <Text
style={[
styles.secondaryButtonText, styles.secondaryButtonText,
{ color: currentTheme.colors.mediumEmphasis } { color: currentTheme.colors.mediumEmphasis },
]}> ]}
Dismiss >
{t('update_popup.dismiss')}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
@ -253,12 +264,14 @@ const styles = StyleSheet.create({
borderRadius: 20, borderRadius: 20,
borderWidth: 1, borderWidth: 1,
backgroundColor: '#1a1a1a', // Solid background - not transparent backgroundColor: '#1a1a1a', // Solid background - not transparent
...(Platform.OS === 'ios' ? { ...(Platform.OS === 'ios'
? {
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { width: 0, height: 10 }, shadowOffset: { width: 0, height: 10 },
shadowOpacity: 0.5, shadowOpacity: 0.5,
shadowRadius: 20, shadowRadius: 20,
} : { }
: {
elevation: 15, elevation: 15,
}), }),
overflow: 'hidden', overflow: 'hidden',
@ -337,12 +350,14 @@ const styles = StyleSheet.create({
marginBottom: 12, marginBottom: 12,
}, },
primaryButton: { primaryButton: {
...(Platform.OS === 'ios' ? { ...(Platform.OS === 'ios'
? {
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { width: 0, height: 4 }, shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.2, shadowOpacity: 0.2,
shadowRadius: 8, shadowRadius: 8,
} : { }
: {
elevation: 4, elevation: 4,
}), }),
}, },

View file

@ -1549,5 +1549,20 @@
"moderate": "moderate", "moderate": "moderate",
"mild": "mild", "mild": "mild",
"none": "none" "none": "none"
},
"skip_intro_button": {
"skip": "Skip",
"skip_intro": "Skip Intro",
"skip_ending": "Skip Ending",
"skip_recap": "Skip Recap"
},
"update_popup": {
"update_available": "Update Available",
"new_version": "A new version of Nuvio is ready to install",
"version": "Version:",
"update_now": "Update Now",
"installing": "Installing...",
"later": "Later",
"dismiss": "Dismiss"
} }
} }

View file

@ -1555,5 +1555,14 @@
"skip_intro": "Salta Inizio", "skip_intro": "Salta Inizio",
"skip_ending": "Salta Fine", "skip_ending": "Salta Fine",
"skip_recap": "Salta Riassunto" "skip_recap": "Salta Riassunto"
},
"update_popup": {
"update_available": "Aggiornamento Disponibile",
"new_version": "Una nuova versione di Nuvio è pronta per esser installata",
"version": "Versione:",
"update_now": "Aggiorna Ora",
"installing": "Installazione...",
"later": "Dopo",
"dismiss": "Ignora"
} }
} }