784 lines
35 KiB
Dart
Executable File
784 lines
35 KiB
Dart
Executable File
// lib/services/i18n_service.dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
class I18nService extends ChangeNotifier {
|
|
String _language = 'pt';
|
|
|
|
List<Locale> get supportedLocales => const [
|
|
Locale('pt', ''),
|
|
Locale('en', ''),
|
|
];
|
|
|
|
I18nService() {
|
|
_loadLanguageFromPrefs();
|
|
}
|
|
|
|
Locale get locale => Locale(_language);
|
|
|
|
Future<void> _loadLanguageFromPrefs() async {
|
|
final prefs = await SharedPreferences.getInstance();
|
|
final String? savedLanguage = prefs.getString('languageCode');
|
|
if (savedLanguage != null && _resources.containsKey(savedLanguage)) {
|
|
_language = savedLanguage;
|
|
}
|
|
}
|
|
|
|
final Map<String, Map<String, String>> _resources = {
|
|
'pt': {
|
|
"app_name": "KzEduca",
|
|
"slogan": "Aprende. Poupas. Progrides.",
|
|
"login": "Login",
|
|
"register": "Registar",
|
|
"email_placeholder": "Email",
|
|
"password_placeholder": "Palavra-passe",
|
|
"username_placeholder": "Nome de Utilizador",
|
|
"enter": "Entrar",
|
|
"register_button": "Registar",
|
|
"logging_in": "A Entrar...",
|
|
"registering": "A Registar...",
|
|
"forgot_password": "Esqueceu a palavra-passe?",
|
|
"recover": "Recuperar",
|
|
"error_prefix": "Erro:",
|
|
"email_invalid": "Por favor, insira um email válido.",
|
|
"password_weak": "A palavra-passe deve ter pelo menos 6 caracteres.",
|
|
"username_required": "Por favor, insira um nome de utilizador.",
|
|
"email_already_in_use": "Este email já está em uso.",
|
|
"auth_error": "Erro na autenticação inicial.",
|
|
"login_error": "Email ou palavra-passe incorretos.",
|
|
"logout_error": "Erro ao fazer logout.",
|
|
"welcome_message": "Bem-vindo, {{username}}!",
|
|
"dashboard_intro": "Este é o seu KzEduca. Aqui poderá ver o seu progresso, simuladores e desafios.",
|
|
"user_id": "Seu ID de Usuário:",
|
|
"logout": "Sair",
|
|
"saving_out": "Saindo...",
|
|
"savings_simulator": "Simulador de Poupança",
|
|
"financial_challenges": "Desafios Financeiros",
|
|
"quick_lessons": "Aulas Rápidas",
|
|
"financial_quiz": "Quiz Financeiro",
|
|
"back_to_dashboard": "Voltar ao Dashboard",
|
|
"initial_value": "Valor Inicial (Kz)",
|
|
"monthly_deposit": "Depósito Mensal (Kz)",
|
|
"annual_interest_rate": "Taxa de Juros Anual (%)",
|
|
"period_months": "Período (Meses)",
|
|
"simulate_savings": "Simular Poupança",
|
|
"simulating": "A Simular...",
|
|
"fill_all_fields": "Por favor, preencha todos os campos.",
|
|
"simulation_error": "Não foi possível realizar a simulação. Tente novamente mais tarde.",
|
|
"estimated_final_value": "Valor Final Estimado:",
|
|
"calculate_growth": "Calcule o crescimento da sua poupança ao longo do tempo.",
|
|
"participate_challenges": "Participe em desafios divertidos e alcance as suas metas financeiras!",
|
|
"view_all_challenges": "Ver Todos os Desafios",
|
|
"challenge_progress": "{{progress}}% Concluído",
|
|
"learn_concepts": "Aprenda conceitos financeiros de forma rápida e prática.",
|
|
"explore_lessons": "Explorar Aulas",
|
|
"test_knowledge": "Teste os seus conhecimentos e aprenda de forma divertida!",
|
|
"ready_for_challenge": "Pronto para o desafio?",
|
|
"start_quiz": "Começar Quiz",
|
|
"your_score": "Sua pontuação: {{score}} / {{total}}",
|
|
"save_simulation": "Salvar Simulação",
|
|
"saving_simulation": "Salvando...",
|
|
"simulation_saved": "Simulação salva com sucesso!",
|
|
"save_simulation_error": "Erro ao salvar simulação.",
|
|
"no_simulations": "Nenhuma simulação salva ainda.",
|
|
"saved_simulations": "Simulações Salvas",
|
|
"accept_challenge": "Aceitar Desafio",
|
|
"challenge_accepted": "Desafio aceito!",
|
|
"update_progress": "Atualizar Progresso",
|
|
"progress_updated": "Progresso atualizado!",
|
|
"mark_as_complete": "Marcar como Concluída",
|
|
"lesson_completed": "Lição concluída!",
|
|
"view_details": "Ver Detalhes",
|
|
"lesson_details": "Detalhes da Aula",
|
|
"quiz_results": "Resultados do Quiz",
|
|
"quiz_save_error": "Erro ao salvar resultado do quiz.",
|
|
"no_quiz_results": "Nenhum resultado de quiz salvo ainda.",
|
|
"completed_lessons": "Aulas Concluídas",
|
|
"no_completed_lessons": "Nenhuma aula concluída ainda.",
|
|
"my_challenges": "Meus Desafios",
|
|
"no_accepted_challenges": "Nenhum desafio aceito ainda.",
|
|
"challenge_already_accepted": "Você já aceitou este desafio.",
|
|
"challenge_not_found": "Desafio não encontrado.",
|
|
"lesson_not_found": "Aula não encontrada.",
|
|
"question_not_found": "Pergunta não encontrada.",
|
|
"loading": "Carregando",
|
|
"back_to_lessons": "Voltar às Aulas",
|
|
"next_question": "Próxima Questão",
|
|
"view_results": "Ver Resultados",
|
|
"correct": "Correto!",
|
|
"incorrect": "Incorreto.",
|
|
"invalid_progress": "Progresso inválido. Insira um número entre 0 e 100.",
|
|
"invalid_numeric_input": "Por favor, insira valores numéricos válidos e positivos.",
|
|
"auth_operation_not_allowed_email_password": "A autenticação de Email/Palavra-passe não está ativada no Firebase. Por favor, ative-a na consola do Firebase.",
|
|
"auth_operation_not_allowed_anonymous": "A autenticação anónima não está ativada no Firebase. Por favor, ative-a na consola do Firebase.",
|
|
"current_balance": "Saldo Atual",
|
|
"kwanza_symbol": "Kz",
|
|
"settings_title": "Configurações",
|
|
"general_settings": "Geral",
|
|
"language": "Idioma",
|
|
"portuguese_brazil": "Português (Brasil)",
|
|
"english": "Inglês",
|
|
"currency": "Moeda",
|
|
"policies_and_feedback": "Políticas e Feedback",
|
|
"rate_app": "Avaliar Aplicativo",
|
|
"send_feedback": "Enviar Feedback",
|
|
"share_with_friends": "Compartilhar com Amigos",
|
|
"privacy_policy": "Política de Privacidade",
|
|
"transactions_menu_item": "Transação",
|
|
"add_transaction_title": "Adicionar Transação",
|
|
"transaction_type": "Tipo",
|
|
"income": "Receita",
|
|
"expense": "Despesa",
|
|
"amount": "Valor",
|
|
"description": "Descrição",
|
|
"category": "Categoria",
|
|
"date": "Data",
|
|
"save_transaction": "Salvar Transação",
|
|
"transaction_saved_success": "Transação salva com sucesso!",
|
|
"transaction_save_error": "Erro ao salvar transação.",
|
|
"statistics_title": "Estatísticas",
|
|
"total_income": "Total de Receitas",
|
|
"total_expenses": "Total de Despesas",
|
|
"net_balance": "Saldo Líquido",
|
|
"transactions_by_category": "Transações por Categoria",
|
|
"budget_title": "Orçamento",
|
|
"create_new_budget": "Criar Novo Orçamento",
|
|
"no_budgets": "Nenhum orçamento definido ainda.",
|
|
"budget_name": "Nome do Orçamento",
|
|
"budget_amount": "Valor do Orçamento",
|
|
"create_budget": "Criar Orçamento",
|
|
"budget_saved_success": "Orçamento salvo com sucesso!",
|
|
"budget_save_error": "Erro ao salvar orçamento.",
|
|
"savings_calculator_title": "Calculadora de Economia",
|
|
"initial_deposit": "Depósito Inicial",
|
|
"interest_rate": "Taxa de Juros Anual (%)",
|
|
"saving_period": "Período de Poupança",
|
|
"start_date": "Data de Início",
|
|
"calculate": "Calcular",
|
|
"reset_fields": "Redefinir Campos",
|
|
"result": "Resultado",
|
|
"final_amount": "Valor Final",
|
|
"interest_earned": "Juros Ganhos",
|
|
"valid_deposit_interest": "Por favor, insira valores válidos para depósito e taxa de juros.",
|
|
"calculation_history": "Histórico de Cálculos (a ser implementado)",
|
|
"home": "Início",
|
|
"statistics": "Estatísticas",
|
|
"budget": "Orçamento",
|
|
"savings": "Poupança",
|
|
"statistics_menu_item": "Estatísticas",
|
|
"settings_menu_item": "Definição",
|
|
"total_balance": "Saldo Total",
|
|
"budget_progress": "Progresso dos Orçamentos",
|
|
"spent": "Gasto",
|
|
"budgeted": "Orçado",
|
|
"recent_transactions": "Transações Recentes",
|
|
"no_data": "Nenhum dado encontrado para este período",
|
|
"no_data_subtitle": "Comece a registar transações ou crie orçamentos para ver as estatísticas.",
|
|
// Novas chaves adicionadas
|
|
"lesson_duration": "Duração",
|
|
"download_video": "Baixar Vídeo",
|
|
"download_book": "Baixar Livro",
|
|
"read_book_online": "Ler Livro Online",
|
|
"completed": "Concluída",
|
|
"lesson_already_completed": "Lição já concluída",
|
|
"quiz_already_completed": "Quiz já concluído",
|
|
"no_more_questions": "Não há mais perguntas.",
|
|
"finish_quiz": "Terminar Quiz",
|
|
"are_you_sure_finish_quiz": "Tem certeza de que deseja terminar o quiz?",
|
|
"yes": "Sim",
|
|
"no": "Não",
|
|
"question": "Pergunta",
|
|
"of": "de",
|
|
"select_option": "Selecione uma opção",
|
|
"option": "Opção",
|
|
"select_language": "Selecione o Idioma",
|
|
"select_currency": "Selecione a Moeda",
|
|
"language_changed": "Idioma alterado. Reinicie o aplicativo para aplicar as alterações.",
|
|
"currency_changed": "Moeda alterada. Reinicie o aplicativo para aplicar as alterações.",
|
|
"share_message": "Estou usando KzEduca para aprender sobre finanças e gerenciar meu dinheiro. Baixe o aplicativo aqui: https://example.com",
|
|
"rate_message": "Se você gosta do KzEduca, por favor, avalie-nos na loja de aplicativos!",
|
|
"feedback_email_subject": "Feedback do KzEduca",
|
|
"feedback_email_body": "Por favor, escreva seu feedback aqui:\n",
|
|
"privacy_policy_url": "https://example.com/privacy",
|
|
"terms_of_service_url": "https://example.com/terms",
|
|
"History of Calculations": "Histórico de Cálculos",
|
|
"No calculations yet.": "Nenhum cálculo ainda.",
|
|
"calculation_date": "Data do Cálculo",
|
|
"History": "Histórico",
|
|
"change_language": "Alterar idioma",
|
|
"notifications": "Notificações",
|
|
"profile": "Perfil",
|
|
"settings_menu_item": "Definições",
|
|
"home": "Início",
|
|
"transactions_menu_item": "Transação",
|
|
"statistics_menu_item": "Estatísticas",
|
|
"quick_lessons": "Aulas Rápidas",
|
|
"transfer": "Transferir",
|
|
"receive": "Receber",
|
|
"swap": "Trocar",
|
|
"savings": "Poupança",
|
|
"lessons": "Aulas",
|
|
"challenges": "Desafios",
|
|
"quiz": "Quiz",
|
|
//"budget": "Orçamento",
|
|
"Historic": "Histórico",
|
|
//"slogan": "Aprende. Poupas. Progrides.",
|
|
"public_challenges_title": "Título dos Desafios Públicos",
|
|
"challenges_title": "Título dos Desafios",
|
|
"accept_challenge": "Aceitar Desafio",
|
|
"my_challenges": "Meus Desafios",
|
|
"accepted_challenges_title": "Título dos Desafios Aceitos",
|
|
"daily_challenge_new": "Novo Desafio Diário",
|
|
"no_data": "Nenhum dado encontrado para este período",
|
|
"no_data_subtitle": "Comece a registrar transações ou criar orçamentos para ver as estatísticas.",
|
|
"month": "Mês",
|
|
"year": "Ano",
|
|
"income": "Receita",
|
|
"expenses": "Despesas",
|
|
"biggest_expense": "Maior despesa",
|
|
"most_used_category": "Categoria mais usada",
|
|
"avg_expense": "Média de despesa",
|
|
"total_transactions": "Total de transações",
|
|
"balance_evolution": "Evolução do Saldo",
|
|
"expenses_by_category": "Despesas por Categoria",
|
|
"budgets": "Orçamentos",
|
|
"transactions": "Transações",
|
|
"food": "Alimentação",
|
|
"transport": "Transporte",
|
|
"social": "Social",
|
|
"education": "Educação",
|
|
"medical": "Médico",
|
|
"shopping": "Compras",
|
|
"salary": "Salário",
|
|
"invest": "Investimento",
|
|
"business": "Negócios",
|
|
"others": "Outros",
|
|
"unknown": "Desconhecido",
|
|
"budgets_title": "Orçamentos",
|
|
"week": "Semana",
|
|
"month": "Mês",
|
|
"quarter": "Trimestre",
|
|
"year": "Ano",
|
|
"no_budgets_for_period": "Nenhum orçamento para este período.",
|
|
"create_budget_message": "Crie um orçamento e comece a controlar seus gastos!",
|
|
"confirm_deletion": "Confirmar Exclusão",
|
|
"confirm_deletion_message": "Tem certeza que deseja excluir este orçamento?",
|
|
"cancel": "Cancelar",
|
|
"delete": "Excluir",
|
|
"budget_deleted_successfully": "Orçamento excluído com sucesso!",
|
|
"period": "Período",
|
|
"from": "De",
|
|
"to": "a",
|
|
"budgeted": "Orçado",
|
|
"note": "Nota",
|
|
"add_budget_tooltip": "Adicionar Orçamento",
|
|
"food": "Comida",
|
|
"transport": "Transporte",
|
|
"social": "Social",
|
|
"education": "Educação",
|
|
"medical": "Médico",
|
|
"shopping": "Compras",
|
|
"salary": "Salário",
|
|
"invest": "Investir",
|
|
"business": "Negócios",
|
|
"others": "Outros",
|
|
"unknown": "Desconhecido",
|
|
"house": "Casa",
|
|
"utilities": "Utilidades",
|
|
"subscriptions": "Assinaturas",
|
|
"leisure": "Lazer",
|
|
"gym": "Academia",
|
|
"gifts": "Presentes",
|
|
"pets": "Animais",
|
|
"freelance": "Freelance",
|
|
"dividends": "Dividendos",
|
|
"loan": "Empréstimo",
|
|
"refund": "Reembolso",
|
|
"tax": "Imposto",
|
|
"bonus": "Bônus",
|
|
"allowance": "Mesada",
|
|
"profile_update_success": "Perfil atualizado com sucesso!",
|
|
"profile_update_error": "Erro ao atualizar o perfil.",
|
|
"change_profile_picture": "Alterar Foto de Perfil",
|
|
"remove_profile_picture": "Remover Foto de Perfil",
|
|
"take_photo": "Tirar Foto",
|
|
"choose_from_gallery": "Escolher da Galeria",
|
|
"cancel": "Cancelar",
|
|
"profile_updated": "Perfil atualizado",
|
|
"select_image": "Selecionar Imagem",
|
|
"daily": "Diário",
|
|
"weekly": "Semanal",
|
|
"monthly": "Mensal",
|
|
"yearly": "Anual",
|
|
"never": "Nunca",
|
|
"reminders": "Lembretes",
|
|
"set_reminder": "Definir Lembrete",
|
|
"reminder_set_success": "Lembrete definido com sucesso!",
|
|
"reminder_set_error": "Erro ao definir lembrete.",
|
|
"no_reminders": "Nenhum lembrete definido.",
|
|
"delete_reminder": "Excluir Lembrete",
|
|
"reminder_deleted_success": "Lembrete excluído com sucesso!",
|
|
"reminder_deleted_error": "Erro ao excluir lembrete.",
|
|
"select_time": "Selecionar Hora",
|
|
"select_date": "Selecionar Data",
|
|
"time": "Hora",
|
|
"daily_notification": "Notificação Diária",
|
|
"enable_daily_notification": "Ativar Notificação Diária",
|
|
"disable_daily_notification": "Desativar Notificação Diária",
|
|
"notification_time": "Hora da Notificação",
|
|
"notification_enabled": "Notificação ativada",
|
|
"notification_disabled": "Notificação desativada",
|
|
"notification_time_set": "Hora da notificação definida",
|
|
"notification_error": "Erro ao configurar notificação",
|
|
"daily_motivation": "Motivação Diária",
|
|
"get_daily_motivation": "Receba uma mensagem motivacional diária para manter você inspirado!",
|
|
"daily_challenge_notification": "Notificação de Desafio Diário",
|
|
"enable_daily_challenge_notification": "Ativar Notificação de Desafio Diário",
|
|
"quiz_results_history": "Histórico de Resultados do Quiz",
|
|
"no_quiz_history": "Nenhum resultado de quiz salvo ainda.",
|
|
"quiz_date": "Data do Quiz",
|
|
"quiz_score": "Pontuação do Quiz",
|
|
"transaction_title": "Título da Transação",
|
|
"transaction_details": "Detalhes da Transação",
|
|
"notes_optional": "Notas (opcional)",
|
|
"edit_transaction": "Editar Transação",
|
|
"transaction_updated_success": "Transação atualizada com sucesso!",
|
|
"transaction_update_error": "Erro ao atualizar transação.",
|
|
"select_category": "Selecionar Categoria",
|
|
"allowance": "Mesada",
|
|
"tax": "Imposto",
|
|
"bonus": "Bônus",
|
|
"refund": "Reembolso",
|
|
"password_reset_email_sent": "Email de redefinição de palavra-passe enviado.",
|
|
"password_reset_email_error": "Erro ao enviar email de redefinição de palavra-passe.",
|
|
"check_your_email": "Verifique seu email para instruções de redefinição de palavra-passe.",
|
|
"reset_password": "Redefinir Palavra-passe",
|
|
"enter_your_email": "Insira seu email",
|
|
"send_reset_email": "Enviar Email de Redefinição",
|
|
"sending_email": "Enviando email...",
|
|
"back_to_login": "Voltar ao Login",
|
|
"email_not_found": "Email não encontrado.",
|
|
"too_many_requests": "Muitas solicitações. Tente novamente mais tarde.",
|
|
"operation_not_allowed": "Operação não permitida.",
|
|
"invalid_action_code": "Código de ação inválido.",
|
|
"expired_action_code": "Código de ação expirado.",
|
|
"user_disabled": "Usuário desativado.",
|
|
"weak_password": "A nova palavra-passe é muito fraca.",
|
|
"wrong_password": "Palavra-passe incorreta.",
|
|
"password_reset_title": "Redefinição de Palavra-passe",
|
|
"set_new_password": "Definir Nova Palavra-passe",
|
|
"new_password": "Nova Palavra-passe",
|
|
"confirm_new_password": "Confirmar Nova Palavra-passe",
|
|
"password_reset_sent": "Um link foi enviado para {email}. Por favor, verifique a sua caixa de entrada (incluindo a pasta Spam) para redefinir a sua senha.",
|
|
"passwords_do_not_match": "As palavras-passe não coincidem.",
|
|
"enter_valid_email": "Por favor, insira um email válido.",
|
|
"reset_password_title": "Redefinir Palavra-passe",
|
|
"reset_your_password": "Redefina sua palavra-passe",
|
|
"reset_password_instructions": "Insira seu email para receber instruções de redefinição de palavra-passe.",
|
|
"send_instructions": "Enviar Instruções",
|
|
"instruction_sent": "Instruções enviadas para seu email.",
|
|
"instruction_send_error": "Erro ao enviar instruções.",
|
|
"send_reset_link_button": "Enviar Link de Redefinição",
|
|
"email_required_for_reset": "Email é necessário para redefinição de palavra-passe.",
|
|
"sign_in_with_google": "Entrar com Google",
|
|
"or_login_with": "Ou entrar com",
|
|
"or_register_with": "Ou registar com",
|
|
"Login": "Entrar",
|
|
"Register": "Registar",
|
|
},
|
|
'en': {
|
|
"app_name": "KzEduca",
|
|
"slogan": "Learn. Save. Progress.",
|
|
"login": "Login",
|
|
"register": "Register",
|
|
"email_placeholder": "Email",
|
|
"password_placeholder": "Password",
|
|
"username_placeholder": "Username",
|
|
"enter": "Log In",
|
|
"register_button": "Register",
|
|
"logging_in": "Logging In...",
|
|
"registering": "Registering...",
|
|
"forgot_password": "Forgot password?",
|
|
"recover": "Recover",
|
|
"error_prefix": "Error:",
|
|
"email_invalid": "Please enter a valid email.",
|
|
"password_weak": "Password must be at least 6 characters long.",
|
|
"username_required": "Please enter a username.",
|
|
"email_already_in_use": "This email is already in use.",
|
|
"auth_error": "Initial authentication error.",
|
|
"login_error": "Incorrect email or password.",
|
|
"logout_error": "Error logging out.",
|
|
"welcome_message": "Welcome, {{username}}!",
|
|
"dashboard_intro": "This is your KzEduca. Here you can see your progress, simulators, and challenges.",
|
|
"user_id": "Your User ID:",
|
|
"logout": "Log Out",
|
|
"saving_out": "Logging out...",
|
|
"savings_simulator": "Savings Simulator",
|
|
"financial_challenges": "Financial Challenges",
|
|
"quick_lessons": "Quick Lessons",
|
|
"financial_quiz": "Financial Quiz",
|
|
"back_to_dashboard": "Back to Dashboard",
|
|
"initial_value": "Initial Value (Kz)",
|
|
"monthly_deposit": "Monthly Deposit (Kz)",
|
|
"annual_interest_rate": "Annual Interest Rate (%)",
|
|
"period_months": "Period (Months)",
|
|
"simulate_savings": "Simulate Savings",
|
|
"simulating": "Simulating...",
|
|
"fill_all_fields": "Please fill in all fields.",
|
|
"simulation_error": "Could not perform simulation. Please try again later.",
|
|
"estimated_final_value": "Estimated Final Value:",
|
|
"calculate_growth": "Calculate the growth of your savings over time.",
|
|
"participate_challenges": "Participate in fun challenges and achieve your financial goals!",
|
|
"view_all_challenges": "View All Challenges",
|
|
"challenge_progress": "{{progress}}% Completed",
|
|
"learn_concepts": "Learn financial concepts quickly and practically.",
|
|
"explore_lessons": "Explore Lessons",
|
|
"test_knowledge": "Test your knowledge and learn in a fun way!",
|
|
"ready_for_challenge": "Ready for the challenge?",
|
|
"start_quiz": "Start Quiz",
|
|
"your_score": "Your score: {{score}} / {{total}}",
|
|
"save_simulation": "Save Simulation",
|
|
"saving_simulation": "Saving...",
|
|
"simulation_saved": "Simulation saved successfully!",
|
|
"save_simulation_error": "Error saving simulation.",
|
|
"no_simulations": "No simulations saved yet.",
|
|
"saved_simulations": "Saved Simulations",
|
|
"accept_challenge": "Accept Challenge",
|
|
"challenge_accepted": "Challenge accepted!",
|
|
"update_progress": "Update Progress",
|
|
"progress_updated": "Progress updated!",
|
|
"mark_as_complete": "Mark as Complete",
|
|
"lesson_completed": "Lesson completed!",
|
|
"view_details": "View Details",
|
|
"lesson_details": "Lesson Details",
|
|
"quiz_results": "Quiz Results",
|
|
"quiz_save_error": "Error saving quiz result.",
|
|
"no_quiz_results": "No quiz results saved yet.",
|
|
"completed_lessons": "Completed Lessons",
|
|
"no_completed_lessons": "No lessons completed yet.",
|
|
"my_challenges": "My Challenges",
|
|
"no_accepted_challenges": "No challenges accepted yet.",
|
|
"challenge_already_accepted": "You have already accepted this challenge.",
|
|
"challenge_not_found": "Challenge not found.",
|
|
"lesson_not_found": "Lesson not found.",
|
|
"question_not_found": "Question not found.",
|
|
"loading": "Loading",
|
|
"back_to_lessons": "Back to Lessons",
|
|
"next_question": "Next Question",
|
|
"view_results": "View Results",
|
|
"correct": "Correct!",
|
|
"incorrect": "Incorrect.",
|
|
"invalid_progress": "Invalid progress. Enter a number between 0 and 100.",
|
|
"invalid_numeric_input": "Please enter valid and positive numeric values.",
|
|
"auth_operation_not_allowed_email_password": "Email/Password authentication is not enabled in Firebase. Please enable it in the Firebase console.",
|
|
"auth_operation_not_allowed_anonymous": "Anonymous authentication is not enabled in Firebase. Please enable it in the Firebase console.",
|
|
"current_balance": "Current Balance",
|
|
"kwanza_symbol": "Kz",
|
|
"settings_title": "Settings",
|
|
"general_settings": "General",
|
|
"language": "Language",
|
|
"portuguese_brazil": "Portuguese (Brazil)",
|
|
"english": "English",
|
|
"currency": "Currency",
|
|
"policies_and_feedback": "Policies & Feedback",
|
|
"rate_app": "Rate App",
|
|
"send_feedback": "Send Feedback",
|
|
"share_with_friends": "Share with Friends",
|
|
"privacy_policy": "Privacy Policy",
|
|
"transactions_menu_item": "Transaction",
|
|
"add_transaction_title": "Add Transaction",
|
|
"transaction_type": "Type",
|
|
"income": "Income",
|
|
"expense": "Expense",
|
|
"amount": "Amount",
|
|
"description": "Description",
|
|
"category": "Category",
|
|
"date": "Date",
|
|
"save_transaction": "Save Transaction",
|
|
"transaction_saved_success": "Transaction saved successfully!",
|
|
"transaction_save_error": "Error saving transaction.",
|
|
"statistics_title": "Statistics",
|
|
"total_income": "Total Income",
|
|
"total_expenses": "Total Expenses",
|
|
"net_balance": "Net Balance",
|
|
"transactions_by_category": "Transactions by Category",
|
|
"budget_title": "Budget",
|
|
"create_new_budget": "Create New Budget",
|
|
"no_budgets": "No budgets defined yet.",
|
|
"budget_name": "Budget Name",
|
|
"budget_amount": "Budget Amount",
|
|
"create_budget": "Create Budget",
|
|
"budget_saved_success": "Budget saved successfully!",
|
|
"budget_save_error": "Error saving budget.",
|
|
"savings_calculator_title": "Savings Calculator",
|
|
"initial_deposit": "Initial Deposit",
|
|
"interest_rate": "Annual Interest Rate (%)",
|
|
"saving_period": "Saving Period",
|
|
"start_date": "Start Date",
|
|
"calculate": "Calculate",
|
|
"reset_fields": "Reset Fields",
|
|
"result": "Result",
|
|
"final_amount": "Final Amount",
|
|
"interest_earned": "Interest Earned",
|
|
"valid_deposit_interest": "Please enter valid values for deposit and interest rate.",
|
|
"calculation_history": "Calculation History (to be implemented)",
|
|
"home": "Home",
|
|
"statistics": "Statistics",
|
|
"budget": "Budget",
|
|
"savings": "Savings",
|
|
"statistics_menu_item": "Statistics",
|
|
"settings_menu_item": "Settings",
|
|
"total_balance": "Total Balance",
|
|
"budget_progress": "Budget Progress",
|
|
"spent": "Spent",
|
|
"budgeted": "Budgeted",
|
|
"recent_transactions": "Recent Transactions",
|
|
"no_data": "No data found for this period",
|
|
"no_data_subtitle": "Start logging transactions or create budgets to see statistics.",
|
|
// Novas chaves adicionadas
|
|
"lesson_duration": "Duration",
|
|
"download_video": "Download Video",
|
|
"download_book": "Download Book",
|
|
"read_book_online": "Read Book Online",
|
|
"completed": "Completed",
|
|
"lesson_already_completed": "Lesson already completed",
|
|
"quiz_already_completed": "Quiz already completed",
|
|
"no_more_questions": "No more questions.",
|
|
"finish_quiz": "Finish Quiz",
|
|
"are_you_sure_finish_quiz": "Are you sure you want to finish the quiz?",
|
|
"yes": "Yes",
|
|
"no": "No",
|
|
"question": "Question",
|
|
"of": "of",
|
|
"select_option": "Select an option",
|
|
"option": "Option",
|
|
"select_language": "Select Language",
|
|
"select_currency": "Select Currency",
|
|
"language_changed": "Language changed. Restart the app to apply changes.",
|
|
"currency_changed": "Currency changed. Restart the app to apply changes.",
|
|
"share_message": "I'm using KzEduca to learn about finance and manage my money. Download the app here: https://example.com",
|
|
"rate_message": "If you like KzEduca, please rate us on the app store!",
|
|
"feedback_email_subject": "Feedback from KzEduca",
|
|
"feedback_email_body": "Please write your feedback here:\n",
|
|
"privacy_policy_url": "https://example.com/privacy",
|
|
"terms_of_service_url": "https://example.com/terms",
|
|
"History of Calculations": "History of Calculations",
|
|
"No calculations yet.": "No calculations yet.",
|
|
"calculation_date": "Calculation Date",
|
|
"History": "History",
|
|
"change_language": "Change language",
|
|
"notifications": "Notifications",
|
|
"profile": "Profile",
|
|
"settings_menu_item": "Settings",
|
|
"home": "Home",
|
|
"transactions_menu_item": "Transaction",
|
|
"statistics_menu_item": "Statistics",
|
|
"quick_lessons": "Quick Lessons",
|
|
"transfer": "Transfer",
|
|
"receive": "Receive",
|
|
"swap": "Swap",
|
|
"savings": "Savings",
|
|
"lessons": "Lessons",
|
|
"challenges": "Challenges",
|
|
"quiz": "Quiz",
|
|
"public_challenges_title": "Public Challenges Title",
|
|
"Historic": "History",
|
|
"challenges_title": "Challenges Title",
|
|
"accept_challenge": "Accept Challenge",
|
|
"my_challenges": "My Challenges",
|
|
"accepted_challenges_title": "Accepted Challenges Title",
|
|
"daily_challenge_new": "New Daily Challenge",
|
|
"no_data": "No data found for this period",
|
|
"no_data_subtitle": "Start logging transactions or create budgets to see statistics.",
|
|
"month": "Month",
|
|
"year": "Year",
|
|
"income": "Income",
|
|
"expenses": "Expenses",
|
|
"biggest_expense": "Biggest Expense",
|
|
"most_used_category": "Most Used Category",
|
|
"avg_expense": "Avg Expense",
|
|
"total_transactions": "Total Transactions",
|
|
"balance_evolution": "Balance Evolution",
|
|
"expenses_by_category": "Expenses by Category",
|
|
"budgets": "Budgets",
|
|
"transactions": "Transactions",
|
|
"food": "Food",
|
|
"transport": "Transport",
|
|
"social": "Social",
|
|
"education": "Learning",
|
|
"medical": "Medical",
|
|
"shopping": "Shopping",
|
|
"salary": "Salary",
|
|
"invest": "Investment",
|
|
"business": "Business",
|
|
"others": "Others",
|
|
"unknown": "Unknown",
|
|
"budgets_title": "Budgets",
|
|
"week": "Week",
|
|
"month": "Month",
|
|
"quarter": "Quarter",
|
|
"year": "Year",
|
|
"no_budgets_for_period": "No budgets for this period.",
|
|
"create_budget_message": "Create a budget and start controlling your expenses!",
|
|
"confirm_deletion": "Confirm Deletion",
|
|
"confirm_deletion_message": "Are you sure you want to delete this budget?",
|
|
"cancel": "Cancel",
|
|
"delete": "Delete",
|
|
"budget_deleted_successfully": "Budget deleted successfully!",
|
|
"period": "Period",
|
|
"from": "From",
|
|
"to": "to",
|
|
"budgeted": "Budgeted",
|
|
"note": "Note",
|
|
"add_budget_tooltip": "Add Budget",
|
|
"food": "Food",
|
|
"transport": "Transport",
|
|
"social": "Social",
|
|
"education": "Education",
|
|
"medical": "Medical",
|
|
"shopping": "Shopping",
|
|
"salary": "Salary",
|
|
"invest": "Invest",
|
|
"business": "Business",
|
|
"others": "Others",
|
|
"unknown": "Unknown",
|
|
"house": "House",
|
|
"utilities": "Utilities",
|
|
"subscriptions": "Subscriptions",
|
|
"leisure": "Leisure",
|
|
"gym": "Gym",
|
|
"gifts": "Gifts",
|
|
"pets": "Pets",
|
|
"freelance": "Freelance",
|
|
"dividends": "Dividends",
|
|
"loan": "Loan",
|
|
"refund": "Refund",
|
|
"tax": "Tax",
|
|
"bonus": "Bonus",
|
|
"allowance": "Allowance",
|
|
"profile_update_success": "Profile updated successfully!",
|
|
"profile_update_error": "Error updating profile.",
|
|
"change_profile_picture": "Change Profile Picture",
|
|
"remove_profile_picture": "Remove Profile Picture",
|
|
"take_photo": "Take Photo",
|
|
"choose_from_gallery": "Choose from Gallery",
|
|
"cancel": "Cancel",
|
|
"profile_updated": "Profile updated",
|
|
"select_image": "Select Image",
|
|
"daily": "Daily",
|
|
"weekly": "Weekly",
|
|
"monthly": "Monthly",
|
|
"yearly": "Yearly",
|
|
"never": "Never",
|
|
"reminders": "Reminders",
|
|
"set_reminder": "Set Reminder",
|
|
"reminder_set_success": "Reminder set successfully!",
|
|
"reminder_set_error": "Error setting reminder.",
|
|
"no_reminders": "No reminders set.",
|
|
"delete_reminder": "Delete Reminder",
|
|
"reminder_deleted_success": "Reminder deleted successfully!",
|
|
"reminder_deleted_error": "Error deleting reminder.",
|
|
"select_time": "Select Time",
|
|
"select_date": "Select Date",
|
|
"time": "Time",
|
|
"daily_notification": "Daily Notification",
|
|
"enable_daily_notification": "Enable Daily Notification",
|
|
"disable_daily_notification": "Disable Daily Notification",
|
|
"notification_time": "Notification Time",
|
|
"notification_enabled": "Notification enabled",
|
|
"notification_disabled": "Notification disabled",
|
|
"notification_time_set": "Notification time set",
|
|
"notification_error": "Error setting notification",
|
|
"daily_motivation": "Daily Motivation",
|
|
"get_daily_motivation": "Receive a daily motivational message to keep you inspired!",
|
|
"daily_challenge_notification": "Daily Challenge Notification",
|
|
"enable_daily_challenge_notification": "Enable Daily Challenge Notification",
|
|
"quiz_results_history": "Quiz Results History",
|
|
"no_quiz_history": "No quiz results saved yet.",
|
|
"quiz_date": "Quiz Date",
|
|
"quiz_score": "Quiz Score",
|
|
"transaction_title": "Transaction Title",
|
|
"transaction_details": "Transaction Details",
|
|
"notes_optional": "Notes (optional)",
|
|
"select_category": "Select Category",
|
|
"allowance": "Allowance",
|
|
"tax": "Tax",
|
|
"bonus": "Bonus",
|
|
"refund": "Refund",
|
|
"password_reset_email_sent": "Password reset email sent.",
|
|
"password_reset_email_error": "Error sending password reset email.",
|
|
"check_your_email": "Check your email for password reset instructions.",
|
|
"reset_password": "Reset Password",
|
|
"enter_your_email": "Enter your email",
|
|
"send_reset_email": "Send Reset Email",
|
|
"sending_email": "Sending email...",
|
|
"back_to_login": "Back to Login",
|
|
"email_not_found": "Email not found.",
|
|
"too_many_requests": "Too many requests. Please try again later.",
|
|
"operation_not_allowed": "Operation not allowed.",
|
|
"invalid_action_code": "Invalid action code.",
|
|
"expired_action_code": "Expired action code.",
|
|
"user_disabled": "User disabled.",
|
|
"weak_password": "The new password is too weak.",
|
|
"wrong_password": "Incorrect password.",
|
|
"password_reset_title": "Password Reset",
|
|
"set_new_password": "Set New Password",
|
|
"new_password": "New Password",
|
|
"confirm_new_password": "Confirm New Password",
|
|
"password_reset_sent": "A link has been sent to {email}. Please check your inbox (including Spam folder) to reset your password.",
|
|
"passwords_do_not_match": "Passwords do not match.",
|
|
"reset_password_title": "Reset Password",
|
|
"reset_password_subtitle": "Enter your email to receive password reset instructions.",
|
|
"reset_password_instructions": "We will send you an email with instructions to reset your password.",
|
|
"sent_reset_link_button": "Send Reset Link",
|
|
"email_required_for_reset": "Email is required for password reset.",
|
|
"username_placeholder": "Username",
|
|
"enter": "Log In",
|
|
"register_button": "Register",
|
|
"logging_in": "Logging In...",
|
|
"registering": "Registering...",
|
|
"forgot_password": "Forgot password?",
|
|
"recover": "Recover",
|
|
"error_prefix": "Error:",
|
|
"email_invalid": "Please enter a valid email.",
|
|
"password_weak": "Password must be at least 6 characters long.",
|
|
"username_required": "Please enter a username.",
|
|
"email_already_in_use": "This email is already in use.",
|
|
"auth_error": "Initial authentication error.",
|
|
"login_error": "Incorrect email or password.",
|
|
"logout_error": "Error logging out.",
|
|
"welcome_message": "Welcome, {{username}}!",
|
|
"dashboard_intro": "This is your KzEduca. Here you can see your progress, simulators, and challenges.",
|
|
"user_id": "Your User ID:",
|
|
"logout": "Log Out",
|
|
"saving_out": "Logging out...",
|
|
"send_reset_link_button": "Send Reset Link",
|
|
"email_required_for_reset": "Email is required for password reset.",
|
|
"sign_in_with_google": "Sign in with Google",
|
|
"or_login_with": "Or log in with",
|
|
"or_register_with": "Or register with",
|
|
"Login": "Login",
|
|
"Register": "Register",
|
|
}
|
|
};
|
|
|
|
String t(String key, {Map<String, String>? options}) {
|
|
String translatedText = _resources[_language]?[key] ?? key;
|
|
if (options != null) {
|
|
options.forEach((optKey, optValue) {
|
|
translatedText = translatedText.replaceAll('{{$optKey}}', optValue);
|
|
});
|
|
}
|
|
return translatedText;
|
|
}
|
|
|
|
Future<void> setLocale(Locale newLocale) async {
|
|
if (_language == newLocale.languageCode) return;
|
|
|
|
_language = newLocale.languageCode;
|
|
final prefs = await SharedPreferences.getInstance();
|
|
await prefs.setString('languageCode', newLocale.languageCode);
|
|
|
|
notifyListeners();
|
|
}
|
|
} |