#can I get some how player main language?
1 messages · Page 1 of 1 (latest)
what
I wanna get it to localize action form
Lang that player use in minecraft
are you asking for the lang files
No, I asking how to make it in form button in script file. How to bind localisation from js file to script code
huh
he want a way to get what language the player using in minecraft
it is a client side info
so you probably can't
Commands get affected by the langs chosen though...
kill @e[type=item,name="Coal"]
kill any item entities called Coal (and yes, it killed renamed Items and an actual minecraft:coal item)
This is affected by the langs in the settings. Since "Coal" can be different in each language, you can somewhat detect what language they use.
You can use a resource pack. If you check docs name of stuff in forms supports rawMessage meaning you can add custom message that will be displayed in the right language to people using the resource pack. Remember that you’ll need a translation for every language yo wanna add
Got it
ok i can put this in to a button but what should i make to make localisation { translate: "permissions.removeplayer" } I mean how minecraft replace this permissions.removeplayer
resource pack lang files
#1067869590400544869
hey! I have a similar question
I have something like this:javascript var textBlueprints = { translate: `test.word.blueprints` }; var translatedText = textBlueprints.translate; var testVar = `${translatedText == "Blueprints" ? scoreEnUS : translatedText == "Baupläne" ? scoreDeDE : translatedText == "Planos" ? scoreEsES : translatedText == "Plans" ? scoreFrFR : translatedText == "設計図" ? scoreJaJP : scorePtBR}`; here the variable testVar should take a different value (scoreEnUS, scoreDeDE, etc.) depending on the value of the translation of test.word.blueprints, that's depending on the language the game is using
but it's not working, I mean the variable testVar is always returning scorePtBR as value instead (that's it takes the last value of the condition, meaning that none condition is being met), does anyone know why?
I'm sure that test.word.blueprints have Blueprints as value inside the en_US.lang file, so when I'm using English (United States) language in game then test.word.blueprints should have Blueprints as value, so no idea why the conditions inside the variable testVar are not working 🤷
I see it's because translatedText is returning "test.word.blueprints", but why?
it should return the translation of `test.word.blueprints`
🤨
btw I'm working on stable
translations only work once they're passed to the client, afaik
so there's no way to check what language is used in game?
nope