Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localisation framework to cover official resources #361

Open
Dutchman101 opened this issue Oct 31, 2021 · 8 comments
Open

Localisation framework to cover official resources #361

Dutchman101 opened this issue Oct 31, 2021 · 8 comments

Comments

@Dutchman101
Copy link
Member

Dutchman101 commented Oct 31, 2021

All official resources in this repository (except for hedit - see relevant comment) target the English language only, but we can do much better due to the variety of players from different countries MTA attracts, including to servers that use default resources.

We will set a goal of creating/implementing a localisation framework that extends to as many resources in mtasa-resources as possible, ideally using a web-end like https://translate.mtasa.com/ for a community translation effort.

Additional context

  • once the localisation framework is done, see about replacing the custom one in hedit with the global one
  • Due to the lack of a system for updating official resources with custom localisation, for now it is suggested to make the exceptions that are described in PR 359#comment
@Disinterpreter
Copy link
Member

Good idea! But I think we need more data, like:

  • How it can be connect with another resources?
  • Is there an example of files(with different languages) which Pootle support?

P.S I think my questions are better for different issues or for the discussion.

@patrikjuvonen
Copy link
Contributor

FYI, I think we still have an unused open-source license for Crowdin https://crowdin.com/, which is much better than our current Pootle setup.

@Inder00
Copy link
Contributor

Inder00 commented Oct 31, 2021

Good idea! There is a lot work with translations (for ex. hedit).

@ricksterhd123
Copy link
Contributor

I have a few stupid question regarding this. Maybe I don't quite understand what you mean by framework.

  1. Is there a relatively nice way to get the language which the user has set in MTA? I feel it would make more sense to wait for this functionality (unless it's already available) rather than using other methods such as time/keyboard layout to determine which language to use.

  2. How does each resource share this framework? Will we use exports or just add the files to each and every resource? If one change is made in the framework then all other versions will need changing too if we choose the latter. It seems to make sense to use exports but I'm really not a big fan.

It probably makes more sense for MTA to provide functionality (assuming that this does not exist already - I did breifly check the wiki) to get the user's selected language in-game. This way we wouldn't need a framework, instead we just do similar to what hedit is already doing but for all the other scripts in a consistent way.

@xLive
Copy link
Member

xLive commented Oct 31, 2021

Is there a relatively nice way to get the language which the user has set in MTA? I feel it would make more sense to wait for this functionality (unless it's already available) rather than using other methods such as time/keyboard layout to determine which language to use.

Yes, getLocalization

@Vampiiree
Copy link

This is definitely a brilliant idea and I look forward to helping with translations. I even spoke to ricksterhd123 yesterday about the possibility of having other languages added to hedit.

@jlillis
Copy link
Contributor

jlillis commented Nov 8, 2021

I had some ideas about support for resource translations but didn't think there would be enough interest to get something implemented. A proper framework would require changes to mtasa-blue to support things cleanly. My idea:

1 - Resources define translation files via meta.xml - in the case of GNU gettext (i.e Pootle) standard, this would be .pot and .po files.
2 - Client automatically downloads the "default" translation file and the translation file matching their system locale.
3 - Scripts can access translated strings within scripts via new functions. gettext(string, locale) for example.

For official resources, we would just want to agree on naming conventions and file/folder layouts so we can just point Pootle/Crowdin/whatever platform at the translation files.

@Fernando-A-Rocha
Copy link
Contributor

I had some ideas about support for resource translations but didn't think there would be enough interest to get something implemented. A proper framework would require changes to mtasa-blue to support things cleanly. My idea:

1 - Resources define translation files via meta.xml - in the case of GNU gettext (i.e Pootle) standard, this would be .pot and .po files. 2 - Client automatically downloads the "default" translation file and the translation file matching their system locale. 3 - Scripts can access translated strings within scripts via new functions. gettext(string, locale) for example.

For official resources, we would just want to agree on naming conventions and file/folder layouts so we can just point Pootle/Crowdin/whatever platform at the translation files.

10/10 this seems like the best solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants