Skip to content

Commit

Permalink
0.2.0.3, German.
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Apr 28, 2018
1 parent a01db27 commit 447ab68
Show file tree
Hide file tree
Showing 11 changed files with 806 additions and 7 deletions.
6 changes: 4 additions & 2 deletions HEROsMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class HEROsMod : Mod
public override void Load()
{
// Since we are using hooks not in older versions, and since ItemID.Count changed, we need to do this.
if (ModLoader.version < new Version(0, 10))
if (ModLoader.version < new Version(0, 10, 1, 3))
{
throw new Exception(HEROsMod.HeroText("UpdateTModLoaderToUse"));
}
Expand All @@ -40,7 +40,7 @@ public override void Load()

FieldInfo translationsField = typeof(Mod).GetField("translations", BindingFlags.Instance | BindingFlags.NonPublic);
translations = (Dictionary<string, ModTranslation>)translationsField.GetValue(this);
LoadTranslations();
//LoadTranslations();

// AddGlobalItem("HEROsModGlobalItem", new HEROsModGlobalItem());
// AddPlayer("HEROsModModPlayer", new HEROsModModPlayer());
Expand Down Expand Up @@ -205,6 +205,7 @@ public override bool HijackGetData(ref byte messageType, ref BinaryReader reader
return false;
}

/*
private void LoadTranslations()
{
// 0.10.1.2 already does this
Expand Down Expand Up @@ -248,6 +249,7 @@ private void LoadTranslations()
AddTranslation(value);
}
}
*/

//public override Matrix ModifyTransformMatrix(Matrix Transform)
//{
Expand Down
6 changes: 6 additions & 0 deletions Localization/TranslationsNeeded.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ru-RU 1
pt-BR 153
pl-PL 153
it-IT 153
fr-FR 153
es-ES 153
19 changes: 17 additions & 2 deletions Localization/UpdateLocalizationFiles.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import os.path

# Run this script after updating en-US.tModLoader.json with new keys. python 3.
# tModLoader .lang file updater by jopojelly. (v1.0)
# Run this script after updating en-US.lang with new keys. python 3.
# Also make sure the file encodings are UTF-8 not UTF-8-BOM.
# You can use this script for your own mod if you credit me.

filename = './{0}.lang'

languages = ['zh-Hans', 'ru-RU', 'pt-BR', 'pl-PL', 'it-IT', 'fr-FR', 'es-ES', 'de-DE']
missings = []
for language in languages:
if not os.path.isfile(filename.format(language)):
continue
with open(filename.format(language), 'w', encoding='utf-8') as output:
output.write("# Translation by: \n\nmissing=missing")
#continue
#language = 'zh-Hans'
otherLanguage = ''
missing = 0
Expand All @@ -18,6 +23,7 @@

# Preserve Credits (comment lines on first few lines)
otherLinesAll = other.readlines()

for otherLine in otherLinesAll:
if otherLine.startswith('#'):
otherLanguage += otherLine
Expand All @@ -27,6 +33,8 @@
# Skip empty whitespace and comment lines to end up with only json lines.
otherLines = [x for x in otherLinesAll if not (x.startswith("#") or len(x.strip()) == 0)]

if len(otherLines) == 0:
otherLines.append('TrashEntry') # just to prevent Index out of Range
otherIndex = 0
engComments = True
for englishIndex, englishLine in enumerate(enLines):
Expand Down Expand Up @@ -54,9 +62,16 @@
#print(otherLanguage)
# Save changes.
if missing > 0:
missings.append( (language, missing) )
print(language,missing)
with open(filename.format(language), 'w', encoding='utf-8') as output:
output.write(otherLanguage)

with open('./TranslationsNeeded.txt', 'w', encoding='utf-8') as output:
if len(missings) == 0:
output.write('All Translations up-to-date!')
else:
for entry in missings:
output.write(str(entry[0]) + " " + str(entry[1]) + "\n")
#print("Make sure to run Diff.")
#input("Press Enter to continue...")
155 changes: 155 additions & 0 deletions Localization/es-ES.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Translation by:

# UpdateTModLoaderToUse=\nThis mod uses functionality only present in the latest tModLoader. Please update tModLoader to use this mod\n\n
# EnableInfiniteReach=Enable Infinite Reach
# DisableInfiniteReach=Disable Infinite Reach
# SmartCursorAutomaticallyDisabledInfinteReachMod=Smart Cursor automatically disabled in infinte reach mode.
# ViewWaypoints=View Waypoints
# AddWaypoint=Add Waypoint
# Waypoints=Waypoints
# WaypointName=Waypoint Name
# WaypointAlreadyExistsNote=A waypoint with this name already exists, please enter another name.
# DisableGravestones=Disable Gravestones
# EnableGravestones=Enable Gravestones
# YouHaveEnabledGravestones=You have enabled gravestones
# YouHaveDisabledGravestones=You have disabled gravestones
# SetSpawnPoint=Set Spawn Point
# SpawnPointSetToXY=Spawn Point set to X:{0} Y:{1}
# ChangeTimeRain=Change Time/Rain
# StartRain=Start Rain
# StopRain=Stop Rain
# StartSandstorm=Start Sandstorm
# StopSandstorm=Stop Sandstorm
# Night=Night
# Noon=Noon
# ResumeTime=Resume Time
# PauseTime=Pause Time
# ForceEnchantedSundial=Force Enchanted Sundial
# RainHasBeenTurnedOff=Rain has been turned off
# RainHasBeenTurnedOn=Rain has been turned on
# SandstormHasBeenTurnedOff=Sandstorm has been turned off
# SandstormHasBeenTurnedOn=Sandstorm has been turned on
# TimeHasBeenPaused=Time has been paused
# TimeHasResumed=Time has resumed
# RegionsVisible=Regions Visible
# RegionsInvisible=Regions Invisible
# OpenRegionsWindow=Open regions window
# ToggleRegionsVisible=Toggle Regions Visible
# PleaseMakeASelection=Please make a selection.
# LastChangedBy=Last changed by {0}
# SelectPlayer=Select Player
# SelectGroup=Select Group
# CreateRegion=Create Region
# Regions=Regions
# DeleteRegion=Delete Region
# AddGroup=Add Group
# AddPlayer=Add Player
# SaveColor=Save Color
# SelectedRegion=Selected Region {0} {1}
# Remove=Remove
# Group=Group
# User=User
# RegionName=Region Name
# Ok=Ok
# Confirm=Confirm
# Create=Create
# Cancel=Cancel
# RegionNameTooShort=Region name must be at least 3 characters long
# RightClickToTeleport=Right Click to teleport
# PrefixEditor=Prefix Editor
# OpenMobSpawnWindow=Open Mob Spawn Window
# NPCSpawner=NPC Spawner
# All=All
# TownNPCs=Town NPCs
# Friendly=Friendly
# Boss=Boss
# Mod=Mod
# UnderworldToSpawnWoF=Please move to the underworld to spawn WoF
# MiscOptions=Misc. Options
# RevealMap=Reveal Map
# ClearItemsOnGround=Clear Items on Ground
# ItemsOnTheGroundWereCleared=Items on the ground were cleared
# ItemBrowser=Item Browser
# OpenEventStarter=Open Event Starter
# AllEventsHaveBeenStopped=All events have been stopped
# Events=Events
# StopEvents=Stop Events
# ViewConnectedPlayers=View Connected Players
# ConnectedPlayers=Connected Players
# OfflineUsers=Offline Users
# OpenGroupManagement=Open Group Management
# GroupManagement=Group Management
# Apply=Apply
# DeleteGroup=Delete Group
# NewGroup=New Group
# Groups=Groups
# GroupName=Group Name
# AreYouSureDeleteGroup=Are you sure you want to delete the {0} group?
# ToggleGodMode=Toggle God Mode
# GodModeEnabled=God Mode Enabled
# GodModeDisabled=God Mode Disabled
# FlyCamEnableTooltip=Enable Fly Camera (RMB: Lock Camera)
# FlyCamDisableTooltip=Disable Fly Camera (RMB: Lock Camera)
# FlyCamInstructions=Arrow Keys to pan, Shift for faster, Alt for slower
# DisableEnemySpawns=Disable Enemy Spawns
# EnableEnemySpawns=Enable Enemy Spawns
# EnemySpawnsEnabled=Enemy spawns enabled
# EnemySpawnsDisabled=Enemy spawns disabled
# ExtensionTools=Extension Tools
# NoExtensionsLoadedNote=No mods loaded that add Extensions. See forum post for compatible mods.
# OpenBuffWindow=Open Buff Window
# Buffs=Buffs
# Seconds=Seconds
# Login=Login
# Logout=Logout
# Register=Register
# Password=Password
# Username=Username
# PleaseFillInUsernamePassword=Please fill in the Username and Password fields.
# BanDestructiveExplosives=Ban Destructive Explosives
# UnbanDestructiveExplosives=Unban Destructive Explosives
# ProjectileIsBannerdOnTheServer={0} is banned on the server
# MakesYouAdminInHEROsMod=Makes you Admin in HERO's Mod
# AuthCodeIsIncorrect=Auth code is incorrect
# PleaseLoginFirst=Please login first
# YouAreNowAdmin=You are now Admin
# AdminInstructionsCommandDescription=Informs you how to become Admin in HERO's Mod
# DedicatedServerAutoMessage=HERO's Mod: Create an account, login, and type /auth {0} to become Admin.
# YouDoNotHavePermissionToBuildHere=You do not have permission to build here
# LightHackDisabled=Light Hack: Disabled
# LightHack25%=Light Hack: 25%
# LightHack50%=Light Hack: 50%
# LightHack100%=Light Hack: 100%
# CheckTileForLastModification=Check Tile for last modification
# AccountAlreadyLoggedIn=This account is already logged on in this server.
# LoggedInSuccessfully=You have successfully logged in. You are in the {0} Group.
# InvalidUsernameOrPassword=Invalid Username or Password
# UsernameAlreadyTaken=This username has already been taken.
# SuccessfullyRegistered=You have successfully registered. Please login.
# GroupAlreadyExists=A group with this name already exist
# CantDeleteDefaultGroup=You can not delete the default group.
# LoginInstructions=Click the 'Login' button on the HEROsMod hotbar to Login or Create an Account
# TimeChangedNoonBy=The time has been changed to noon by {0}
# TimeChangedMidnightBy=The time has been changed to midnight by {0}
# TimeChangedNightBy=The time has been changed to night by {0}
# TimePausedBy=Time has been paused by {0}
# TimeResumedBy=Time has been resumed by {0}
# ItemsClearedBy=Items on the ground were cleared by {0}
# EnemySpawnsEnabledBy=Enemy spawns were enabled by {0}
# EnemySpawnsDisabledBy=Enemy spawns were disabled by {0}
# RainTurnedOnBy=Rain has been turned on by {0}
# RainTurnedOffBy=Rain has been turned off by {0}
# SandstormTurnedOnBy=Sandstorm has been turned on by {0}
# SandstormTurnedOffBy=Sandstorm has been turned off by {0}
# ForcedEnchangedSundialBy=Forced Enchanted Sundial initiated by {0}
# WaypointAlreadyExists=A waypoint with this name already exists, please enter another name.
# RegionCreatedBy='{0}' region created by {1};
# SpawnPointSetToBy=Spawn Point set to X:{0} Y:{1} by {2}
# GravestonesEnabledBy=Gravestones were enabled by {0}
# GravestonesDisabledBy=Gravestones were disabled by {0}
# TileLastModifiedBy=Tile last modified by {0}
# TileNotModified=This tile has not been modified since last server boot up.
# YouDontHavePermissionToDoThat=You don't have permission to do that.
# EventsStoppedBy=All events have been stopped by {0}
# DestructiveExplosivesBannedBy=Destructive Explosives banned by {0}
# DestructiveExplosivesUnbannedBy=Destructive Explosives unbanned by {0}
Loading

0 comments on commit 447ab68

Please sign in to comment.