Add more translations

This adds Nutaku-sourced translations for:
* masterItem
* masterWorldMap
* masterCharacterTextResource
* masterCharacterLeaderSkill
* masterCharacterBook
* masterCharacterCategory
This commit is contained in:
Les De Ridder 2017-08-20 03:05:43 +02:00
parent 9b3872142a
commit 4c6d3a5f30
8 changed files with 139 additions and 1 deletions

View File

@ -8,7 +8,7 @@ function extractFields
set secondColumn $argv[3]
# For some tables (e.g. masterStage), commas aren't allowed even in quoted strings (though the Nutaku version handles them just fine)
csvquote | cut -d, -f $firstColumn,$secondColumn | sed "s/\"/\\\\\"/g;s/\(.*\),\(.*\)/$name\[\1\] = \"\2\";/;s/\x1F/、/g"
csvquote | cut -d, -f $firstColumn,$secondColumn | sed "s/\x93/“/g;s/\x94/”/g;s/\x85/…/g;s/\x91//g;s/\x92//g;s/\"/\\\\\"/g;s/\(.*\),\(.*\)/$name\[\1\] = \"\2\";/;s/\x1F/、/g"
end
function extractCsv
@ -30,3 +30,18 @@ extractCsv 'Mission' | extractFields 'missionRewards' 1 4 > data/missionRewards.
extractCsv 'Dungeon' | extractFields 'dungeonNames' 10 12 > data/dungeonNames.data.d
extractCsv 'Guest' | extractFields 'guestPartyNames' 1 2 > data/guestPartyNames.data.d
extractCsv 'Item' | extractFields 'itemNames' 1 2 > data/itemNames.data.d
extractCsv 'WorldMap' | extractFields 'worldMapLocationNames' 1 4 > data/worldMapLocationNames.data.d
extractCsv 'WorldMap' | extractFields 'worldMapLocationCaptions' 1 5 > data/worldMapLocationCaptions.data.d
extractCsv 'WorldMap' | extractFields 'worldMapLocationDescriptions' 1 6 > data/worldMapLocationDescriptions.data.d
extractCsv 'CharacterTextResource' | extractFields 'characterTextResource' 1 4 > data/characterTextResource.data.d
extractCsv 'CharacterLeaderSkill' | extractFields 'characterLeaderSkillNames' 1 2 > data/characterLeaderSkillNames.data.d
extractCsv 'CharacterLeaderSkill' | extractFields 'characterLeaderSkillDescriptions' 1 7 > data/characterLeaderSkillDescriptions.data.d
extractCsv 'CharacterBook' | extractFields 'characterBookFlowerLanguage' 1 5 > data/characterBookFlowerLanguage.data.d
extractCsv 'CharacterCategory' | extractFields 'characterCategories' 1 2 > data/characterCategories.data.d

View File

@ -181,6 +181,75 @@ Json handleResponse(string endpoint, Json json)
}
}
foreach(item; getMasterResponse.masterItem)
{
auto itemId = item[0].to!uint;
import translations.item;
if(itemId in itemNames)
{
item[1] = itemNames[itemId];
}
}
foreach(location; getMasterResponse.masterWorldMap)
{
auto locationId = location[0].to!uint;
import translations.worldMap;
if(locationId in worldMapLocationNames)
{
location[3] = worldMapLocationNames[locationId];
location[4] = worldMapLocationCaptions[locationId];
location[5] = worldMapLocationDescriptions[locationId];
}
}
foreach(resource; getMasterResponse.masterCharacterTextResource)
{
auto resourceId = resource[0].to!uint;
import translations.characterTextResource;
if(resourceId in characterTextResource)
{
resource[3] = characterTextResource[resourceId];
}
}
foreach(leaderSkill; getMasterResponse.masterCharacterLeaderSkill)
{
auto leaderSkillId = leaderSkill[0].to!uint;
import translations.characterLeaderSkill;
if(leaderSkillId in characterLeaderSkillNames)
{
leaderSkill[1] = characterLeaderSkillNames[leaderSkillId];
leaderSkill[14] = characterLeaderSkillDescriptions[leaderSkillId];
}
}
foreach(characterBookEntry; getMasterResponse.masterCharacterBook)
{
auto characterId = characterBookEntry[0].to!uint;
import translations.characterBook;
if(characterId in characterBookFlowerLanguage)
{
characterBookEntry[5] = characterBookFlowerLanguage[characterId];
}
}
foreach(characterCategory; getMasterResponse.masterCharacterCategory)
{
auto categoryId = characterCategory[0].to!uint;
import translations.characterCategory;
if(categoryId in characterCategories)
{
characterCategory[1] = characterCategories[categoryId];
}
}
return getMasterResponse.serializeToJson;
}

View File

@ -0,0 +1,8 @@
module translations.characterBook;
string[uint] characterBookFlowerLanguage;
static this()
{
mixin(import("characterBookFlowerLanguage.data.d"));
}

View File

@ -0,0 +1,8 @@
module translations.characterCategory;
string[uint] characterCategories;
static this()
{
mixin(import("characterCategories.data.d"));
}

View File

@ -0,0 +1,10 @@
module translations.characterLeaderSkill;
string[uint] characterLeaderSkillNames;
string[uint] characterLeaderSkillDescriptions;
static this()
{
mixin(import("characterLeaderSkillNames.data.d"));
mixin(import("characterLeaderSkillDescriptions.data.d"));
}

View File

@ -0,0 +1,8 @@
module translations.characterTextResource;
string[uint] characterTextResource;
static this()
{
mixin(import("characterTextResource.data.d"));
}

View File

@ -0,0 +1,8 @@
module translations.item;
string[uint] itemNames;
static this()
{
mixin(import("itemNames.data.d"));
}

View File

@ -0,0 +1,12 @@
module translations.worldMap;
string[uint] worldMapLocationNames;
string[uint] worldMapLocationCaptions;
string[uint] worldMapLocationDescriptions;
static this()
{
mixin(import("worldMapLocationNames.data.d"));
mixin(import("worldMapLocationCaptions.data.d"));
mixin(import("worldMapLocationDescriptions.data.d"));
}