MrGreenGaming / MTA-Resources

All resources used on the Mr. Green Gaming MTA servers (Race & Race Mix).
https://mrgreengaming.com
32 stars 50 forks source link

Multi-lingual resources #21

Open esdeka opened 8 years ago

esdeka commented 8 years ago

My line of thought:

Language is detected with GetLocalization, so we don't have to make a selection gui (we'll still add an option to change it in /settings) Translation resource that has all translation files Files are for each resource and language separate in xml so people can easily translate them Resource triggers an event for resources to get their translations Each resource will need an update function to change the text

AleksCore commented 8 years ago

Today I tried to make this resource but I got problems with xmlNodeGetAttributes. Seems like it returns table for me but this table is empty or what. I would be happy to get some help. :) Draft

AleksCore commented 8 years ago

I think "Files are for each resource and language separate in xml" isn't really needed. Keep translations for all resources in one "english.lua" file even better, because all searches you will do in one file, so it's easy to find a text that you need. Translations in "english.lua" could be separated by comments like this: --gcshop resource --race resource

Also, there is ready-for-use resource in mta community. Click

"Each resource will need an update function to change the text" it's also isn't really needed. I have an easy solution and it's pretty good imo: if somebody want to change language in settings, he will be noticed, that he will need to reconnect to change language and there will appear a GUI button to reconnect. You don't change language every day, week, month, and most players will never change the default-detected language, so there is no problems with this and no reason to do unnecessary job :)

Please correct me if I'm wrong.