Skip to content

Commit

Permalink
Merge pull request #1815 from oasisprotocol/lw/transifex-update
Browse files Browse the repository at this point in the history
i18n: Update translations from Transifex (big Turkish update)
  • Loading branch information
lukaw3d authored Dec 21, 2023
2 parents ded2ae3 + 88ac65b commit be9d4b0
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 67 deletions.
8 changes: 8 additions & 0 deletions .changelog/1815.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
i18n: Update translations from Transifex and add normalization script

The translation procedure was slightly changed. On Transifex, use "Download
file to translate" instead of "Download for use". This will download the
version of the file which includes empty strings for missing translations.
Remove empty strings by calling `yarn extract-messages` which invokes the new
`normalize-translations` script. On the UI, React will replace them with the
English versions automatically.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ translation-ready strings. You can then export the new keys to the

Updating from [Transifex]: [English translation.json] is set as an automatically
updating resource in Transifex, so the new translation strings will appear in
Transifex a few hours after changes are merged. After they are translated, click
"Download for use" on each language, and create a new pull request with title
_"i18n: Update translations from Transifex"_.
Transifex a few hours after changes are merged. After they are translated:

1. click "Download file to translate" on the target languages,
2. `yarn run extract-messages`, and
3. create a new pull request titled _"i18n: Update translations from
Transifex"_.

Adding a new language:

Expand Down
25 changes: 25 additions & 0 deletions internals/scripts/normalize-translations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* "Download for use" from Transifex includes English strings for untranslated.
* "Download file to translate" includes empty strings instead. This removes
* empty strings and then empty groups. react-i18next will automatically
* use the English version of the string, if the translation does not exist.
*
* Usage: `node ./normalize-translations.js ./path/*.json`
*/

const paths = process.argv.slice(2)
paths.forEach(path => {
const translationStr = require('fs').readFileSync(path, 'utf-8')

const cleanedUpTranslation = JSON.stringify(
JSON.parse(translationStr, (k, v) => {
if (v === '') return // Remove untranslated "" fields
if (Object.getPrototypeOf(v) === Object.prototype && Object.keys(v).length === 0) return // Remove empty groups {}
return v
}),
null,
2,
)

require('fs').writeFileSync(path, `${cleanedUpTranslation}\n`, 'utf-8')
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"lint-changelog": "markdownlint --config .changelog/.markdownlint.yml .changelog/",
"changelog": "node ./internals/scripts/changelog.js",
"release-tag": "node ./internals/scripts/release-tag.js",
"extract-messages": "rm src/locales/en/translation.json && i18next-scanner --config=internals/extractMessages/i18next-scanner.config.js",
"extract-messages": "rm src/locales/en/translation.json && i18next-scanner --config=internals/extractMessages/i18next-scanner.config.js && node ./internals/scripts/normalize-translations.js ./src/locales/*/translation.json",
"fix-grommet-icons-types": "node ./internals/scripts/fix-grommet-icons-types.js",
"print-extension-dev-csp": "node ./internals/scripts/print-extension-dev-csp.js"
},
Expand Down
15 changes: 3 additions & 12 deletions src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"summary": {
"balance": {
"available": "Disponible",
"debonding": "Debonding",
"debonding": "Réclamé",
"delegations": "Délégué (stake)",
"total": "Solde total"
},
Expand Down Expand Up @@ -92,7 +92,6 @@
"delegations": {
"activeDelegations": "Délégations actives",
"debondingDelegations": "Délégations réclamées",
"debondingEpoch": "Epoch de récupération",
"delegatedAmount": "Montant délégué",
"reclaimedAmount": "Montant réclamé"
},
Expand Down Expand Up @@ -150,7 +149,6 @@
"openOasisApp": "Ouvrez l'application Oasis sur votre matériel Ledger"
},
"steps": {
"done": "Fin",
"loadingAccounts": "Chargement des adresses",
"loadingBalances": "Chargement du solde des adresses",
"openingUsb": "Ouverture du Ledger via USB"
Expand All @@ -168,10 +166,7 @@
},
"header": "Comment souhaitez-vous ouvrir votre portefeuille ?",
"ledger": {
"cancel": "Annuler",
"header": "Ouvrir à partir d'un matériel Ledger",
"openWallets": "Ouvrir",
"selectWallets": "Sélectionnez les comptes à ouvrir"
"header": "Ouvrir à partir d'un matériel Ledger"
},
"method": {
"ledger": "Ledger",
Expand Down Expand Up @@ -205,17 +200,13 @@
"testnet": "Testnet"
},
"wallets": {
"close": "Fermer",
"switchOtherWallet": "Passer à un autre compte",
"type": {
"ledger": "Ledger",
"mnemonic": "Phrase secrète",
"privateKey": "Clé privée"
}
}
},
"transaction": {
"abort": "Annuler",
"confirm": "Confirmer",
"preview": {
"amount": "Montant",
Expand Down Expand Up @@ -258,6 +249,6 @@
"statusInactive": "Inactif",
"statusUnknown": "Inconnu",
"totalEscrow": "Escrow total",
"unknownValidator": "Unknown validator"
"unknownValidator": "Validateur inconnue"
}
}
161 changes: 148 additions & 13 deletions src/locales/sl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"delegate": "Delegiraj"
},
"addressCopied": "Naslov skopiran.",
"loading": "Nalaganje računa",
"loadingError": "Računa ni mogoče naložiti.",
"reclaimEscrow": {
Expand All @@ -24,6 +25,7 @@
"title": "Ste prepričani, da želite nadaljevati?"
},
"enterAddress": "Vnesite naslov",
"enterAmount": "Vnesite znesek",
"recipient": "Prejemnik",
"send": "Pošlji",
"success": "Transakcija uspešno izvršena. Novo stanje na vašem računu bo prikazano v kratkem."
Expand All @@ -43,7 +45,7 @@
"total": "Stanje"
},
"noTransactionFound": "Ni transakcij",
"noWalletIsOpen": "Za pošiljanje, sprejemanje, vlaganje in menjavo {{ ticker }} morate <HomeLink>odpreti vašo denarnico</HomeLink>!",
"noWalletIsOpen": "Za pošiljanje, sprejemanje, vlaganje in menjavo {{ticker}} morate <HomeLink>odpreti vašo denarnico</HomeLink>!",
"notYourAccount": "To ni vaš račun.",
"yourAccount": "To je vaš račun."
},
Expand All @@ -69,7 +71,7 @@
"loadingError": "Transakcij ni bilo mogoče pridobiti.",
"reclaimEscrow": {
"received": "Vračilo <Amount/> investitorju",
"sent": "Prejeto <Amount/> od overitelja"
"sent": "Zahtevano <Amount/> od overitelja"
},
"stakingAllow": {
"received": "Dobljeno dovoljenje za <Amount/>",
Expand Down Expand Up @@ -145,6 +147,7 @@
"unknown": "Neznana napaka: {{message}}",
"unknownGrpc": "Neznana napaka gRPC: {{message}}",
"unknownLedgerError": "Neznana napaka na Ledgerju: {{message}}",
"unknownParaTimeError": "Neznana napaka v ParaTime: {{message}}",
"usbTransportError": "Napaka na prenosu prek USB: {{message}}",
"usbTransportNotSupported": "Vaš brskalnik ne podpira WebUSB (npr. Firefox). Poskusite z uporabo Chroma."
},
Expand All @@ -161,7 +164,7 @@
"oasisscan": "Deluje s pomočjo Oasis Scan API & Oasis gRPC"
},
"terms": "<TermsLink>Pogoji uporabe</TermsLink>",
"version": "Različica: <CommitLink/>, zgrajena dne {{buildTime}}"
"version": "Različica <ReleaseLink/> (<CommitLink/>) zgrajena {{buildTime}}"
},
"home": {
"create": {
Expand All @@ -176,14 +179,21 @@
}
},
"ledger": {
"extension": {
"connect": "Priklopi Ledger",
"failed": "Priklop spodeletel",
"grantAccess": "Dovoli dostop Ledgerju",
"instructionStep": "Ko bo naprava priklopljena, nadaljujte z uporabo denarnice",
"succeed": "Naprava priklopljena"
},
"instructionSteps": {
"closeLedgerLive": "Zaprite Ledger Live app na računalniku.",
"connectLedger": "Povežite vaš Ledger z računalnikom.",
"header": "Koraki:",
"openOasisApp": "Odprite Oasis App na vašem Ledgerju."
},
"steps": {
"done": "Končano",
"idle": "Na voljo",
"loadingAccounts": "Nalaganje podrobnosti računa",
"loadingBalances": "Nalaganje podrobnosti stanja",
"openingUsb": "Odpiranje Ledgerja prek USB"
Expand All @@ -192,7 +202,10 @@
"menu": {
"closeWallet": "Zapri denarnico",
"home": "Domov",
"lockProfile": "Zakleni profil",
"paraTimes": "ParaTimi",
"stake": "Vlaganje",
"unlockProfile": "Odkleni profil",
"wallet": "Denarnica"
},
"openWallet": {
Expand All @@ -201,7 +214,11 @@
},
"header": "Kako želite odpreti denarnico?",
"importAccounts": {
"accountCounter_one": "Izbran en račun",
"accountCounter_zero": "Ni izbranega računa",
"next": "Nadaljuj",
"openWallets": "Odpri",
"prev": "Nazaj",
"selectWallets": "Izberite račune"
},
"ledger": {
Expand All @@ -228,28 +245,146 @@
"showPrivateKey": "Pokaži zasebni ključ"
}
},
"paraTimes": {
"amount": {
"advanced": "Napredno",
"available": "Na voljo:",
"feeAmountPlaceholder": "Znesek provizije (nano {{ticker}})",
"feeGasPlaceholder": "Gas za provizijo",
"max": "MAX",
"tooltip": "Maks. vrednost bo lahko zmanjšana za provizijo"
},
"common": {
"cipher": "Cipher",
"depositHeader": "Polog na ParaTime",
"emerald": "Emerald",
"evmcType": "(EVMc)",
"sapphire": "Sapphire",
"withdrawHeader": "Dvig iz ParaTima"
},
"confirmation": {
"confirmTransferLabel": "Potrjujem pravilnost zneska in naslova",
"depositLabel": "Položi",
"withdrawLabel": "Dvigni"
},
"footer": {
"back": "Nazaj",
"next": "Naprej"
},
"pageInaccessible": "Prenosi niso na voljo",
"recipient": {
"placeholder": "0x..."
},
"selection": {
"cancel": "Prekliči prenos",
"evmc": "EVMc",
"select": "Izberite ParaTime"
},
"transfers": {
"deposit": "Polog na ParaTime",
"depositDisabled": "Sredstev {{ticker}} za prenos ni na voljo",
"withdraw": "Dvig s ParaTima"
},
"unsupportedFormStep": "Nepodprt korak obrazca",
"validation": {
"insufficientBalanceToPayFee": "Stanje prenizko za plačilo provizije",
"invalidDecimalValue": "Dovoljenih največ {{decimals}} decimalk",
"invalidEthPrivateKey": "Neveljaven zasebni ključ Ethereum",
"invalidEthPrivateKeyLength": "Zasebni ključ mora biti dolg 64 znakov",
"invalidFee": "Vrednost mora biti število, večje ali enako 0",
"required": "Polje je zahtevano",
"unsupportedParaTime": "Nepodprt ParaTime"
}
},
"persist": {
"createProfile": {
"choosePassword": "Izberite geslo",
"passwordMismatch": "Geslo se ne ujema",
"repeatPassword": "Ponovno vnesite geslo",
"startPersisting": "Lokalno shrani zasebne ključe, zaščitene z geslom",
"unsupported": "Shramba na tem brskalniku ni podprta"
},
"loading": "Nalaganje",
"loginToProfile": {
"deleteProfile": {
"button": "Izbriši profil",
"description": "Ali ste prepričani, da želite izbrisati ta profil? To bo <strong>izbrisalo vaše zasebne ključe</strong> in ne bo jih mogoče obnoviti. <br/><br/> Če želite nadaljevati vnesite '{{confirmationKeyword}}'.",
"title": "Izbriši Profil"
},
"description": "Za dostop do obstoječe denarnice na tem brskalniku se prijavite v vaš profil",
"enterPasswordHere": "Vnesite geslo",
"hidePassword": "Skrij geslo",
"showPassword": "Prikaži gesl",
"skipUnlocking": "Nadaljuj brez uporabe profila",
"title": "Dobrodošli nazaj!",
"unlock": "Odkleni",
"wrongPassword": "Napačno geslo"
}
},
"theme": {
"darkMode": "Temni način",
"lightMode": "Svetli način"
"lightMode": "Svetli način",
"title": "Tema"
},
"toolbar": {
"contacts": {
"add": "Dodaj Stik",
"address": "Naslov",
"cancel": "Prekliči",
"delete": {
"button": "Izbriši stik",
"confirm": "Da, izbriši",
"description": "Ste prepričani, da želite izbrisati ta stik?",
"title": "Izbriši Stik"
},
"emptyList": "Nimate stikov.",
"manage": "Upravljaj stik",
"name": "Ime",
"notAvailable": "Da pričnete dodajati stike, najprej ustvarite profil med <OpenWalletButton>odpiranjem denarnice</OpenWalletButton>.",
"save": "Shrani",
"validation": {
"addressError": "Vnesite veljaven naslov denarnice.",
"addressNotUniqueError": "Naslov že obstaja",
"nameLengthError": "Največ 16 znakov",
"required": "Polje je obvezno"
}
},
"networks": {
"local": "Lokalno",
"mainnet": "Mainnet",
"testnet": "Testnet"
},
"profile": {
"deletion": "Brisanje"
},
"settings": {
"cancel": "Prekliči",
"contacts": "Stiki",
"delete": {
"description": "Ali ste prepričani, da želite izbrisati ta račun?",
"inputHelp": "Tega ne bo mogoče razveljaviti. Če želite nadaljevati vnesite '{{confirmationKeyword}}'.",
"title": "Izbriši Račun"
},
"exportPrivateKey": {
"hint2": "Ključa ni mogoče obnoviti, če ga izgubite. Poskrbite, da imate varnostno kopijo zasebnega ključa shranjeno na varnem mestu.",
"title": "Izvozi Zasebni Ključ"
},
"myAccountsTab": "Moji računi",
"nameLengthError": "Največ 16 znakov",
"profile": "Profil",
"save": "Shrani",
"settings": "Nastavitve"
},
"wallets": {
"close": "Zapri",
"switchOtherWallet": "Izberite račun",
"type": {
"ledger": "Ledger",
"mnemonic": "Mnemonik",
"privateKey": "Zasebni ključ"
"privateKey": "Zasebni ključ",
"usbLedger": "USB Ledger"
}
}
},
"transaction": {
"abort": "Prekini",
"cancel": "Prekliči",
"confirm": "Potrdi",
"preview": {
"amount": "Znesek",
Expand All @@ -270,9 +405,9 @@
"submitting": "Pošiljanje transakcije"
},
"types": {
"addEscrow": "Delegiranje vaših kovancev overiteljem",
"reclaimEscrow": "Vračilo delegiranih kovancev na vaš račun",
"transfer": "Prenos kovancev z vašega na tuj račun"
"addEscrow": "delegiranje vaših kovancev overiteljem",
"reclaimEscrow": "vračilo delegiranih kovancev na vaš račun",
"transfer": "prenos kovancev z vašega na tuj račun"
}
},
"validator": {
Expand Down
Loading

0 comments on commit be9d4b0

Please sign in to comment.