/* pagan-welcome – implementacja tłumaczeń PL/EN. */ #include "pw-i18n.h" #include #include typedef struct { const char *key; const char *pl; const char *en; } Entry; static const Entry TABLE[] = { /* ── Aplikacja ─────────────────────────────────────────────────────── */ {"app_title", "Pagan-Welcome", "Pagan-Welcome"}, {"app_tagline", "Witaj w PaganLinux", "Welcome to PaganLinux"}, /* ── Nawigacja ─────────────────────────────────────────────────────── */ {"nav_news", "Nowości", "News"}, {"nav_install", "Instalator", "Installer"}, {"nav_update", "Aktualizacja", "Update"}, {"nav_store", "Sklep", "Store"}, {"nav_settings", "Ustawienia", "Settings"}, /* ── Wspólne ───────────────────────────────────────────────────────── */ {"common_refresh", "Odśwież", "Refresh"}, {"common_loading", "Ładowanie…", "Loading…"}, {"common_working", "Pracuję…", "Working…"}, {"common_error", "Błąd", "Error"}, {"common_close", "Zamknij", "Close"}, {"common_cancel", "Anuluj", "Cancel"}, {"common_yes", "Tak", "Yes"}, {"common_no", "Nie", "No"}, {"common_language", "Język", "Language"}, {"common_never", "nigdy", "never"}, {"common_password_title", "Hasło administratora", "Administrator password"}, {"common_password_prompt", "Ta operacja wymaga uprawnień root.\nPodaj hasło sudo:", "This operation requires root privileges.\nEnter your sudo password:"}, /* ── Nowości ───────────────────────────────────────────────────────── */ {"news_title", "Co nowego w PaganLinux", "What's new in PaganLinux"}, {"news_subtitle", "Najnowsze informacje o wydaniach systemu", "Latest system release information"}, {"news_open_browser", "Otwórz w przeglądarce", "Open in browser"}, {"news_updated", "Zaktualizowano", "Updated"}, {"news_cached", "Dane z pamięci podręcznej", "Cached data"}, {"news_empty", "Brak dostępnych nowości.", "No news available."}, {"news_fetch_error", "Nie udało się pobrać nowości.", "Failed to fetch the news."}, /* ── Instalator ────────────────────────────────────────────────────── */ {"install_title", "Instalator systemu", "System installer"}, {"install_subtitle", "Zainstaluj PaganLinux na dysku", "Install PaganLinux to disk"}, {"install_desc", "Uruchom graficzny instalator Calamares, aby zainstalować PaganLinux na " "dysku twardym.\n\nUwaga: wszystkie dane na wybranym dysku lub partycji " "zostaną nadpisane. Przed instalacją wykonaj kopię zapasową.", "Launch the Calamares graphical installer to install PaganLinux on a hard " "drive.\n\nWarning: all data on the selected disk or partition will be " "overwritten. Back up your data before installing."}, {"install_button", "Uruchom instalator", "Launch installer"}, {"install_live_only", "Instalator jest dostępny tylko w sesji live (uruchomionej z pendrive'a " "lub ISO). Ten system jest już zainstalowany na dysku.", "The installer is only available in a live session (booted from a USB " "stick or ISO). This system is already installed on disk."}, {"install_running", "Instalator jest uruchomiony…", "Installer is running…"}, {"install_done", "Instalator zakończył pracę.", "Installer finished."}, {"install_missing", "Nie znaleziono programu Calamares (/usr/bin/calamares).", "Calamares not found (/usr/bin/calamares)."}, {"install_confirm", "Uruchomić instalator systemu?", "Launch the system installer?"}, /* ── Aktualizacja ──────────────────────────────────────────────────── */ {"update_title", "Aktualizacja systemu", "System update"}, {"update_subtitle", "PaganLinux to system typu rolling release", "PaganLinux is a rolling release"}, {"update_desc", "Pobierz najnowsze pakiety z repozytorium PAG i zaktualizuj system.\n\n" "Zalecane jest regularne aktualizowanie systemu. Aktualizacja obejmuje " "jądro, sterowniki i całe oprogramowanie.", "Fetch the latest packages from the PAG repository and update the " "system.\n\nRegular updates are recommended. An update covers the kernel, " "drivers and all software."}, {"update_button", "Aktualizuj system", "Update system"}, {"update_check_button", "Sprawdź aktualizacje", "Check for updates"}, {"update_running", "Aktualizacja w toku…", "Updating…"}, {"update_done", "Aktualizacja zakończona.", "Update finished."}, {"update_failed", "Aktualizacja nie powiodła się.", "Update failed."}, {"update_uptodate", "System jest aktualny.", "System is up to date."}, {"update_available", "Dostępne aktualizacje: %d", "Available updates: %d"}, {"update_confirm", "Rozpocząć aktualizację systemu?", "Start the system update?"}, {"update_reboot", "Zalecany restart po aktualizacji jądra.", "A reboot is recommended after a kernel update."}, {"update_sync", "Synchronizacja repozytorium…", "Syncing repository…"}, {"update_upgrade", "Aktualizacja pakietów…", "Upgrading packages…"}, {"update_terminal_title", "Terminal aktualizacji", "Update terminal"}, {"update_input_placeholder", "Wpisz odpowiedź dla pag i naciśnij Enter…", "Type a reply for pag and press Enter…"}, {"update_cancelled", "Przerwano aktualizację.", "Update cancelled."}, {"update_waiting", "Uruchamiam aktualizację…", "Starting the update…"}, /* ── Sklep ─────────────────────────────────────────────────────────── */ {"store_title", "Sklep z pakietami", "Package store"}, {"store_subtitle", "Przeglądaj i instaluj oprogramowanie z repozytorium PAG", "Browse and install software from the PAG repository"}, {"store_search_placeholder", "Szukaj pakietu (nazwa lub opis)…", "Search packages (name or description)…"}, {"store_col_name", "Pakiet", "Package"}, {"store_col_version", "Wersja", "Version"}, {"store_col_size", "Rozmiar", "Size"}, {"store_col_desc", "Opis", "Description"}, {"store_install", "Zainstaluj", "Install"}, {"store_remove", "Usuń", "Remove"}, {"store_installed", "Zainstalowany", "Installed"}, {"store_not_installed", "Niezainstalowany", "Not installed"}, {"store_details", "Szczegóły", "Details"}, {"store_depends", "Zależności", "Dependencies"}, {"store_license", "Licencja", "License"}, {"store_loading", "Pobieram listę pakietów…", "Fetching package list…"}, {"store_error", "Nie udało się pobrać listy pakietów.", "Failed to fetch the package list."}, {"store_no_results", "Brak wyników.", "No results."}, {"store_count", "Pakietów: %d • zainstalowanych: %d", "Packages: %d • installed: %d"}, {"store_select", "Wybierz pakiet z listy, aby zobaczyć szczegóły.", "Select a package from the list to see details."}, {"store_installing", "Instaluję %s…", "Installing %s…"}, {"store_install_ok", "Zainstalowano: %s", "Installed: %s"}, {"store_install_fail", "Instalacja nie powiodła się: %s", "Installation failed: %s"}, {"store_confirm", "Zainstalować pakiet „%s”?", "Install package \"%s\"?"}, {"store_confirm_remove", "Usunąć pakiet „%s”?", "Remove package \"%s\"?"}, {"store_remove_ok", "Usunięto: %s", "Removed: %s"}, {"store_remove_fail", "Nie udało się usunąć: %s", "Failed to remove: %s"}, {"store_none", "brak", "none"}, {"store_open", "Otwórz", "Open"}, {"store_open_hint", "Uruchom aplikację graficzną pakietu", "Launch the package's graphical application"}, {"store_open_fail", "Nie udało się uruchomić: %s", "Failed to launch: %s"}, {"store_status_installed_gui", "Zainstalowany • ma aplikację graficzną", "Installed • has a graphical app"}, {"store_status_installed", "Zainstalowany", "Installed"}, /* ── Ustawienia ────────────────────────────────────────────────────── */ {"settings_title", "Ustawienia podstawowe", "Basic settings"}, {"settings_subtitle", "Język, klawiatura, czas i sieć", "Language, keyboard, time and network"}, {"settings_language", "Język systemu", "System language"}, {"settings_keyboard", "Układ klawiatury", "Keyboard layout"}, {"settings_timezone", "Strefa czasowa", "Timezone"}, {"settings_hostname", "Nazwa komputera", "Hostname"}, {"settings_network", "Sieć", "Network"}, {"settings_network_hint", "Połącz z siecią Wi-Fi (NetworkManager).", "Connect to a Wi-Fi network (NetworkManager)."}, {"settings_wifi_button", "Połącz z Wi-Fi", "Connect to Wi-Fi"}, {"settings_apply", "Zastosuj", "Apply"}, {"settings_saved", "Zapisano ustawienia.", "Settings saved."}, {"settings_failed", "Nie udało się zapisać ustawień.", "Failed to save the settings."}, {"settings_restart_hint", "Zmiana języka wymaga ponownego zalogowania.", "Changing the language requires re-login."}, {"settings_about", "O systemie", "About"}, {"settings_about_text", "PaganLinux – niezależna polska dystrybucja Linuksa.\n" "Zbudowana od podstaw (Linux From Scratch) z własnym menedżerem pakietów " "pag i systemem budowania.", "PaganLinux – an independent Polish Linux distribution.\n" "Built from scratch (Linux From Scratch) with its own package manager pag " "and build system."}, {"settings_loading", "Wczytuję ustawienia…", "Loading settings…"}, /* ── Nie pokazuj więcej / autostart ────────────────────────────────── */ {"header_wifi", "Wi-Fi", "Wi-Fi"}, {"dont_show_again", "Nie pokazuj tego okna przy logowaniu", "Don't show this window at login"}, {"autostart_enabled", "Pagan-Welcome będzie się uruchamiał przy logowaniu.", "Pagan-Welcome will start at login."}, {"autostart_disabled", "Pagan-Welcome nie będzie się uruchamiał przy logowaniu.", "Pagan-Welcome will not start at login."}, /* ── Aplet / tray ──────────────────────────────────────────────────── */ {"tray_check", "Sprawdź aktualizacje", "Check for updates"}, {"tray_update", "Aktualizuj system", "Update system"}, {"tray_open", "Otwórz Pagan-Welcome", "Open Pagan-Welcome"}, {"tray_settings", "Ustawienia", "Settings"}, {"tray_wifi", "Połącz z Wi-Fi", "Connect to Wi-Fi"}, {"tray_quit", "Zakończ", "Quit"}, {"tray_updates_available", "Dostępne aktualizacje: %d", "Available updates: %d"}, {"tray_up_to_date", "System jest aktualny", "System is up to date"}, {"tray_checking", "Sprawdzam aktualizacje…", "Checking for updates…"}, {"tray_notify_title", "PaganLinux – aktualizacje", "PaganLinux – updates"}, {"tray_notify_body", "Dostępnych jest %d aktualizacji pakietów. Kliknij, aby otworzyć " "Pagan-Welcome.", "%d package updates are available. Click to open Pagan-Welcome."}, {"tray_tooltip", "PaganLinux – aktualizacje", "PaganLinux – updates"}, }; static const char *cur_lang = "en"; void pw_i18n_set_lang(const char *lang) { if (lang && (g_strcmp0(lang, "en") == 0 || g_strcmp0(lang, "pl") == 0)) cur_lang = g_strcmp0(lang, "en") == 0 ? "en" : "pl"; else cur_lang = "en"; /* domyślnie angielski */ } const char * pw_i18n_lang(void) { return cur_lang; } const char * pw_tr(const char *key) { const gboolean en = (g_strcmp0(cur_lang, "en") == 0); for (gsize i = 0; i < G_N_ELEMENTS(TABLE); i++) { if (g_strcmp0(TABLE[i].key, key) == 0) return en ? TABLE[i].en : TABLE[i].pl; } return key; } char * pw_trf(const char *key, ...) { const char *fmt = pw_tr(key); va_list ap; va_start(ap, key); char *out = g_strdup_vprintf(fmt, ap); va_end(ap); return out; }