Jump to content
LaunchBox Community Forums

Change language of games description


orphen78

Recommended Posts

LaunchBox is translated into French but I'm not sure if only the program is in French and the metadata is in English as I've only ever used it in English. If that is the case I have no clue where you could find French translated metadata.
Link to comment
Share on other sites

Unfortunately all of the metadata we pull is in English and we would have to have it all translated in to other languages for it to work where you can read the information that way. Adding a french Wiki is not all that easy, especially since the current Wiki we have is actually poorly implemented (because of the Wiki API though, not anything we did). We agree it would be awesome for us to be able to have all of our metadata in a different language, but it's hard. If you can find a program that translates text easily in bulk, you could theoretically edit your metadata.xml file. This is where all the information is stored from the Database. Only problem is, every time it updates you would have to re-translate it, so every time it asks you or every time you update LaunchBox. That would also not automatically put the information in your LaunchBox library. You would have to re-import all of your metadata. Only downside is if the Metadata.xml has other words in it other than the description, like the games name or formatting text, then translating it will also translate all of that and your scraping would probably break. So you'd have to pull out all of the description text, translate it, re-insert it, then re-scrape your metadata.
Link to comment
Share on other sites

A French user in the BigBox theme thread mentioned a scraper that has French and UK descriptions for games (Used Google translate. Could be possible I misunderstood).Here is a link to the post: https://www.launchbox-app.com/forum/big-box-custom-themes/bigbox-user-create-theme-mega-thread-share-your-custom-made-themes/page-5#p20786 As far as how to then get this metadata into LaunchBox, I have no clue.
  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 4 years later...

Salut @Urtu@despes!

Effectivement , tout est en anglais de base plusieurs possibilités s'offre à toi

tu peux passer par scrapper qui te traduira l'ensemble mais de mon expérience ça marche plus ou moins bien (j'ai tenté une fois et ça m'as mis un bordel sans nom )

sinon , tu peux le faire à la main , c'est comme ça je fonctionne pour ma pars , ça me permet de mettre mes propres commentaire .

Tu peux faire un traduction rapide en te servant de google trad en mettant à cheval  en laissant ta fenêtre note metadata ouverte et de l'autre côté une fenêtre google translate .

Ca va assez vite mine de rien quand tu as pris le coup de main.

C'est ce que j'ai fais pour la Zelda Ultima , j'ai tout traduit au fur et à mesure . :)

 

 

Edited by PaDeMoNiuM
Link to comment
Share on other sites

  • 1 year later...

 

Hey guys.


I was having the same problem here. I looked for many posts here and on the internet and nothing. The only way I found to translate the metadata was to create a python script myself. How difficult it was, I will share it with you.

To work you need:
- Back up Lauchbox metadata (currently going to tools/file management/Create data backup);
- Download/install the latest version of python and run the attached .exe.
- Run the attached .exe file and choose the files to translate.
- Restore the already translated backup.

If the .exe file doesn't work, alternatively run the code below (you need Python too):

import xml.etree.ElementTree as ET
from googletrans import Translator
from tkinter import Tk, filedialog

# Função de tradução de texto
def translate_text(text, dest_language):
    translator = Translator()
    try:
        translated_text = translator.translate(text, dest=dest_language).text
        return translated_text
    except Exception as e:
        print(f"Erro na tradução: {e}")
        return text

# Função para traduzir o campo "Notes" em um arquivo XML
def translate_notes_in_xml(file_path, dest_language):
    tree = ET.parse(file_path)
    root = tree.getroot()

    for element in root.iter('Notes'):
        if element.text and not element.text.isspace():
            translated_text = translate_text(element.text, dest_language)
            element.text = translated_text

    tree.write(file_path)

# Função para escolher vários arquivos XML
def choose_files():
    root = Tk()
    root.withdraw()
    files = filedialog.askopenfilenames(filetypes=[("XML Files", "*.xml")])
    root.destroy()
    return files

# Função para traduzir o campo "Notes" em vários arquivos XML escolhidos
def translate_notes_in_selected_files(files, dest_language):
    for file_path in files:
        print(f"Traduzindo campo 'Notes' no arquivo: {file_path}")
        translate_notes_in_xml(file_path, dest_language)

# Escolha de vários arquivos XML
selected_files = choose_files()

# Escolha do idioma de destino
destination_language = input("Enter the target language code (e.g. pt for Portuguese, fr for French, it for Italian, etc.): ")

# Verifica se arquivos foram selecionados e se o idioma foi fornecido
if selected_files and destination_language:
    translate_notes_in_selected_files(selected_files, destination_language)
else:
    print("Nenhum arquivo selecionado ou idioma de destino não fornecido.")

 

 

translate.7z

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...