81 lines
2.6 KiB
PHP
81 lines
2.6 KiB
PHP
<?php
|
|
require __DIR__ . '/vendor/autoload.php';
|
|
require __DIR__ . '/env.php';
|
|
$deeplClient = new \DeepL\DeepLClient($deepl_api_key);
|
|
|
|
$dicts = [];
|
|
$dicts []= new \DeepL\MultilingualGlossaryDictionaryEntries('zh', 'en', [
|
|
'兽设' => 'fursona',
|
|
'兽人' => 'furry character',
|
|
'兽控' => 'furry',
|
|
'毛毛' => 'fursuit',
|
|
'兽装' => 'fursuit',
|
|
'兽聚' => 'furcon',
|
|
'大佬' => 'da lao',
|
|
'丸吞' => 'vore',
|
|
'哦不' => 'oh no',
|
|
'哦哇塞' => 'o wa sai',
|
|
'哇塞' => 'wa sai',
|
|
'色色' => 'sese',
|
|
'変态' => 'hentai',
|
|
]);
|
|
$dicts []= new \DeepL\MultilingualGlossaryDictionaryEntries( 'en', 'zh', [
|
|
'fursona' => '兽设',
|
|
'furry character' => '兽人',
|
|
'furry' => '兽控',
|
|
'fursuit' => '兽装',
|
|
'furcon' => '兽聚',
|
|
'hentai' => '変态',
|
|
'sese' => '色色',
|
|
'sheshe' => '射射',
|
|
'wun tun' => '丸吞',
|
|
'vore' => '丸吞',
|
|
'money power' => '钞能力',
|
|
'oh no' => '哦不',
|
|
'touch fish' => '摸鱼',
|
|
'o wa sai' => '哦哇塞',
|
|
'wa sai' => '哇塞',
|
|
'commission' => '委托',
|
|
'dalao' => '大佬',
|
|
]);
|
|
$dicts []= new \DeepL\MultilingualGlossaryDictionaryEntries( 'en', 'ja', [
|
|
'fursuit' => '着ぐるみ',
|
|
'vore' => '丸呑み',
|
|
'bussy' => 'ケツマンコ',
|
|
'hentai' => '変態',
|
|
'oppai' => 'おっぱい',
|
|
'ochinchin' => 'おちんちん',
|
|
'kemoner' => 'ケモナー',
|
|
'furry' => 'ファーリー',
|
|
]);
|
|
$dicts []= new \DeepL\MultilingualGlossaryDictionaryEntries( 'ja', 'en', [
|
|
'着ぐるみ' => 'fursuit',
|
|
'丸呑み' => 'vore',
|
|
'ケツマンコ' => 'bussy',
|
|
'変態' => 'hentai',
|
|
'おっぱい' => 'oppai',
|
|
'おちんちん' => 'ochinchin',
|
|
'ケモナー' => 'kemoner',
|
|
'ファーリー' => 'furry',
|
|
]);
|
|
|
|
$GLOSSARY_NAME = 'Furry glossary';
|
|
echo("Checking for existing copy of \"$GLOSSARY_NAME\"...\n");
|
|
foreach ($deeplClient->listMultilingualGlossaries() as $glossary) {
|
|
if ($glossary->name === $GLOSSARY_NAME) {
|
|
echo("Found existing ID $glossary->glossaryId, updating in-place\n");
|
|
$found = true;
|
|
foreach ($dicts as $dict) {
|
|
echo ('- Replacing dictionary for ' . $dict->sourceLang . ' to ' . $dict->targetLang . "\n");
|
|
$deeplClient->replaceMultilingualGlossaryDictionary($glossary, $dict);
|
|
}
|
|
echo("Done");
|
|
exit(0);
|
|
}
|
|
}
|
|
|
|
echo("No existing glossary found, creating a new one\n");
|
|
$myGlossary = $deeplClient->createMultilingualGlossary('Furry glossary', $dicts);
|
|
echo("Glossary created: $myGlossary->name ID: $myGlossary->glossaryId\n");
|
|
echo("put this id in .env file\n");
|