mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-19 08:22:00 +00:00
Major Update Overlay Localization Support
This commit is contained in:
parent
fd579c2af3
commit
83c69da3e4
3 changed files with 15 additions and 6 deletions
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import { Modal, View, Text, StyleSheet, TouchableOpacity, Linking } from 'react-native';
|
import { Modal, View, Text, StyleSheet, TouchableOpacity, Linking } from 'react-native';
|
||||||
import { MaterialIcons } from '@expo/vector-icons';
|
import { MaterialIcons } from '@expo/vector-icons';
|
||||||
import { useTheme } from '../contexts/ThemeContext';
|
import { useTheme } from '../contexts/ThemeContext';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
|
@ -17,7 +18,7 @@ interface Props {
|
||||||
|
|
||||||
const MajorUpdateOverlay: React.FC<Props> = ({ visible, latestTag, releaseNotes, releaseUrl, onDismiss, onLater, onUpdateAction, isDownloading, downloadProgress }) => {
|
const MajorUpdateOverlay: React.FC<Props> = ({ visible, latestTag, releaseNotes, releaseUrl, onDismiss, onLater, onUpdateAction, isDownloading, downloadProgress }) => {
|
||||||
const { currentTheme } = useTheme();
|
const { currentTheme } = useTheme();
|
||||||
|
const {t} = useTranslation();
|
||||||
if (!visible) return null;
|
if (!visible) return null;
|
||||||
|
|
||||||
const progressPercent = downloadProgress ? Math.round(downloadProgress * 100) : 0;
|
const progressPercent = downloadProgress ? Math.round(downloadProgress * 100) : 0;
|
||||||
|
|
@ -30,9 +31,9 @@ const MajorUpdateOverlay: React.FC<Props> = ({ visible, latestTag, releaseNotes,
|
||||||
<View style={[styles.iconCircle, { backgroundColor: `${currentTheme.colors.primary}22` }]}>
|
<View style={[styles.iconCircle, { backgroundColor: `${currentTheme.colors.primary}22` }]}>
|
||||||
<MaterialIcons name="new-releases" size={28} color={currentTheme.colors.primary} />
|
<MaterialIcons name="new-releases" size={28} color={currentTheme.colors.primary} />
|
||||||
</View>
|
</View>
|
||||||
<Text style={[styles.title, { color: currentTheme.colors.highEmphasis }]}>Major update available</Text>
|
<Text style={[styles.title, { color: currentTheme.colors.highEmphasis }]}>{t('major_update_overlay.major_update_available')}</Text>
|
||||||
{!!latestTag && (
|
{!!latestTag && (
|
||||||
<Text style={[styles.version, { color: currentTheme.colors.mediumEmphasis }]}>Latest: {latestTag}</Text>
|
<Text style={[styles.version, { color: currentTheme.colors.mediumEmphasis }]}>{t('updates.latest')} {latestTag}</Text>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -53,17 +54,17 @@ const MajorUpdateOverlay: React.FC<Props> = ({ visible, latestTag, releaseNotes,
|
||||||
>
|
>
|
||||||
<MaterialIcons name={isDownloading ? "downloading" : "system-update"} size={18} color="#fff" />
|
<MaterialIcons name={isDownloading ? "downloading" : "system-update"} size={18} color="#fff" />
|
||||||
<Text style={styles.primaryText}>
|
<Text style={styles.primaryText}>
|
||||||
{isDownloading ? `Downloading... ${progressPercent}%` : (onUpdateAction ? 'Update Now' : 'View release')}
|
{isDownloading ? `${t('updates.status_downloading')} ${progressPercent}%` : (onUpdateAction ? t('update_popup.update_now') : t('updates.view_release'))}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<View style={styles.secondaryRow}>
|
<View style={styles.secondaryRow}>
|
||||||
<TouchableOpacity style={[styles.secondaryBtn, { borderColor: currentTheme.colors.elevation3 }]} onPress={onLater}>
|
<TouchableOpacity style={[styles.secondaryBtn, { borderColor: currentTheme.colors.elevation3 }]} onPress={onLater}>
|
||||||
<Text style={[styles.secondaryText, { color: currentTheme.colors.mediumEmphasis }]}>Later</Text>
|
<Text style={[styles.secondaryText, { color: currentTheme.colors.mediumEmphasis }]}>{t('update_popup.later')}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity style={[styles.secondaryBtn, { borderColor: currentTheme.colors.elevation3 }]} onPress={onDismiss}>
|
<TouchableOpacity style={[styles.secondaryBtn, { borderColor: currentTheme.colors.elevation3 }]} onPress={onDismiss}>
|
||||||
<Text style={[styles.secondaryText, { color: currentTheme.colors.mediumEmphasis }]}>Dismiss</Text>
|
<Text style={[styles.secondaryText, { color: currentTheme.colors.mediumEmphasis }]}>{t('update_popup.dismiss')}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -1629,5 +1629,9 @@
|
||||||
"api_key_cleared":"API Key Cleared",
|
"api_key_cleared":"API Key Cleared",
|
||||||
"api_key_saved":"API Key Saved",
|
"api_key_saved":"API Key Saved",
|
||||||
"api_key_invalid":"Invalid API Key"
|
"api_key_invalid":"Invalid API Key"
|
||||||
|
},
|
||||||
|
"major_update_overlay":{
|
||||||
|
"major_update_available":"Major update available",
|
||||||
|
"update_now":"Update Now"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1613,5 +1613,9 @@
|
||||||
"api_key_cleared":"Chiave API cancellata",
|
"api_key_cleared":"Chiave API cancellata",
|
||||||
"api_key_saved":"Chiave API Salvata",
|
"api_key_saved":"Chiave API Salvata",
|
||||||
"api_key_invalid":"Chiave API non valida"
|
"api_key_invalid":"Chiave API non valida"
|
||||||
|
},
|
||||||
|
"major_update_overlay":{
|
||||||
|
"major_update_available":"Aggiornamento Importante Disponibile",
|
||||||
|
"update_now":"Aggiorna Ora"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue