Repository navigation
fix: translate subnet calculator labels (i18n) - #467
Conversation
|
Thanks for the first pull request here. CI needs a maintainer to approve the run before it starts, so it may sit for a bit before anything happens. |
|
Thanks for picking this up, and the
|
c91d0e3 to
2719d43
Compare
|
Thanks for the review! You are completely right—the automated JSON writer completely wrecked the formatting by expanding the compact objects. I have:
I ran |
2719d43 to
b0c4ff6
Compare
NovaCode37
left a comment
There was a problem hiding this comment.
Thanks, the JSON is clean now and the component wiring is right. Two things before merge.
1. A missing key breaks the Email Headers panel. The diff changes label="IP" to label={t('toolPanels.headers.ip')}, but toolPanels.headers.ip doesn't exist in any locale, so that row now renders the raw key instead of "IP". npm run test:i18n passes because every locale is missing it equally. Please add "ip": "IP" to the headers block in all 10 locales (same value everywhere).
2. The subnet labels are still in English in the non-English locales. #465 is specifically to translate them, so right now the Russian UI still shows Network Address and so on. Please translate the values. Here are the blocks ready to paste, keep en.json as it is:
ru.json
"subnet": {
"calculate": "Рассчитать",
"networkAddress": "Адрес сети",
"subnetMask": "Маска подсети",
"wildcardMask": "Обратная маска",
"broadcastAddress": "Широковещательный адрес",
"firstUsableIp": "Первый доступный IP",
"lastUsableIp": "Последний доступный IP",
"usableHosts": "Доступные хосты",
"totalAddresses": "Всего адресов",
"ipType": "Тип IP"
},de.json
"subnet": {
"calculate": "Berechnen",
"networkAddress": "Netzwerkadresse",
"subnetMask": "Subnetzmaske",
"wildcardMask": "Wildcard-Maske",
"broadcastAddress": "Broadcast-Adresse",
"firstUsableIp": "Erste nutzbare IP",
"lastUsableIp": "Letzte nutzbare IP",
"usableHosts": "Nutzbare Hosts",
"totalAddresses": "Adressen gesamt",
"ipType": "IP-Typ"
},es.json
"subnet": {
"calculate": "Calcular",
"networkAddress": "Dirección de red",
"subnetMask": "Máscara de subred",
"wildcardMask": "Máscara wildcard",
"broadcastAddress": "Dirección de difusión",
"firstUsableIp": "Primera IP utilizable",
"lastUsableIp": "Última IP utilizable",
"usableHosts": "Hosts utilizables",
"totalAddresses": "Direcciones totales",
"ipType": "Tipo de IP"
},fr.json
"subnet": {
"calculate": "Calculer",
"networkAddress": "Adresse réseau",
"subnetMask": "Masque de sous-réseau",
"wildcardMask": "Masque générique",
"broadcastAddress": "Adresse de diffusion",
"firstUsableIp": "Première IP utilisable",
"lastUsableIp": "Dernière IP utilisable",
"usableHosts": "Hôtes utilisables",
"totalAddresses": "Adresses totales",
"ipType": "Type d'IP"
},it.json
"subnet": {
"calculate": "Calcola",
"networkAddress": "Indirizzo di rete",
"subnetMask": "Maschera di sottorete",
"wildcardMask": "Maschera wildcard",
"broadcastAddress": "Indirizzo di broadcast",
"firstUsableIp": "Primo IP utilizzabile",
"lastUsableIp": "Ultimo IP utilizzabile",
"usableHosts": "Host utilizzabili",
"totalAddresses": "Indirizzi totali",
"ipType": "Tipo di IP"
},pl.json
"subnet": {
"calculate": "Oblicz",
"networkAddress": "Adres sieci",
"subnetMask": "Maska podsieci",
"wildcardMask": "Maska odwrotna",
"broadcastAddress": "Adres rozgłoszeniowy",
"firstUsableIp": "Pierwszy użyteczny IP",
"lastUsableIp": "Ostatni użyteczny IP",
"usableHosts": "Użyteczne hosty",
"totalAddresses": "Łączna liczba adresów",
"ipType": "Typ IP"
},pt.json
"subnet": {
"calculate": "Calcular",
"networkAddress": "Endereço de rede",
"subnetMask": "Máscara de sub-rede",
"wildcardMask": "Máscara curinga",
"broadcastAddress": "Endereço de broadcast",
"firstUsableIp": "Primeiro IP utilizável",
"lastUsableIp": "Último IP utilizável",
"usableHosts": "Hosts utilizáveis",
"totalAddresses": "Total de endereços",
"ipType": "Tipo de IP"
},tr.json
"subnet": {
"calculate": "Hesapla",
"networkAddress": "Ağ Adresi",
"subnetMask": "Alt Ağ Maskesi",
"wildcardMask": "Wildcard Maskesi",
"broadcastAddress": "Yayın Adresi",
"firstUsableIp": "İlk Kullanılabilir IP",
"lastUsableIp": "Son Kullanılabilir IP",
"usableHosts": "Kullanılabilir Host Sayısı",
"totalAddresses": "Toplam Adres",
"ipType": "IP Türü"
},zh.json
"subnet": {
"calculate": "计算",
"networkAddress": "网络地址",
"subnetMask": "子网掩码",
"wildcardMask": "通配符掩码",
"broadcastAddress": "广播地址",
"firstUsableIp": "第一个可用 IP",
"lastUsableIp": "最后一个可用 IP",
"usableHosts": "可用主机数",
"totalAddresses": "地址总数",
"ipType": "IP 类型"
},If you'd rather translate them yourself, that's welcome too. After the key fix and translations, npm run test:i18n should stay green and this is good to merge.
|
Done!
I've verified that |
NovaCode37
left a comment
There was a problem hiding this comment.
Thanks, the missing key is in and every locale is translated now. Merging.
Fixes #465
Summary
This PR resolves issue #465 by replacing the hardcoded English labels in the Subnet Calculator (
ToolPanels.tsx) with proper i18n tags. It also identifies and translates the hardcoded "IP" label inside theHeadersPanel(line 553), completing the requirement that no hardcoded uppercase tags remain.Changes Made
frontend/src/components/tools/ToolPanels.tsxto uset('toolPanels.subnet.*')for all subnet calculation outputs, andt('toolPanels.headers.ip')for the IP header field.frontend/src/messages/.npm run test:i18n(passed) andnpm run build(passed).Verification
grep -nE 'label="[A-Z]' frontend/src/components/tools/ToolPanels.tsxreturns nothing.npm run test:i18npasses perfectly with 10 locales, 436 keys each.