A Hat in Time

A Hat in Time

Not enough ratings
Changing Languages in Mods
By fred_happyface
This guide explains how to change the language for my mods (providing they support it). Hopefully, this is something that will not be needed for long
   
Award
Favorite
Favorited
Unfavorite
Introduction
This guide explains how to change the language for my mods (providing they support it). Hopefully, this is something that will not be needed for long. The Mod Manager doesn't currently allow non .int files under Localizations which means that Localizations can be made for a mod but not uploaded. The workaround that I used was to create the files but then change the extensions.

Current Translations:
DEU: Deutsch (German)
ESN: espanol (Spanish)
FRA: Francais (French)
INT: English
ITA: italiano (Italian)

Please note that DEU, ESN, FAR and ITA may not be fully correct. If you would like to provide a translation for any of these languages, Please let me know
Finding the mod in file explorer
1 Find the mod on the steam workshop. The URL above is for the 'Bowser In A Dark World' mod. Note the number that has been surrounded in red. This is different for other mods
2 Navigate to C:\Program Files (x86)\Steam\steamapps\workshop\content\253230\[number-in-the-url]
Changing the language
There are two ways to go about this: changing the file extension of the desired languages (see the python script for automation) or copying the desired language to the INT directory.

Changing the file extension of the desired languages
This is the slowest method and is best if you will be changing languages again

1 After completing the previous part, The folder will look something like this

2 Go into the Localization folder

3 Go into each subfolder and change the file extension to the name of the subfolder for every file. For instance in the DEU folder, change the file extension from int to deu. You will get a prompt asking you if you are sure. Click yes and it will change

Copying the desired language to the INT directory
This is the quickest method but you will have to repeat this if you wish to change the language again. For example from French to German, you will have to copy the contents of the DEU directory and replace the contents of INT a second time

1 After completing the previous part, The folder will look something like this

2 Go into the Localization folder

3 Go into the folder of your desired language. As I am English, I went into the ENG folder. Copy everything

4 Go back to the INT folder and paste. A prompt will appear asking if you want to replace the files. Click replace
Python Script
'''
For those of you who would rather run a script, I've just created one. Simply copy and paste the contents of this section into IDLE for Python 3.7 (Python 3 is required). Remember, don't run something you don't trust

Place this at the root of the mod folder. With the cooked folder and the Localizations folder, save the code as .py and run
'''

'''
Changes the file extensions to the correct ones for DEU german ESN
spanish FRA french ITA italian
'''
import os def getListOfFiles(dirName): listOfFile = os.listdir(dirName) allFiles = list() for entry in listOfFile: fullPath = os.path.join(dirName, entry) if os.path.isdir(fullPath): allFiles = allFiles + getListOfFiles(fullPath) else: allFiles.append(fullPath) return allFiles languages = ['DEU', 'ESN', 'FRA', 'ITA'] extensions = ['.deu', '.esn', '.fra', '.ita'] for language in range(len(languages)): files = getListOfFiles("Localization\\" + languages[language]) print(files) for file in files: pre, ext = os.path.splitext(file) os.rename(file, pre + extensions[language])
Updated python script
This adds support for Portuguese
Additional languages can be added by adding them to languages and extensions

''' Changes the file extensions to the correct ones for DEU german ESN spanish FRA french ITA italian ''' import os def getListOfFiles(dirName): listOfFile = os.listdir(dirName) allFiles = list() for entry in listOfFile: fullPath = os.path.join(dirName, entry) if os.path.isdir(fullPath): allFiles = allFiles + getListOfFiles(fullPath) else: allFiles.append(fullPath) return allFiles languages = ['DEU', 'ESN', 'FRA', 'ITA', 'PTB'] extensions = ['.deu', '.esn', '.fra', '.ita', '.ptb'] for language in range(len(languages)): files = getListOfFiles("Localization\\" + languages[language]) print(files) for file in files: pre, ext = os.path.splitext(file) os.rename(file, pre + extensions[language])