Use language field when offering translations
Seniru opened this issue · comments
Currently the module uses the community
field of players and room to offer translations to the player
But with a new update of transformice, the new field language
was added to both player and room. The structure looks as belows
tfm = {
---
get = {
room = {
community = "en",
language = "int", -- new field
playerList = {
["King_seniru#5890"] = {
---
community = "ph",
language = "tl"
}
}
}
}
}
Full structure of tfm
:
exec: {...}, enum: {...}
get: {misc: {apiVersion: 0.28, transformiceVersion: 6.98}, room: {playerList: {Lightymouse#0421: {isJumping: false, isShaman: false, movingLeft: false, movingRight: false, vx: 0, isInvoking: false, cheeses: 0, title: 123, spouseName: king_seniru#5890, look: 164;0,9_0,0,0,0,0,0,25,0, isVampire: false, gender: 0, vy: 0, playerName: Lightymouse#0421, inHardMode: 2, isDead: false, y: 271, x: 399, isFacingRight: true, tribeId: 1051168, id: 75771821, community: en, language: int, registrationDate: 1439997446717, spouseId: 89818485, tribeName: We Talk A Lot, hasCheese: false, score: 3, shamanMode: 2}, King_seniru#5890: {isJumping: false, isShaman: false, movingLeft: false, movingRight: false, vx: 0, isInvoking: false, cheeses: 0, title: 121, spouseName: lightymouse#0421, look: 1;0,0,0,17,0,0,0,0,0, isVampire: false, gender: 2, vy: 0, playerName: King_seniru#5890, inHardMode: 2, isDead: false, y: 271, x: 399, isFacingRight: false, tribeId: 1051168, id: 89818485, community: ph, language: tl, registrationDate: 1482900756347, spouseId: 75771821, tribeName: We Talk A Lot, hasCheese: false, score: 3, shamanMode: 2}}, passwordProtected: false, maxPlayers: 50, community: xx, mirroredMap: false, currentMap: 0, isTribeHouse: false, language: int, uniquePlayers: 2, objectList: {}, name: *#pewpew0dev}}}
- Use
language
field instead ofcommunity
in translations - Rename translation files to the appropriate language instead of community name
- Update the
translate
function
There are actually some issues with player.community
and player.language
- which is that they are room dependant according to the following:
[room name] community-language
[*#test] e2-en
[•] You're now on the [Portugais_Brésilien] community.
[*#test] br-br
[•] You're now on the [Anglais] community.
[br-#test] br-br
[es-#test] es-es
And therefore normal players couldn't get the correct translations, which makes adding new translations kind-of useless (for now)
So it' s clear that we can't do anything to this issue too... will be closed until transformice itself fixes this issue
Reopened because the language issue has been fixed.