rubensayshi / gw2spidy

GW2Spidy - Guild Wars 2 Tradingpost Graphs
http://www.gw2spidy.com
231 stars 86 forks source link

other languages #5

Open rubensayshi opened 12 years ago

rubensayshi commented 12 years ago

DE / FR / etc?

tibrox commented 12 years ago

Hi, i'm french. how can I help you with the translation? Could you parse the french trading post to have items in french ?

rubensayshi commented 12 years ago

I haven't figured out yet how I can get the tradingpost data in french / german and multi language support requires a lot of technical stuff.

So there are some other stuff I want to do first, nice to know I got some1 to translate some stuff though :D

wrufeger commented 12 years ago

Probably a lot of work, but if you change $defaultHeaders in /src/GWSoidy/Util/CurlRequest.php to whatever you prefer ("Accept-Language: de-de,de;q=0.5" for german) you get all responses in german language. But you have to adjust the whole TradingPostSpider to handle the new german keywords. Happy coding ;)

wrufeger commented 12 years ago

Changing the one line and starting with empty db tables did the job. Even all special chars display the right way, just have to adjust the web frontend a bit.

rubensayshi commented 12 years ago

hmm, thats good to know thanks :)

DerGernTod commented 5 years ago

do you accept pull requests? maybe i'll give it a try :)

rubensayshi commented 5 years ago

hey @DerGernTod , the project is pretty dorment development wise, though there's still 15k visitors monthly so if you'd put in the effort I would of course review and accept the PR ;)

PS. language distribution from ganalytics; image

DerGernTod commented 5 years ago

really easy to get the dev environment running with vagrant, good job on that! the only thing i needed was running grunt for the js and css resources to be available, and also update the vagrant box url (precise64, the old url wasn't working anymore), but apart from that everything worked immediately. now regarding the i18n stuff: looks like you basically can add &lang=<supported lang> to any request and it'll return the respective translation. i think i'll try something with separate tables per language, e.g. items_de and so on, and read the lang from maybe a session cookie or something. will also need to adapt the fetching tools (since they'll have to do the same task once per language). the api states there's 5 supported languages: https://wiki.guildwars2.com/wiki/API:2

Valid languages are en, es, de, fr and zh. If no language parameter is set, the language defaults to en.

sounds good? not sure how much time i got in the near future but it'll probably be quite some work, since most of the sql statements have the table name hardcoded obviously, so i'll have to adapt that at quite some locations.

rubensayshi commented 5 years ago

I think the market data is the same independent of the language right?

so all that would be needed is to use the API once to get the translated names for the the items and recipes and store that?

I think I run https://github.com/rubensayshi/gw2spidy/blob/master/tools/update-items-from-api.php nightly with a cron, so it could be added to that, or something similar that is running seperatly