
You are viewing a potentially older version of this package. View Latest Version
Allspeak
Detects the language of incoming chat messages and shows a translation in the chat panel.Allspeak (Valheim client-side mod)
BepInEx plugin that detects the language of incoming chat messages and shows a translation in the chat panel. Messages already in the target language, or in a language you've marked as ignored, are left alone.
Behavior
- Harmony postfix on
Chat.OnNewChatMessagecatches each incoming message. - One request to Google's unofficial
clients5.google.com/translate_a/t?client=dict-chrome-exendpoint detects the source language and translates in the same call. - If the detected language equals
TargetLanguageor is inIgnoredLanguages, nothing is shown. - Otherwise a line like
[de→en] Hello thereis added viaChat.instance.AddString. - On world join, a test translation shows
Allspeak is activein the target language (orAllspeak inactive, check logson failure). - Runs as a Unity coroutine using
UnityWebRequest(no threading issues).
Config (BepInEx/config/com.iyon.allspeak.cfg)
Created on first game launch. Editable in r2modman / Thunderstore Mod Manager (Config editor) or any text editor; restart game to apply.
| Key | Default | Meaning |
|---|---|---|
| Enabled | true | Master switch |
| TargetLanguage | auto |
Language to translate into. auto = game's UI language (fallback en). Otherwise a code from Supported languages, e.g. en, de, no, pt-PT, zh-TW |
| IgnoredLanguages | (empty) | Comma-separated codes you understand, e.g. de,fr. Messages detected as these aren't translated |
| SkipOwnMessages | true | Don't translate messages you send yourself |
Supported languages
Google Translate target codes (249), from clients5.google.com/translate_a/l?client=dict-chrome-ex&hl=en (tl). Valid for TargetLanguage and IgnoredLanguages.
| Code | Language | Code | Language | Code | Language |
|---|---|---|---|---|---|
ab |
Abkhaz | iw |
Hebrew | os |
Ossetian |
ace |
Acehnese | hil |
Hiligaynon | pag |
Pangasinan |
ach |
Acholi | hi |
Hindi | pap |
Papiamento |
aa |
Afar | hmn |
Hmong | ps |
Pashto |
af |
Afrikaans | hu |
Hungarian | fa |
Persian |
sq |
Albanian | hrx |
Hunsrik | pl |
Polish |
alz |
Alur | iba |
Iban | pt |
Portuguese (Brazil) |
am |
Amharic | is |
Icelandic | pt-PT |
Portuguese (Portugal) |
ar |
Arabic | ig |
Igbo | pa |
Punjabi (Gurmukhi) |
hy |
Armenian | ilo |
Ilocano | pa-Arab |
Punjabi (Shahmukhi) |
as |
Assamese | id |
Indonesian | qu |
Quechua |
av |
Avar | iu-Latn |
Inuktut (Latin) | kek |
Qʼeqchiʼ |
awa |
Awadhi | iu |
Inuktut (Syllabics) | rom |
Romani |
ay |
Aymara | ga |
Irish | ro |
Romanian |
az |
Azerbaijani | it |
Italian | rn |
Rundi |
ban |
Balinese | jam |
Jamaican Patois | ru |
Russian |
bal |
Baluchi | ja |
Japanese | se |
Sami (North) |
bm |
Bambara | jw |
Javanese | sm |
Samoan |
bci |
Baoulé | kac |
Jingpo | sg |
Sango |
ba |
Bashkir | kl |
Kalaallisut | sa |
Sanskrit |
eu |
Basque | kn |
Kannada | sat-Latn |
Santali (Latin) |
btx |
Batak Karo | kr |
Kanuri | sat |
Santali (Ol Chiki) |
bts |
Batak Simalungun | pam |
Kapampangan | gd |
Scots Gaelic |
bbc |
Batak Toba | kk |
Kazakh | nso |
Sepedi |
be |
Belarusian | kha |
Khasi | sr |
Serbian |
bem |
Bemba | km |
Khmer | st |
Sesotho |
bn |
Bengali | cgg |
Kiga | crs |
Seychellois Creole |
bew |
Betawi | kg |
Kikongo | shn |
Shan |
bho |
Bhojpuri | rw |
Kinyarwanda | sn |
Shona |
bik |
Bikol | ktu |
Kituba | scn |
Sicilian |
bs |
Bosnian | trp |
Kokborok | szl |
Silesian |
br |
Breton | kv |
Komi | sd |
Sindhi |
bg |
Bulgarian | gom |
Konkani | si |
Sinhala |
bua |
Buryat | ko |
Korean | sk |
Slovak |
yue |
Cantonese | kri |
Krio | sl |
Slovenian |
ca |
Catalan | ku |
Kurdish (Kurmanji) | so |
Somali |
ceb |
Cebuano | ckb |
Kurdish (Sorani) | es |
Spanish |
ch |
Chamorro | ky |
Kyrgyz | su |
Sundanese |
ce |
Chechen | lo |
Lao | sus |
Susu |
ny |
Chichewa | ltg |
Latgalian | sw |
Swahili |
zh-CN |
Chinese (Simplified) | la |
Latin | ss |
Swati |
zh-TW |
Chinese (Traditional) | lv |
Latvian | sv |
Swedish |
chk |
Chuukese | lij |
Ligurian | ty |
Tahitian |
cv |
Chuvash | li |
Limburgish | tg |
Tajik |
co |
Corsican | ln |
Lingala | ber-Latn |
Tamazight |
crh |
Crimean Tatar (Cyrillic) | lt |
Lithuanian | ber |
Tamazight (Tifinagh) |
crh-Latn |
Crimean Tatar (Latin) | lmo |
Lombard | ta |
Tamil |
hr |
Croatian | lg |
Luganda | tt |
Tatar |
cs |
Czech | luo |
Luo | te |
Telugu |
da |
Danish | lb |
Luxembourgish | tet |
Tetum |
fa-AF |
Dari | mk |
Macedonian | th |
Thai |
dv |
Dhivehi | mad |
Madurese | bo |
Tibetan |
din |
Dinka | mai |
Maithili | ti |
Tigrinya |
doi |
Dogri | mak |
Makassar | tiv |
Tiv |
dov |
Dombe | mg |
Malagasy | tpi |
Tok Pisin |
nl |
Dutch | ms |
Malay | to |
Tongan |
dyu |
Dyula | ms-Arab |
Malay (Jawi) | lua |
Tshiluba |
dz |
Dzongkha | ml |
Malayalam | ts |
Tsonga |
en |
English | mt |
Maltese | tn |
Tswana |
eo |
Esperanto | mam |
Mam | tcy |
Tulu |
et |
Estonian | gv |
Manx | tum |
Tumbuka |
ee |
Ewe | mi |
Maori | tr |
Turkish |
fo |
Faroese | mr |
Marathi | tk |
Turkmen |
fj |
Fijian | mh |
Marshallese | tyv |
Tuvan |
tl |
Filipino | mwr |
Marwadi | ak |
Twi |
fi |
Finnish | mfe |
Mauritian Creole | udm |
Udmurt |
fon |
Fon | chm |
Meadow Mari | uk |
Ukrainian |
fr |
French | mni-Mtei |
Meiteilon (Manipuri) | ur |
Urdu |
fr-CA |
French (Canada) | min |
Minang | ug |
Uyghur |
fy |
Frisian | lus |
Mizo | uz |
Uzbek |
fur |
Friulian | mn |
Mongolian | ve |
Venda |
ff |
Fulani | my |
Myanmar (Burmese) | vec |
Venetian |
gaa |
Ga | bm-Nkoo |
NKo | vi |
Vietnamese |
gl |
Galician | nhe |
Nahuatl (Eastern Huasteca) | war |
Waray |
ka |
Georgian | ndc-ZW |
Ndau | cy |
Welsh |
de |
German | nr |
Ndebele (South) | wo |
Wolof |
el |
Greek | new |
Nepalbhasa (Newari) | xh |
Xhosa |
gn |
Guarani | ne |
Nepali | sah |
Yakut |
gu |
Gujarati | no |
Norwegian | yi |
Yiddish |
ht |
Haitian Creole | nus |
Nuer | yo |
Yoruba |
cnh |
Hakha Chin | oc |
Occitan | yua |
Yucatec Maya |
ha |
Hausa | or |
Odia (Oriya) | zap |
Zapotec |
haw |
Hawaiian | om |
Oromo | zu |
Zulu |
Dev setup
Develop on macOS, build + run on Windows.
Layout:
src/Allspeak.csproj— net48, SDK-stylesrc/Plugin.cs— entire pluginlib/— game DLLs for macOS builds (gitignored)scripts/copy-libs.ps1— collects game DLLs on Windows
Refs:
BepInEx.Core(incl. HarmonyX0Harmony) — NuGet, BepInEx feed (NuGet.config)assembly_valheim— publicized at build time viaBepInEx.AssemblyPublicizer.MSBuildassembly_guiutils(Localization) — publicized, from gameassembly_utils,UnityEngine*— from gamevalheim_Data/Managed/
macOS
- Install .NET SDK:
brew install --cask dotnet-sdk - On Windows:
scripts\copy-libs.ps1, copy resultinglib\*.dllintolib/here. dotnet build— compile check only.
Windows
- Install .NET SDK + BepInEx 5.4.x into Valheim.
dotnet build— default Steam path auto-detected; elsedotnet build -p:ValheimPath="D:\...\Valheim"(or env varValheimPath).- DLL auto-copied to
Valheim\BepInEx\plugins\when that folder exists.
Testing
Valheim has no native macOS build. Test on Windows (or a Windows VM) with BepInEx 5.4.x installed.
Known issues / TODO
- Signature drift:
Chat.OnNewChatMessageparameters change between game versions. Verifytype,user,textin a decompiler (ILSpy / Rider). - Short messages ("gg", "lol") are often misdetected. Consider a minimum-length check.
- Privacy / reliability: chat text is sent to Google; the free endpoint may rate-limit or change. Consider DeepL free API (returns
detected_source_language) or self-hosted LibreTranslate. - Not covered: speech bubbles above players' heads are not translated, only the chat panel.
- Possible additions: translation cache, per-player ignore list, hotkey toggle.