Admin interface allows overwriting any stranslations which is very healful not just for utilizing community translation while updating them with custom phrases that suit a specific community, but at the same time it is also a very good way to gradually translate a new language, without the need of updating the code, hence rebuilding the cache. However, it would be great if the customized translations can be exported from the database and somehoe merged back into the corresponding YAML files to make it available in the main repository. Is there a way of doing that which I am not aware of?
I donât think there is a job for this but 100% support these two tasks, which could help you out here
rake export:locale_overrides:server > server.xx.yml
rake export:locale_overrides:client > client.xx.yml
Qualcuno sa se qualcuno lâha giĂ fatto?
@sam Ho eseguito lâattivitĂ per esportare i locali ma non funziona
Ho il messaggio qui sotto
Non so come creare l'attivitĂ 'export:locale_overrides:server' (Vedi l'elenco delle attivitĂ disponibili con `rake --tasks`)
Qualche idea?
Nessuno ha ancora svolto il compito, aggiungerò un pr-welcome per chiarezza
Questo è qualcosa a cui ho pensato anchâio e ho creato una PR:
Per chiudere il cerchio, io e @mqmenchaca abbiamo lavorato su questo contemporaneamente senza sapere che lâaltro ci stesse lavorando. E siamo arrivati a delle PR a poche ore di distanza! Avevo giĂ unito la mia PR a core poco prima di vedere quella di Max, quindi purtroppo non possiamo unire il suo lavoro in core. Apprezzo molto il contributo, @mqmenchaca!
Il commit che aggiunge questa funzionalità è questo: DEV: Add a rake task to export/import translation overrides (#18487) ¡ discourse/discourse@4d80110 ¡ GitHub
Per esportare, esegui bin/rake export:translation_overrides (creerĂ un file JSON con le sovrascritture).
Per importare in unâistanza separata, copia il file JSON esportato lĂŹ ed esegui bin/rake import:file[\"nomefile\"].
Ciao. Per favore, puoi descrivere i passaggi per eseguirlo?
./launcher enter app
bin/rake export:translation_overrides
Restituisce:
rake aborted!
ActiveRecord::NoDatabaseError: Non è stato possibile trovare il tuo database: discourse. Che si trova nel file di configurazione del database situato in config/database.yml
Sembra essere un problema con il tuo ambiente. Quando entro nel container nella mia istanza self-hosted, posso eseguire comandi rake senza problemi.
Sto usando Discourse dietro Nginx, questo potrebbe essere correlato? Ă possibile usare il comando usando un database esterno al container?
OK, stavo facendo dei test e ho il file esportato.
Se modifico quel file cambiando es_XX in es (e nientâaltro, prestando attenzione al formato e alla codifica dei caratteri del file) e importando il file precedentemente esportato, dovrebbe funzionare?
Voglio spostare le sovrascritture precedenti nella lingua es predefinita sulla nostra istanza ![]()