Open Sparh4wk opened 3 years ago
It's possible but i don't have a template in these languages. And google translate dont work perfect with russian and korean
well its always starting with 안녕하세요 and Здравствуйте which means Hi/Hello. so why not just detecting those?
The issue is not only about starting letters, it needs to be sliced into groups. For example when slicing english message you need something like this:
"^(.\s)?(.+): (.+ to buy your\s+?(.+?)(\s+?listed for\s+?([\d\.]+?)\s+?(.+))?\s+?in\s+?(.+?)\s+?\(stash tab \"(.)\"; position: left (\d+), top (\d+)\)\s?(.))$"
I did started some work on it few weeks ago and made this:
^(.\s)?(.+): (안녕하세요, (.+?)\s(보관함 탭 "(.)", 위치: 왼쪽 (\d+), 상단 (\d+))에\s+?([\d.])\s(.)\s(으)로 올려놓은\s(.)을(를) 구매하고 싶습니다\s(.*))$
but it's not working properly yet :/
It's just a lot of work with translations etc.
In case it helps, here's some more language samples:
Hi, I would like to buy your The Putrid Cloister Museum Map (T11) listed for 10 chaos in Ritual (stash tab "~price 10 chaos"; position: left 5, top 6)
Hi, ich möchte 'Das faulige Kloster 'Museum'-Karte (Lvl. 11)' zum angebotenen Preis von 10 chaos in der Ritual-Liga kaufen (Truhenfach "sell"; Position: 7 von links, 12 von oben)
Здравствуйте, хочу купить у вас Тлетворная обитель Карта музея (T11) за 10 chaos в лиге Ритуал (секция "trade"; позиция: 1 столбец, 1 ряд)
안녕하세요, 의식(보관함 탭 "판매", 위치: 왼쪽 7, 상단 12)에 10 chaos(으)로 올려놓은 악취 나는 수도원(The Putrid Cloister) 박물관 지도(Museum Map)(T11)(을)를 구매하고 싶습니다
hopefully you can do this, cause right now its like 70%+ trades are not from english ppl :( but otherwise its the best one!
@queicherius That will be extremely helpful. Thank you for your contribution
@Morph21 Hi there! I might help you tremendously!
You can find every (not item) name in the official trade site by changing your language in the right top and go to https://de.pathofexile.com/trade/about
For korean numbers I would suggest searching up the numbers https://en.wikipedia.org/wiki/Korean_numerals
Doing everything yourself would be a pain in the ass better filter through a HTTP request and the position where which name the item has for incoming whispers!
https://www.pathofexile.com/character-window/get-stash-items?accountName=stringName&tabIndex=stringName&league=stringName
Looking at the poe api responses can give some clues.
Here is one in korean:
You can see the whisper: @해그톡식 안녕하세요, 결전(보관함 탭 \"판매\", 위치: 왼쪽 2, 상단 5)에 7 exalted(으)로 올려놓은 레벨 5 23% 각성한 치명적인 상태 이상 보조(을)를 구매하고 싶습니다
and the json lets you find the stash tab name, which is 판매
,
the stash x: 1
(shown as 2
),
the stash y: 4
(shown as 5
),
the price of 7 exalted
,
the username 해그톡식
.
What is missing is to find and translate the item names.
At least 5 23%
is part of it.
As an initial solution, one can display the foreign (Korean) item names, as long as the price and username is correct.
If that is hard, maybe just display "unknown"
or something like that.
I created a junit test for different languages. It can be improved with more samples and languages.
https://github.com/krissrex/MercuryTrade-Community-Fork/commit/6e9bb41982bcf07ce8fc29a48ef1bb365a22b96a
It tests the TradeOutMessagesInterceptor
.
I did some work on the regex parsing. It should work for Russian and Korean. I need some more trade samples for Thai, but I rarely see Thai trades now anyways.
The item names are not translated yet. This means the notifications would show e.g. Korean names for items. But the player name and price is correct, so it should help enough for outgoing trades.
It's possible but i don't have a template in these languages. And google translate dont work perfect with russian and korean
I got multiple different trades for the same language, and compared them to see what differed. It took some time, but it worked.
To find the league names, I used the flag-icon in the top right to visit different pathofexile.com trade sites, and copied the text from the league selection dropdown.
Here are two Russian currency trades:
@Я_ЕБАЛ_УЛЬТИМАТУМ Здравствуйте, хочу купить у вас 1 Масло индиго за 1 Сфера хаоса в лиге Ultimatum.
1 indigo oil for 1 chaos.@xNewExpx Здравствуйте, хочу купить у вас 1 Фиолетовое масло за 2 Сфера хаоса в лиге Ultimatum.
1 violet oil for 2 chaos.German item trades:
@Shiekaa Hi, ich möchte 'Stufe 1 18% Klingenwirbel' zum angebotenen Preis von 1 chaos in der Ultimatum-Liga kaufen (Truhenfach "~price 1 chaos"; Position: 2 von links, 8 von oben)
@Psychofotze Hi, ich möchte 'Chimären-Ruf Verstärkter Zauberstab' zum angebotenen Preis von 4 chaos in der Expedition-Liga kaufen (Truhenfach "Restmüll"; Position: 1 von links, 9 von oben)
A Thai item trade:
@Darkplayer_Ultimatum_ll สวัสดี เราต้องการชื้อ Brimstone Nails Slink Gloves ของคุณซึ่งตั้งขายไว้ในราคา 50 chaos ในลีก Ultimatum (คลังชื่อ "ขายของ2"; ตำแหน่ง: ซ้าย 1, บน 7)
A spanish item trade:
@VULPERRA Hola, quisiera comprar tu Nudillo de Pandemonio Guantes de nexo listado por 60 chaos en Ultimatum (pestaña de alijo "subasta"; posición: izquierda7, arriba 1)
A french skill gem trade:
@Askip_Le_Build_Est_Fort Bonjour, je souhaiterais t'acheter Gemme de soutien éveillée : Dégâts élémentaires des Attaques de niveau 5 à 20% de qualité pour 5 exalted dans la ligue Scourge (onglet de réserve "~price 1 chaos" ; 5e en partant de la gauche, 4e en partant du haut)
(5 ex for Awakened Elemental Damage with Attacks Support
)
Hi,
is it possible to add support for detecting other language like Russian, Chinese etc when using whisper feature on pathofexile trade website?
so msges like this one:
@Трейнгар Здравствуйте, хочу купить у вас Табула раса Матерчатая безрукавка за 6 chaos в лиге Ритуал (секция "Trade"; позиция: 3 столбец, 2 ряд)
or this one:
@캐릭명좆같네 안녕하세요, 의식(보관함 탭 "거래", 위치: 왼쪽 11, 상단 1)에 6 chaos(으)로 올려놓은 타뷸라 라사(Tabula Rasa) 단순한 로브(을)를 구매하고 싶습니다
are properly detected as trade messages and pasted into game?
thanks!
btw good job on this "addon"