Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace rust-i18n with i18n-embed #1426

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
614 changes: 396 additions & 218 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ petgraph = "0.6.5"
pretty_assertions = "1.4.1"
rand = "0.8.5"
ratatui = "0.29.0"
rust-i18n = "3.1.2"
rust-embed = "8.5"
i18n-embed = { version = "0.15", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.9"
serde = { version = "1.0.201", default-features = false }
serde_json = { version = "1.0.117", default-features = false }
serde_with = { version = "3.11.0", default-features = false, features = ["macros"] }
socket2 = "0.5.8"
strum = { version = "0.26.3", default-features = false }
sys-locale = "0.3.2"
test-case = "3.3.1"
thiserror = "2.0.3"
tokio = "1.41.1"
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ COPY crates/trippy-dns/Cargo.toml /app/crates/trippy-dns/Cargo.toml
COPY crates/trippy-packet/Cargo.toml /app/crates/trippy-packet/Cargo.toml
COPY crates/trippy-privilege/Cargo.toml /app/crates/trippy-privilege/Cargo.toml
COPY examples/ /app/examples/
COPY crates/trippy-tui/i18n/ /app/crates/trippy-tui/i18n/
COPY crates/trippy-tui/i18n.toml /app/crates/trippy-tui/i18n.toml

# dummy build to cache dependencies
RUN echo "fn main() {}" > /app/crates/trippy/src/main.rs
Expand Down
7 changes: 4 additions & 3 deletions crates/trippy-tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ itertools.workspace = true
maxminddb.workspace = true
petgraph.workspace = true
ratatui.workspace = true
rust-i18n.workspace = true
rust-embed.workspace = true
i18n-embed.workspace = true
i18n-embed-fl.workspace = true
serde = { workspace = true, default-features = false, features = [ "derive" ] }
serde_json.workspace = true
serde_with.workspace = true
strum = { workspace = true, default-features = false, features = [ "std", "derive" ] }
sys-locale.workspace = true
toml = { workspace = true, default-features = false, features = [ "parse" ] }
tracing-chrome.workspace = true
tracing-subscriber = { workspace = true, default-features = false, features = [ "env-filter", "json" ] }
Expand All @@ -59,4 +60,4 @@ pretty_assertions.workspace = true
test-case.workspace = true

[lints]
workspace = true
workspace = true
4 changes: 4 additions & 0 deletions crates/trippy-tui/i18n.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fallback_language = "en"

[fluent]
assets_dir = "i18n"
110 changes: 110 additions & 0 deletions crates/trippy-tui/i18n/de/trippy-tui.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
auto = auto
awaited = erwartet
awaiting_data = Warten auf Daten...
bsod_failed = Trippy ist fehlgeschlagen :(
bsod_quit = Drücken Sie q, um zu beenden
chart = chart
column_avg = Durchschnitt
column_best = Beste
column_bloss = Bloss
column_code = Code
column_dprt = Dprt
column_fail = Fehlgeschlagen
column_floss = Floss
column_floss_pct = Floss%
column_host = Host
column_javg = Javg
column_jint = Jint
column_jmax = Jmax
column_jttr = Jttr
column_last = Letzte
column_loss_pct = Verlust%
column_nat = Nat
column_recv = Recv
column_seq = Seq
column_snd = Snd
column_sprt = Sprt
column_stdev = StdAbw
column_sts = Sts
column_type = Typ
column_wrst = Schlechteste
details = detail
discovered = { $hop_count } gefundene hops
discovered_flows = { $hop_count } gefundene hops und { $flow_count } eindeutige { $plural_flows }
dns_failed = Fehlgeschlagen
dns_timeout = Zeitüberschreitung
ext = Ext
flow = fluss
flows = flüsse
geo = Geo
geoip_multiple_data_for_hop = Mehrere GeoIp-Standorte für den Hop
geoip_no_data_for_hop = Keine GeoIp-Daten für den Hop
geoip_not_enabled = GeoIp nicht aktiviert
header_help = hilfe
header_quit = beenden
header_settings = einstellungen
help_copyright = Copyright 2022 Trippy Mitwirkende
help_license = Verteilt unter der Apache-Lizenz 2.0
help_show_bindings = Drücken Sie [{ $key }], um alle Tastenbelegungen anzuzeigen
help_show_columns = Drücken Sie [{ $key }], um alle Spalten anzuzeigen
help_show_settings = Drücken Sie [{ $key }], um alle Einstellungen anzuzeigen
help_tagline = Ein Netzwerkdiagnosetool
hidden = Versteckt
hop = Hop
host = Host
icmp = icmp
info = Info
kilometer = km
labels = etiketten
name = Name
na = n/a
no = Nein
none = keiner
no_response = Keine Antwort
not_enabled = nicht aktiviert
not_found = nicht gefunden
off = aus
on = an
pos = Pos
privacy = datenschutz
privileged = privilegiert
rtt = RTT
samples = Proben
settings_info = Info
settings_tab_bindings_desc = Tui-Tastenbelegungen
settings_tab_bindings_title = Tastenbelegungen
settings_tab_columns_desc = Tui-Tabellenspalten. Drücken Sie [{ $c }], um eine Spalte ein- oder auszuschalten, und verwenden Sie die Tasten [{ $d }] und [{ $u }], um die Spaltenreihenfolge zu ändern.
settings_tab_columns_title = Spalten
settings_tab_dns_desc = Einstellungen, die steuern, wie DNS-Lookups durchgeführt werden
settings_tab_dns_title = DNS
settings_tab_geoip_desc = Einstellungen im Zusammenhang mit GeoIp
settings_tab_geoip_title = GeoIp
settings_table_header_setting = Einstellung
settings_table_header_value = Wert
settings_tab_theme_desc = Tui-Themefarben
settings_tab_theme_title = Darstellung
settings_tab_trace_desc = Einstellungen, die die Tracing-Strategie steuern
settings_tab_trace_title = Trace
settings_tab_tui_desc = Einstellungen, die steuern, wie Daten in diesem Tui angezeigt werden
settings_tab_tui_title = Tui
status_failed = Fehlgeschlagen
status_failures = { $failure_count } von { $total_probes } ({ $failure_rate }%) sonden sind fehlgeschlagen
status_frozen = Eingefroren
status_running = Läuft
status = Status
target = Ziel
tcp = tcp
title_chart = Diagramm
title_flows = Flüsse
title_frequency = Frequenz
title_help = Hilfe
title_hops = Hops
title_map = Karte
title_samples = Proben
title_settings = Einstellungen
title_traces = Spuren
trippy = trippy
udp = udp
unknown = unbekannt
unprivileged = unprivilegiert
yes = Ja
110 changes: 110 additions & 0 deletions crates/trippy-tui/i18n/en/trippy-tui.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
auto = auto
awaited = awaited
awaiting_data = Awaiting data...
bsod_failed = Trippy Failed :(
bsod_quit = Press q to quit
chart = chart
column_avg = Avg
column_best = Best
column_bloss = Bloss
column_code = Code
column_dprt = Dprt
column_fail = Fail
column_floss = Floss
column_floss_pct = Floss%
column_host = Host
column_javg = Javg
column_jint = Jint
column_jmax = Jmax
column_jttr = Jttr
column_last = Last
column_loss_pct = Loss%
column_nat = Nat
column_recv = Recv
column_seq = Seq
column_snd = Snd
column_sprt = Sprt
column_stdev = StDev
column_sts = Sts
column_type = Type
column_wrst = Wrst
details = detail
discovered = discovered { $hop_count } hops
discovered_flows = discovered { $hop_count } hops and { $flow_count } unique { $plural_flows }
dns_failed = Failed
dns_timeout = Timeout
ext = Ext
flow = flow
flows = flows
geo = Geo
geoip_multiple_data_for_hop = Multiple GeoIp locations for hop
geoip_no_data_for_hop = No GeoIp data for hop
geoip_not_enabled = GeoIp not enabled
header_help = help
header_quit = quit
header_settings = settings
help_copyright = Copyright 2022 Trippy Contributors
help_license = Distributed under the Apache License 2.0
help_show_bindings = Press [{ $key }] to show all bindings
help_show_columns = Press [{ $key }] to show all columns
help_show_settings = Press [{ $key }] to show all settings
help_tagline = A network diagnostic tool
hidden = Hidden
hop = Hop
host = Host
icmp = icmp
info = Info
kilometer = km
labels = labels
name = Name
na = n/a
none = none
no = No
no_response = No response
not_enabled = not enabled
not_found = not found
off = off
on = on
pos = Pos
privacy = privacy
privileged = privileged
rtt = RTT
samples = Samples
settings_info = Info
settings_tab_bindings_desc = Tui key bindings
settings_tab_bindings_title = Bindings
settings_tab_columns_desc = Tui table columns. Press [{ $c }] to toggle a column on or off and use the [{ $d }] and [{ $u }] keys to change the column order.
settings_tab_columns_title = Columns
settings_tab_dns_desc = Settings which control how DNS lookups are performed
settings_tab_dns_title = DNS
settings_tab_geoip_desc = Settings relating to GeoIp
settings_tab_geoip_title = GeoIp
settings_table_header_setting = Setting
settings_table_header_value = Value
settings_tab_theme_desc = Tui theme colors
settings_tab_theme_title = Theme
settings_tab_trace_desc = Settings which control the tracing strategy
settings_tab_trace_title = Trace
settings_tab_tui_desc = Settings which control how data is displayed in this Tui
settings_tab_tui_title = Tui
status_failed = Failed
status_failures = { $failure_count } of { $total_probes } ({ $failure_rate }%) probes failed
status_frozen = Frozen
status_running = Running
status = Status
target = Target
tcp = tcp
title_chart = Chart
title_flows = Flows
title_frequency = Frequency
title_help = Help
title_hops = Hops
title_map = Map
title_samples = Samples
title_settings = Settings
title_traces = Traces
trippy = trippy
udp = udp
unknown = unknown
unprivileged = unprivileged
yes = Yes
110 changes: 110 additions & 0 deletions crates/trippy-tui/i18n/es/trippy-tui.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
auto = automático
awaited = esperado
awaiting_data = Esperando datos...
bsod_failed = Trippy tuvo un problema :(
bsod_quit = Presiona q para salir
chart = chart
column_avg = Prom
column_best = Mejor
column_bloss = Bloss
column_code = Código
column_dprt = Dprt
column_fail = Falló
column_floss = Floss
column_floss_pct = Floss%
column_host = Host
column_javg = PromJit
column_jint = JitInt
column_jmax = JitMax
column_jttr = Jttr
column_last = Último
column_loss_pct = % Perdidos
column_nat = Nat
column_recv = Recibidos
column_seq = Seq
column_snd = Enviados
column_sprt = Sprt
column_stdev = DesvE
column_sts = Est
column_type = Tipo
column_wrst = Peor
details = detalles
discovered_flows = se descubrieron { $hop_count } saltos y { $flow_count } únicos { $plural_flows }
discovered = se descubrieron { $hop_count } saltos
dns_failed = Fallido
dns_timeout = Tiempo de espera
ext = Ext
flow = flujo
flows = flujos
geo = Geo
geoip_multiple_data_for_hop = Múltiples ubicaciones de GeoIp para el salto
geoip_no_data_for_hop = No hay datos de GeoIp para el salto
geoip_not_enabled = GeoIp no habilitado
header_help = ayuda
header_quit = salir
header_settings = configuraciones
help_copyright = Derechos de autor 2022 Contribuidores de Trippy
help_license = Distribuido bajo la Licencia Apache 2.0
help_show_bindings = Presiona [{ $key }] para mostrar todos los atajos
help_show_columns = Presiona [{ $key }] para mostrar todas las columnas
help_show_settings = Presiona [{ $key }] para mostrar todas las configuraciones
help_tagline = Una herramienta de diagnóstico de red
hidden = Oculto
hop = Salto
host = Host
icmp = icmp
info = Información
kilometer = km
labels = etiquetas
name = Nombre
na = n/d
none = ninguno
no = No
no_response = Sin respuesta
not_enabled = no habilitado
not_found = no encontrado
off = inactivo
on = activo
pos = Pos
privacy = privacidad
privileged = privilegiado
rtt = RTT
samples = Muestras
settings_info = Información
settings_tab_bindings_desc = Atajos de teclado Tui
settings_tab_bindings_title = Atajos
settings_tab_columns_desc = Columnas de la tabla Tui. Presiona [{ $c }] para activar o desactivar una columna y usa las teclas [{ $d }] y [{ $u }] para cambiar el orden de las columnas.
settings_tab_columns_title = Columnas
settings_tab_dns_desc = Configuraciones que controlan cómo se realizan las búsquedas de DNS
settings_tab_dns_title = DNS
settings_tab_geoip_desc = Configuraciones relacionadas con GeoIp
settings_tab_geoip_title = GeoIp
settings_table_header_setting = Configuración
settings_table_header_value = Valor
settings_tab_theme_desc = Colores del tema Tui
settings_tab_theme_title = Tema
settings_tab_trace_desc = Configuraciones que controlan la estrategia de rastreo
settings_tab_trace_title = Rastrear
settings_tab_tui_desc = Configuraciones que controlan cómo se muestran los datos en este Tui
settings_tab_tui_title = Tui
status = Estado
status_failed = Fallido
status_failures = { $failure_count } de { $total_probes } ({ $failure_rate }%) sondas fallaron
status_frozen = Congelado
status_running = En ejecución
target = Objetivo
tcp = tcp
title_chart = Gráfico
title_flows = Flujos
title_frequency = Frecuencia
title_help = Ayuda
title_hops = Saltos
title_map = Mapa
title_samples = Muestras
title_settings = Configuraciones
title_traces = Trazas
trippy = trippy
udp = udp
unknown = desconocido
unprivileged = no privilegiado
yes = Sí
Loading